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.
main.cpp
- Committer:
- piroro4560
- Date:
- 2020-12-12
- Revision:
- 2:b21ca9158784
- Parent:
- 1:0f68a8a42a12
File content as of revision 2:b21ca9158784:
#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, i=5;
// char unchi[] = "unchi";
char buf[10] = {};
sprintf(buf,"%d", i);
const char *u = buf;
while(1) {
switch(mode) {
case 0: // init
aqm.cmd(0x01);
thread_sleep_for(50);
mode++;
// wait(1);
thread_sleep_for(1000.0);
break;
case 1: // SWITCH
aqm.setCursor(0, 0);
aqm.printStr("I");
mode++;
thread_sleep_for(1000);
break;
case 2: // SCI
aqm.setCursor(2, 0);
aqm.printStr("LIKE");
mode++;
thread_sleep_for(1000);
break;
case 3:
aqm.setCursor(3, 1);
aqm.printStr(1234);
FADEcounter = 0;
mode++;
thread_sleep_for(1000);
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);
thread_sleep_for(50);
}
}