I have 5 LEDs connected to 5 digital pins 2 to 6. I want to send via serial port a string of a combination of 5 characters “0” or “1” to turn on a combination of the 5 LEDs for a given time duration. Sending “00001” would turn LED1, “00010” LED2, etc or combinations like “10101” for LED1, LED3, and LED5 for example.
Many strange things happen:
LED5 is never turned on. I had to add LED6 to have LED5 working Pins 2 to 6 are connected but I had to initialize them as 1 to 5. If I initialize them as 2 to 6, LED1 doses not work. After the time delay, I set all 5 pins to LOW, but when sending the next combination string the pious pins a still high for a fraction of second, and this is annoying for my application.
Any help? Thank you