Working my way through the kit. Would like to modify the code in Example 16 from watching LEDS light as a counter goes from 0-7, to watching the LEDS count in binary from 0-255. Can somebody point me in the right direction for the needed functions to add to the code? Or maybe the code is already out there?
Manual to post code:
go to Arduino IDE with your code
do a rightclick
choose "copy for forum" from the context menu
switch to browser
paste clipboard into textwindow
one basic idea is
define a variable to count
byte MyCounter
count up the variable from 0 to 255
define variables for each of the 8 LEDs
byte LED0, LED1, LED2 .. LED7
do a bitwise AND-operation to filter the related bit
Thx for your reply, it helped me look in the right direction.
Ex 16 in the Elegoo starter kit shows code to turn on bits 0-7 of 8 leds at the outputs of 74hc595 using the bitSet command. One led at a time. I tried to attach a movie of the result (shift register.mp4); size limitation.
I wanted to see something more interesting like the led displays for counting 0-255. The code I wrote is attached (my_eight_led_with_74hc595.ino).
The movie of the result is attached (binary counting.mp4) wont let me. One thing I learned is the kit has you set up the leds with the lsb at the left which is visually wrong. It should be on the right. Fun anyway.