fuck meaningful commit messages
[bort-panel.git] / seg.c
diff --git a/seg.c b/seg.c
index 462b03f73667b9bc032501e5e0cdf87b112c6082..6f7b25f015dce1b290bdf34639dbc650cf36bb83 100644 (file)
--- a/seg.c
+++ b/seg.c
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <time.h>
 
 #include <sys/types.h>
 
 int main(int argc, char *argv[]) {
 
+       uint8_t ent[4];
+
        signal(SIGINT, inth);
+       signal(SIGALRM, SIG_DFL);
        
        config_pins();
        pincnt();
 
+//     start();
+//     byte(0x8f);
+//     stop();
+
        start();
        byte(0x40);
        stop();
        start();
-       byte(0xc0 | 0x01);
-
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
-       byte(0xdd);
+       byte(0xc0 | 0x03);
+       byte(0xff);
+       byte(0xff);
+       byte(0xff);
+       byte(0xff);
+       byte(0xff);
+       byte(0xff);
+/*for(;;) {
+       arc4random_buf(ent, 32);
+       byte(ent[0]);
+       byte(ent[1]);
+       byte(ent[2]);
+       byte(ent[3]);
+       usleep(DEL);
+}*/
 
-       stop();
+/*for(;;) {
+       UP("clk");
+       usleep(1);
+       DOWN("clk");
+       usleep(1);
+}*/
+
+for(;;) {
+       byte(dig(0x0c));
+       byte(dig(0x0a));
+       byte(dig(0x0f));
+       byte(dig(0x0e));
+       byte(0x00);
+       byte(0x00);
+       usleep(1000 * 350);
+       byte(dig(0x0b));
+       byte(dig(0x0a));
+       byte(dig(0x0b));
+       byte(dig(0x0e));
+       byte(0x00);
+       byte(0x00);
+       usleep(1000*350);
+}
+/*     uint8_t inc = 0;
+       uint8_t c = 0;
+       for(;;) {
+               if (c == 4) { byte(0x00); byte(0x00); c = 0; continue;}
+               byte(dig(inc));
+               if (inc == 0xf) { inc = 0; usleep(1000 * 2000); c++; continue; }
+               inc++;
+               usleep(1000 * 700);
+               c++;
+       } */
+/*     stop();
 
        start();
        byte(DISP_ON);
-       stop();
+       stop();*/
+
 
        inth(0);
        return 0;