mirror of
https://github.com/KevinMidboe/Arduino.git
synced 2025-10-29 17:40:11 +00:00
Init commit with many years of arduino sketches and projects. I dont know if the esp8266 includes much, but there are also libraries. I hope they dont have crazy automatic versioning through the Arduino IDE.
This commit is contained in:
37
Projects/Temp Main/TEMP02/TEMP02.ino
Executable file
37
Projects/Temp Main/TEMP02/TEMP02.ino
Executable file
@@ -0,0 +1,37 @@
|
||||
int latchPin = 12;
|
||||
int clockPin = 11;
|
||||
int dataPin = 13;
|
||||
byte leds = 0;
|
||||
int currentLED = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(latchPin, OUTPUT);
|
||||
pinMode(dataPin, OUTPUT);
|
||||
pinMode(clockPin, OUTPUT);
|
||||
|
||||
leds = 0;
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
leds = 0;
|
||||
|
||||
if (currentLED == 7)
|
||||
{
|
||||
currentLED = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentLED++;
|
||||
}
|
||||
|
||||
bitSet(leds, currentLED);
|
||||
|
||||
digitalWrite(latchPin, LOW);
|
||||
delay(250);
|
||||
shiftOut(dataPin, clockPin, LSBFIRST, leds);
|
||||
digitalWrite(latchPin, HIGH);
|
||||
|
||||
delay(250);
|
||||
}
|
||||
Reference in New Issue
Block a user