Today I made a (sort of) electronic musical instrument with a BBC microbit and an old BBC radio studio fader.
It’s wired up like I did previously, only I used pin 1 in place of pin 0 – as pin 0 is used for connecting the speaker.
Here’s the Python code, all 8 lines of it – perhaps someone musical can give me better arpeggiator numbers!
from microbit import * import music while True: fader_reading = pin1.read_analog() display.scroll(str(fader_reading),wait=False) music.pitch(fader_reading, 100) music.pitch(fader_reading+100, 100) music.pitch(fader_reading+200, 100)