Stanley Cohen
/
blink_kl46z_LCD
Use long-hand write on Digital I/O
Fork of blink_kl46z by
main.cpp
- Committer:
- scohennm
- Date:
- 2015-01-17
- Revision:
- 1:ada29f4aa40c
- Parent:
- 0:e23fffd4b9a7
File content as of revision 1:ada29f4aa40c:
#include "mbed.h" #include "SLCD.h" #define LEDON false #define LEDOFF true #define LCDCHARLEN 10 #define NUMMESS 2 #define ONEL " .1" #define TWOL "2." // slightly more interesting blinky 140814 sc SLCD slcd; //define LCD display float blinks[]={0.400, 0.700}; int ledState = LEDON; DigitalOut greenColor(LED_GREEN); DigitalOut redColor(LED_RED); int lcdCounter = 1; void LCDMess(char *lMess){ slcd.Home(); slcd.clear(); slcd.printf(lMess); } //-------------------------------- int main() { char rMess[NUMMESS][LCDCHARLEN]={ONEL, TWOL}; while(true) { lcdCounter++; lcdCounter = lcdCounter % NUMMESS; ledState = !ledState; // Flip the general state redColor.write(ledState); greenColor.write(!ledState);// flip state but don't store it. LCDMess(rMess[lcdCounter]); wait(blinks[ledState]); } }