Robert T
Member level 1
I have spent 3 days trying to find and understand code to turn simply turn on some LED's through the 74HC595, so figured must be time to ask and see if anyone can help.
Have read the manuals and tried many examples from Mikro and posts.
I can write for Arduino but cannot get a handle on what is happening with 'C'. Have tried the Mikro Soft SPI and could not get it to work.
If anyone can write a few lines so that I can understand how the data is transferred to turn on the LED's that would be greatly appreciated.
There are 8 LEDS attached to the 74HC595.
Would like to turn on/off individual LEDs using binary eg 0b00110011
This is the start of my code.
Thanks in advance.
Robert
Have read the manuals and tried many examples from Mikro and posts.
I can write for Arduino but cannot get a handle on what is happening with 'C'. Have tried the Mikro Soft SPI and could not get it to work.
If anyone can write a few lines so that I can understand how the data is transferred to turn on the LED's that would be greatly appreciated.
There are 8 LEDS attached to the 74HC595.
Would like to turn on/off individual LEDs using binary eg 0b00110011
This is the start of my code.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 #define CLOCK1 PORTD.F0; // RD0 -----> Pin 11 Clock #define LATCH1 PORTD.F1; // RD1 -----> Pin 12 Latch #define DATA1 PORTD.F2; // RD2 ------> Pin 14 Data void main() { TRISD.F0 = TRISD.F1 = TRISD.F2 = 0; // Pins set to output // send 0b00110011 to 74HC595 // clock? // latch low to receive data // latch high for 74HC595 to turn on LEDs } }
Thanks in advance.
Robert