Commits

Alexey Savanovich committed 4bf5248

SegmentsDisplay lib examples

Comments (0)

Files changed (11)

7segment/1common_cathode.gif

Added
New image

7segment/1digit/1common_cathode.gif

Removed
Old image

7segment/1digit/2common_anode.gif

Removed
Old image

7segment/1digit/one_digit.pde

-#include <SegmentsDisplay.h>
-
-const unsigned int A_PIN = 2;
-const unsigned int B_PIN = 3;
-const unsigned int C_PIN = 4;
-const unsigned int D_PIN = 5;
-const unsigned int E_PIN = 6;
-const unsigned int F_PIN = 7;
-const unsigned int G_PIN = 8;
-const unsigned int DP_PIN = 13;
-
-SegmentsDisplay display;
-
-
-void setup() {
-    display.setup(A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, F_PIN, G_PIN, DP_PIN);
-}
-
-void loop() {
-
-    for(int i=0; i < 10; i++)
-    {
-        display.show(i);
-        delay(1000);
-    }
-}
-

7segment/2common_anode.gif

Added
New image

7segment/4digit.jpg

Added
New image

7segment/4digit/4digit.jpg

Removed
Old image

7segment/4digit/four_digits.pde

-#include <SegmentsDisplay.h>
-
-const byte A_PIN = 2;
-const byte B_PIN = 3;
-const byte C_PIN = 4;
-const byte D_PIN = 5;
-const byte E_PIN = 6;
-const byte F_PIN = 7;
-const byte G_PIN = 8;
-const byte DP_PIN = 13;
-const byte Y1_PIN = 14;
-const byte Y2_PIN = 15;
-const byte Y3_PIN = 16;
-const byte Y4_PIN = 17;
-
-SegmentsDisplay display;
-
-
-const unsigned int BOUND_RATE = 9600;
-void setup() {
-    Serial.begin(BOUND_RATE);
-    display.setup(
-            A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, F_PIN, G_PIN,
-            DP_PIN,
-            Y1_PIN, Y2_PIN, Y3_PIN, Y4_PIN);
-}
-
-void loop() {
-    display.show(1);
-    display.show(23);
-    display.show(456);
-    display.show(7890);
-    display.show(7);
-    display.show(89);
-    /* display.show(012); */
-    display.show(3456);
-
-    /* for(int i=0; i < 1000; i++) { */
-    /*     display.show(i); */
-    /*     delay(1000); */
-    /*     /1* display.showPoint(); *1/ */
-    /* } */
-}
-

7segment/four_digits_countdown/four_digits.pde

+#include <SegmentsDisplay.h>
+
+const byte A_PIN = 2;
+const byte B_PIN = 3;
+const byte C_PIN = 4;
+const byte D_PIN = 5;
+const byte E_PIN = 6;
+const byte F_PIN = 7;
+const byte G_PIN = 8;
+const byte DP_PIN = 13;
+const byte Y1_PIN = 14;
+const byte Y2_PIN = 15;
+const byte Y3_PIN = 16;
+const byte Y4_PIN = 17;
+
+SegmentsDisplay display;
+
+
+const unsigned int BOUND_RATE = 9600;
+void setup() {
+    Serial.begin(BOUND_RATE);
+    display.setup(
+            A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, F_PIN, G_PIN,
+            DP_PIN,
+            Y1_PIN, Y2_PIN, Y3_PIN, Y4_PIN);
+}
+
+void loop() {
+    /* display.show(1); */
+    /* display.show(23); */
+    /* display.show(456); */
+    /* display.show(7890); */
+    /* display.show(7); */
+    /* display.show(89); */
+    /* display.show(012); */
+    /* display.show(3456); */
+
+    for(int i=0; i < 1000; i++) {
+        display.show(i);
+        /* display.showPoint(); */
+    }
+}
+

7segment/four_digits_float/four_digits_float.pde

+#include <SegmentsDisplay.h>
+
+const byte A_PIN = 2;
+const byte B_PIN = 3;
+const byte C_PIN = 4;
+const byte D_PIN = 5;
+const byte E_PIN = 6;
+const byte F_PIN = 7;
+const byte G_PIN = 8;
+const byte DP_PIN = 13;
+const byte Y1_PIN = 14;
+const byte Y2_PIN = 15;
+const byte Y3_PIN = 16;
+const byte Y4_PIN = 17;
+
+SegmentsDisplay display;
+
+
+void setup() {
+    display.setup(
+            A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, F_PIN, G_PIN,
+            DP_PIN,
+            Y1_PIN, Y2_PIN, Y3_PIN, Y4_PIN);
+}
+
+void loop() {
+    display.show(0.123);
+    display.show(4.567);
+    display.show(89.01);
+    display.show(234.5);
+    display.show(6789.1);
+
+    display.show(0.001);
+    display.show(6789.123);
+    display.show(678912.3); // too big
+}
+

7segment/one_digit/one_digit.pde

+#include <SegmentsDisplay.h>
+
+const unsigned int A_PIN = 2;
+const unsigned int B_PIN = 3;
+const unsigned int C_PIN = 4;
+const unsigned int D_PIN = 5;
+const unsigned int E_PIN = 6;
+const unsigned int F_PIN = 7;
+const unsigned int G_PIN = 8;
+const unsigned int DP_PIN = 13;
+
+SegmentsDisplay display;
+
+
+void setup() {
+    display.setup(A_PIN, B_PIN, C_PIN, D_PIN, E_PIN, F_PIN, G_PIN, DP_PIN);
+}
+
+void loop() {
+
+    for(int i=0; i < 10; i++)
+    {
+        display.show(i);
+        delay(1000);
+    }
+}
+