hutscape / cactus

🌵 Indoor WiFi-connected temperature and humidity sensor 🍶
https://hutscape.com/cactus/
MIT License
7 stars 2 forks source link

bar led + shift register + nodeMCU #3

Closed sayanee closed 7 years ago

sayanee commented 7 years ago

Related to #2

int latchPin = 15; // pin D8 on NodeMCU boards
int clockPin = 14; // pin D5 on NodeMCU boards
int dataPin = 13; // pin D7 on NodeMCU boards

void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  shiftOut(dataPin, clockPin, MSBFIRST, 1); // Try LSBFIRST and digits from 1 to 2^8 (8 leds)
  digitalWrite(latchPin, HIGH);
}

img_4356