You need to log in to create posts and topics.

Controlling multiple LEDs with Micro:bit

Saige and I have been working to control multiple LEDs with the Micro:bit. So far we have been able to control a total of 8 LEDs.

Even though the Micro:bit has 20 pins it seems that 12 of them are being used for other purposes by default.

Is there a way to override the default pin purpose so that we could control an LED with it?

Cheers,

Ben

Micro:bit pin diagram

 

Hi Saige/Ben,

Am assuming you are trying to use each of the pins as a digital switch i.e. turn LED on/off but you haven't been able to get it to work?

Is there a particular pin that you are having issues using and are you able to please paste the code here (copy of the blocks).

I'll do a bit of reading up and also get @gregaryb @gboyles @neoxharsh to chip in.

Cheers/Trevor

 

We managed to get 8 LEDs working on pins 0,1,2,8,13,14,15,16

All other pins are unable to turn the LED on and off via digital pin write.

https://photos.google.com/photo/AF1QipPsgWJ5cIbxWlF5EKxPswlNVM8mIczZ3jencZyv

The above video was us with 5 working LEDs.

Cheers,
Ben

Hi Saige/Ben,

From my understanding, overriding the default purpose for the pins will be possible with a catch. The pins are physically connected directly to the mentioned functions. Disabling the attached function will be necessary before overriding it. For e.g.

P9 is connected to the LED Col 7, so if you want to use this pin, then the whole display subsystem needs to be disabled.

I would recommend having a read on Charlieplexing. It allows you to use fewer pins to operate more LED. You can connect n*(n-1) LED's, where n is the number of pins.

Cheers,

Harsh

Thanks @neoxharsh.

Saige/Harsh - Did a bit of Googling, here's what I've found -

http://www.multiwingspan.co.uk/arduino.php?page=charlie

https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/

I'll do a bit of reading myself and see if it makes any sense to me... 🙂

Cheers/Trevor