Sample program on mbed application board. Values of two potentiometers are printed on LCD display.

Dependencies:   C12832 mbed

Dependents:   Linear_Stage_Initial_Tests

Files at this revision

API Documentation at this revision

Comitter:
fchoco
Date:
Mon Dec 15 06:07:19 2014 +0000
Commit message:
Initial commit.

Changed in this revision

C12832.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Mon Dec 15 06:07:19 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/chris/code/C12832/#7de323fa46fe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 15 06:07:19 2014 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "C12832.h"
+
+AnalogIn pot1(p19);
+AnalogIn pot2(p20);
+
+C12832 lcd(p5, p7, p6, p8, p11);
+
+int main()
+{
+    int p1, p2;
+
+    lcd.set_auto_up(0);
+
+    while(true) {
+        p1 = pot1.read_u16();
+        p2 = pot2.read_u16();
+
+        lcd.locate(0, 0);
+        lcd.printf("Pot1 : %04X ", p1);
+        p1 = p1 * lcd.width() / 0xffff;
+        lcd.fillrect(0, 9, p1, 14, 1);
+        lcd.fillrect(p1 + 1, 9, lcd.width() - 1, 14, 0);
+        lcd.locate(0, 16);
+
+        lcd.printf("Pot2 : %04X ", p2);
+        p2 = p2 * lcd.width() / 0xffff;
+        lcd.fillrect(0, 25, p2, 30, 1);
+        lcd.fillrect(p2 + 1, 25, lcd.width(), 30, 0);
+
+        lcd.copy_to_lcd();
+
+        wait(0.1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 15 06:07:19 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file