Created
December 26, 2020 23:06
-
-
Save jclement/bc5dab3e1c7fa846d9f42c1c32d20c4d to your computer and use it in GitHub Desktop.
Silly random 4 segment display thing for Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <TM1637Display.h> | |
#define CLK 2 | |
#define DIO 3 | |
TM1637Display display(CLK, DIO); | |
void setup() | |
{ | |
display.setBrightness(100); | |
} | |
void loop() | |
{ | |
int i; | |
uint8_t data[] = {0,0,0,0}; | |
display.setSegments(data); | |
while(1) { | |
for(i=0; i<4; i++) { | |
data[i] ^= (1 << random(7)); | |
} | |
display.setSegments(data); | |
delay(50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment