Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: LED Control
- - Source Code NOT compiled for: Arduino Nano
- - Source Code created on: 2024-04-22 10:56:44
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* i'm working on an arduino project that aims to */
- /* test cables similair as the Cable Eye tester, im */
- /* using 8 shit registers and 9 demuxes (8 demux are */
- /* connected to the 9th one to be an input in the */
- /* arduino) and the system is connected to a counter */
- /* part us */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <ShiftRegister74HC595.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- void updateOutputs(void);
- /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
- const uint8_t r_LED_PIN_D2 = 2;
- /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
- bool r_LED_PIN_D2_rawData = 0;
- /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
- float r_LED_PIN_D2_phyData = 0.0;
- // Define the number of shift registers and the data pin
- const int numRegisters = 8;
- const int dataPin = 11;
- const int clockPin = 13;
- const int latchPin = 10;
- // Create an object for the ShiftRegister74HC595 library
- ShiftRegister74HC595 sr(numRegisters, dataPin, clockPin, latchPin);
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(r_LED_PIN_D2, OUTPUT);
- // Initialize the shift register
- sr.begin();
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- updateOutputs(); // Refresh output data
- }
- void updateOutputs()
- {
- // Update the shift register with the raw data
- sr.set(r_LED_PIN_D2_rawData, 0);
- sr.write();
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement