aboutsummaryrefslogtreecommitdiff
path: root/example/example.ino
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-11-26 22:24:14 +0100
committerlonkaars <loek@pipeframe.xyz>2021-11-26 22:24:14 +0100
commit61f4cce79a89af13e0d93c7166f8d2ee6202bd40 (patch)
treed245d1d1541e0c9a924eba80dc905a2b665664eb /example/example.ino
parent8e61621a34839404e981cdbc3a9f3c54a9f43be9 (diff)
whoopsie in readme and moved shit into tests/ folder
Diffstat (limited to 'example/example.ino')
-rw-r--r--example/example.ino88
1 files changed, 0 insertions, 88 deletions
diff --git a/example/example.ino b/example/example.ino
deleted file mode 100644
index a4af127..0000000
--- a/example/example.ino
+++ /dev/null
@@ -1,88 +0,0 @@
-#define SERIAL_DELAY 3
-
-#define SERIAL_CLK 3
-#define SERIAL_INP 2
-#define LATCH_CLK 4
-
-void setup() {
- pinMode(SERIAL_CLK, OUTPUT);
- pinMode(SERIAL_INP, OUTPUT);
- pinMode(LATCH_CLK, OUTPUT);
- Serial.begin(9600);
-}
-
-void shift(unsigned char gert) {
- digitalWrite(LATCH_CLK, LOW);
- delay(SERIAL_DELAY);
- shiftOut(SERIAL_INP, SERIAL_CLK, LSBFIRST, gert);
- digitalWrite(LATCH_CLK, HIGH);
- delay(SERIAL_DELAY);
- Serial.println(gert, BIN);
-}
-
-void ani1() {
- for(int i = 0; i < 8; i++) {
- delay(200);
- shift(0b01010101 << (i % 2 == 0));
- }
-}
-
-void ani2() {
- for(int j = 0; j < 2; j++) {
- for(int i = 0; i < 8; i++) {
- delay(100);
- shift(1 << i);
- }
- for(int i = 6; i > 0; i--) {
- delay(100);
- shift(1 << i);
- }
- }
-}
-
-void ani3() {
- for(int j = 0; j < 2; j++) {
- for(int i = 1; i < 8; i++) {
- delay(100);
- shift(1 << i | 1 << (i-1));
- }
- for(int i = 6; i > 1; i--) {
- delay(100);
- shift(1 << i | 1 << (i-1));
- }
- }
-}
-
-void ani4() {
- for(int j = 0; j < 2; j++) {
- for(int i = 0; i < 8; i++) {
- delay(100);
- unsigned char state = 1 << i | 1 << (7 - i);
- shift(state);
- }
- for(int i = 6; i > 0; i--) {
- delay(100);
- unsigned char state = 1 << i | 1 << (7 - i);
- shift(state);
- }
- }
-}
-
-void loop() {
-
- /*digitalWrite(LATCH_CLK, HIGH);
- shift(0b00000000);
- digitalWrite(LATCH_CLK, LOW);
- delay(SERIAL_DELAY);
- delay(1e3);
-
- digitalWrite(LATCH_CLK, HIGH);
- shift(0b11111111);
- digitalWrite(LATCH_CLK, LOW);
- delay(SERIAL_DELAY);
- delay(1e3);*/
- ani1();
- ani2();
- ani3();
- ani4();
-}