This time I came across Deepseek. I gave some simple prompts an could easily get working web apps and python projects.
Then I gave Annex-code a try.
I copied a working project file (ESP8266 with TM1638 module and piezo speaker) I use for several IoT devices over MQTT.
When asking to analyze the code the AI came up with clever WORKING optimizations and commented the code completly.
Inspired by this, I just asked to program a simple syntheziser with the obove setup.
And it worked INSTANTLY.
From now on I will allways start my projects with this approach.
Here is the code the AI produced.
TRY it yourself!
Code: [Local Link Removed for Guests]
'****************************************************
'** Synthesizer with Keyboard Input
'** Simulates a simple keyboard with 8 keys
'** Tones are two octaves higher (C6 to C7)
'** Note values (without octave) are displayed centered on the screen
'** Current time is displayed when no button is pressed
'****************************************************
'** Hardware Initialization
TM1638.SETUP 14, 12, 13 'Initialize TM1638 module (data pin, clock pin, strobe pin)
PIN.MODE 4, OUTPUT 'Configure pin 4 for audio output
'** Frequencies for the keys (in Hz)
'** Two octaves higher: C6 (1047 Hz) to C7 (2093 Hz)
DIM NOTES(8) = 1047, 1175, 1319, 1397, 1568, 1760, 1976, 2093 'C6, D6, E6, F6, G6, A6, B6, C7
'** Note values without octave for display
DIM NOTEN$(8) = " C ", " D ", " E ", " F ", " G ", " A ", " B ", " C "
'** Main Program Loop
DO
'** Read button status
A = TM1638.BUTTONS
'** Play a tone if a key is pressed
IF A > 0 THEN
'** Determine which key is pressed (0 to 7)
FOR I = 0 TO 7
IF (A AND (1 << I)) > 0 THEN
'** Set tone frequency based on the key
FREQ = NOTES(I)
'** Play the tone
PIN.TONE 4, FREQ, 100 'Play tone for 100 ms
'** Display the pressed note (centered) on the screen
TM1638.PRINT NOTEN$(I), 3
EXIT FOR 'Exit loop once a key is found
END IF
NEXT I
ELSE
'** No key pressed: Display the current time
CURRENT_TIME$ = LEFT$(TIME$, 2) + ":" + MID$(TIME$, 4, 2) 'Format as HH:MM
TM1638.PRINT CURRENT_TIME$, 3 'Display the time
END IF
'** Short pause to slow down the loop
PAUSE 50
LOOP