![](/media/cache/profiles/30ba105754346aaf47509089d2287f2a.50x50_q85.png)
LCD Serial with shift register
main.cpp@0:238a568fd867, 2011-02-05 (annotated)
- Committer:
- Suky
- Date:
- Sat Feb 05 19:58:24 2011 +0000
- Revision:
- 0:238a568fd867
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Suky | 0:238a568fd867 | 1 | #include "mbed.h" |
Suky | 0:238a568fd867 | 2 | #include "LCD_Serial.h" |
Suky | 0:238a568fd867 | 3 | |
Suky | 0:238a568fd867 | 4 | DigitalOut myled(LED1); |
Suky | 0:238a568fd867 | 5 | LCDSerial myLcd(p13,p14,p15,p16); // Data, Clock, Enable, Back |
Suky | 0:238a568fd867 | 6 | |
Suky | 0:238a568fd867 | 7 | |
Suky | 0:238a568fd867 | 8 | |
Suky | 0:238a568fd867 | 9 | int main() { |
Suky | 0:238a568fd867 | 10 | char k=0; |
Suky | 0:238a568fd867 | 11 | |
Suky | 0:238a568fd867 | 12 | myLcd.printf("\fHello mbed! Library\nLCD serial with\nshift register\nby Suky..."); |
Suky | 0:238a568fd867 | 13 | myLcd.vSetBacklight(1); |
Suky | 0:238a568fd867 | 14 | while(1) { |
Suky | 0:238a568fd867 | 15 | myLcd.vGotoxy(20,4); |
Suky | 0:238a568fd867 | 16 | myLcd.vPutc(k); |
Suky | 0:238a568fd867 | 17 | if(++k==8){k=0;} |
Suky | 0:238a568fd867 | 18 | myled = 1; |
Suky | 0:238a568fd867 | 19 | wait(0.2); |
Suky | 0:238a568fd867 | 20 | myled = 0; |
Suky | 0:238a568fd867 | 21 | wait(0.2); |
Suky | 0:238a568fd867 | 22 | } |
Suky | 0:238a568fd867 | 23 | } |