2 changed files with 45 additions and 12 deletions
@ -0,0 +1,37 @@
|
||||
// https://www.youtube.com/watch?v=FwiKHHUbuLI&list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP&index=43
|
||||
|
||||
#include <Arduino.h> |
||||
|
||||
int latchPin = 11; |
||||
int clockPin = 9; |
||||
int dataPin = 12; |
||||
|
||||
int dt = 25; |
||||
byte LED1s = 0b00000000; |
||||
byte LED2s = 0b01010101; |
||||
|
||||
|
||||
void setup() { |
||||
// put your setup code here, to run once:
|
||||
Serial.begin(9600); |
||||
pinMode(latchPin, OUTPUT); |
||||
pinMode(clockPin, OUTPUT); |
||||
pinMode(dataPin, OUTPUT); |
||||
|
||||
} |
||||
|
||||
void loop() { |
||||
// put your main code here, to run repeatedly:
|
||||
digitalWrite(latchPin, LOW); |
||||
shiftOut(dataPin, clockPin, LSBFIRST, LED1s); |
||||
digitalWrite(latchPin, HIGH); |
||||
delay(dt); |
||||
|
||||
Serial.println(LED1s, BIN); |
||||
LED1s++; |
||||
|
||||
// digitalWrite(latchPin, LOW);
|
||||
// shiftOut(dataPin, clockPin, LSBFIRST, LED2s);
|
||||
// digitalWrite(latchPin, HIGH);
|
||||
// delay(dt);
|
||||
} |
||||
Loading…
Reference in new issue