![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
KEIS
main.cpp@0:1a9fcc66524d, 2013-10-01 (annotated)
- Committer:
- khayakawa
- Date:
- Tue Oct 01 00:13:24 2013 +0000
- Revision:
- 0:1a9fcc66524d
KEIS
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
khayakawa | 0:1a9fcc66524d | 1 | #include "mbed.h" |
khayakawa | 0:1a9fcc66524d | 2 | #include "C12832_lcd.h" |
khayakawa | 0:1a9fcc66524d | 3 | |
khayakawa | 0:1a9fcc66524d | 4 | Serial pc(USBTX, USBRX); // tx, rx |
khayakawa | 0:1a9fcc66524d | 5 | Serial device(p9, p10); // tx, rx |
khayakawa | 0:1a9fcc66524d | 6 | C12832_LCD lcd; |
khayakawa | 0:1a9fcc66524d | 7 | DigitalOut myled(LED1); |
khayakawa | 0:1a9fcc66524d | 8 | |
khayakawa | 0:1a9fcc66524d | 9 | int main() { |
khayakawa | 0:1a9fcc66524d | 10 | |
khayakawa | 0:1a9fcc66524d | 11 | char* ch[16]={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; |
khayakawa | 0:1a9fcc66524d | 12 | char v_val[2]; |
khayakawa | 0:1a9fcc66524d | 13 | char val; |
khayakawa | 0:1a9fcc66524d | 14 | int tmp1,tmp2; |
khayakawa | 0:1a9fcc66524d | 15 | |
khayakawa | 0:1a9fcc66524d | 16 | int sd_data_on[20]={0x7E,0x00,0x10,0x17,0x01,0x00,0x13,0xA2,0x00,0x40,0x92,0xFF,0x77,0xFF,0xFE,0x02,0x44,0x32,0x05,0x70}; |
khayakawa | 0:1a9fcc66524d | 17 | int sd_data_off[20]={0x7E,0x00,0x10,0x17,0x01,0x00,0x13,0xA2,0x00,0x40,0x92,0xFF,0x77,0xFF,0xFE,0x02,0x44,0x32,0x04,0x71}; |
khayakawa | 0:1a9fcc66524d | 18 | |
khayakawa | 0:1a9fcc66524d | 19 | lcd.cls(); |
khayakawa | 0:1a9fcc66524d | 20 | lcd.locate(0,0); |
khayakawa | 0:1a9fcc66524d | 21 | |
khayakawa | 0:1a9fcc66524d | 22 | while(1){ |
khayakawa | 0:1a9fcc66524d | 23 | myled=1; |
khayakawa | 0:1a9fcc66524d | 24 | val=device.getc(); |
khayakawa | 0:1a9fcc66524d | 25 | |
khayakawa | 0:1a9fcc66524d | 26 | tmp1 = val/16; |
khayakawa | 0:1a9fcc66524d | 27 | tmp2 = val%16; |
khayakawa | 0:1a9fcc66524d | 28 | pc.printf("%s%s",ch[tmp1],ch[tmp2]); |
khayakawa | 0:1a9fcc66524d | 29 | myled=0; |
khayakawa | 0:1a9fcc66524d | 30 | } |
khayakawa | 0:1a9fcc66524d | 31 | } |