diff --git a/draft_code/buzzer.py b/draft_code/buzzer.py new file mode 100644 index 00000000..d21a1ead --- /dev/null +++ b/draft_code/buzzer.py @@ -0,0 +1,24 @@ +from machine import Pin, PWM +import time + +# Set up pin 46 as PWM output +buzzer = PWM(Pin(46)) + +# Function to play a tone (frequency in Hz, duration in seconds) +def play_tone(frequency, duration): + buzzer.freq(frequency) # Set frequency + buzzer.duty_u16(32768) # 50% duty cycle (32768 is half of 65536) + time.sleep(duration) # Play for specified duration + buzzer.duty_u16(0) # Stop the tone + +# Example: Play a 440 Hz tone (A4 note) for 1 second +play_tone(440, 1) + +# Optional: Play a sequence of notes +notes = [(261, 0.5), (293, 0.5), (329, 0.5), (349, 0.5)] # C4, D4, E4, F4 +for freq, duration in notes: + play_tone(freq, duration) + time.sleep(0.1) # Short pause between notes + +# Turn off the buzzer +buzzer.deinit() diff --git a/internal_filesystem/apps/com.quasikili.kilculator b/internal_filesystem/apps/com.quasikili.kilculator deleted file mode 120000 index 22e9cc13..00000000 --- a/internal_filesystem/apps/com.quasikili.kilculator +++ /dev/null @@ -1 +0,0 @@ -../../../MPOS-Kilculator/ \ No newline at end of file diff --git a/internal_filesystem/boot_fri3d-2024.py b/internal_filesystem/boot_fri3d-2024.py index 4f496475..a5787ee7 100644 --- a/internal_filesystem/boot_fri3d-2024.py +++ b/internal_filesystem/boot_fri3d-2024.py @@ -21,8 +21,8 @@ mpos.info.set_hardware_id("fri3d-2024") # Pin configuration SPI_BUS = 2 -SPI_FREQ = 40000000 -#SPI_FREQ = 20000000 # also works but I guess higher is better +#SPI_FREQ = 40000000 +SPI_FREQ = 20000000 # also works but I guess higher is better LCD_SCLK = 7 LCD_MOSI = 6 LCD_MISO = 8