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-01-26
- Revision:
- 1:0f68a8a42a12
- Parent:
- 0:717702d0d65e
- Child:
- 2:b21ca9158784
File content as of revision 1:0f68a8a42a12:
#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);
wait_ms(50);
mode++;
wait(1);
break;
case 1: // SWITCH
aqm.setCursor(0, 0);
aqm.printStr("I");
mode++;
wait(1);
break;
case 2: // SCI
aqm.setCursor(2, 0);
aqm.printStr("LOVE");
mode++;
wait(1);
break;
case 3:
aqm.setCursor(3, 1);
aqm.printStr(1234);
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);
}
}