Using Post Width Modulation with LED's and the micro:bit

Hi,

I am wondering if its possible to code the micro:bit to run the LED Array with the POT like this video has it do at the 10:15 mark?

https://www.youtube.com/watch?v=7R5SfKs … e=emb_logo

I am hoping to do this experiment with my students and their micro:bit inventors kit.

Hello abehnke.

I would imagine it might be possible.

I don’t have a lot of information on exactly how the micro:bit handles it’s LED matrix, but I ran across some information somewhere that seems to indicate the matrix is already being driven with PWM internally to produce the effect of multiple LEDs being lit at the same time. (I’m not quite sure PWM would be the correct terminology for this. ‘Persistence of vision’ better describes what’s going on.)

You could probably try to write code that does the same thing but I don’t know if the micro:bit would execute the code quickly enough if it’s already multiplexing and PWM’ing the matrix behind the scenes. Give it a try and see what happens, if it doesn’t work on the built in matrix, you could make your own with 6 LEDs and the micro:bit should be able to toggle those pins quickly enough to produce the effect you’re looking for.