Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:717702d0d65e
- Child:
- 1:0f68a8a42a12
diff -r 000000000000 -r 717702d0d65e main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Jan 19 09:24:06 2020 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "aqm0802.h"
+
+aqm0802 aqm(PB_9, PB_8);
+
+int main() {
+ uint8_t mode, contrast=0, contrastFlag=false;
+ int CGcounter, FADEcounter, a=1;
+
+ while(1) {
+ switch(mode) {
+ case 0: // init
+ aqm.cmd(0x01);
+ wait_ms(50);
+ mode++;
+ wait(1);
+ break;
+ case 1: // SWITCH
+ aqm.setCursor(0, 0);
+ aqm.printStr("SWITCH");
+ mode++;
+ wait(1);
+ break;
+ case 2: // SCI
+ aqm.setCursor(1, 1);
+ aqm.printStr("SCI");
+ mode++;
+ wait(1);
+ break;
+ case 3:
+ aqm.setCursor(4, 1);
+ aqm.printStr("ENCE");
+ FADEcounter = 0;
+ mode++;
+ wait(1);
+ mode=0;
+ break;
+ /*
+ case 4:
+ if (contrastFlag == false) {
+ if (++contrast >= 54) contrastFlag = true;
+ } else {
+ if (--contrast <= 17) {
+ contrastFlag = false;
+ if(++FADEcounter >= 2) {
+ mode = 0;
+ }
+ }
+ }
+ aqm.setContrast(contrast);
+ break;
+ */
+ }
+ wait(0.05);
+ }
+}