test
Dependencies: MINI8I8O5A000 mbed EEPROM_P4 IICLCD_LOWCOST
Diff: main.cpp
- Revision:
- 8:055a85e600dd
- Parent:
- 7:3cb877cb7393
- Child:
- 9:dfb7951e8532
--- a/main.cpp Mon Oct 10 10:42:45 2016 +0000 +++ b/main.cpp Tue Oct 11 02:46:12 2016 +0000 @@ -160,25 +160,45 @@ if(CAMBUSY==0) break; if (i++>IDELBUSYLOOP) { - CAMERROR=1; - break; + CAMERROR=1; + break; } } } else if (rx_buffer[0]=='j') { - wait(0.1); + // wait(0.1); } else if (rx_buffer[0]=='r') { - wait(0.1); - + //wait(0.1); } else if (rx_buffer[0]=='p') { - wait(0.1); + //wait(0.1); + #define PRGLINE0 OUT4 + #define PRGLINE1 OUT5 + #define PRGLINE2 OUT6 + #define PRGLINE3 OUT7 + #define PRG_ON 0 + #define PRG_OFF 1 + + switch( rx_buffer[1]) + { + case '0': PRGLINE3=PRG_OFF;PRGLINE2=PRG_OFF; PRGLINE1=PRG_OFF; PRGLINE0=PRG_OFF; break; + case '1': PRGLINE3=PRG_OFF;PRGLINE2=PRG_OFF; PRGLINE1=PRG_OFF; PRGLINE0=PRG_ON ; break; + case '2': PRGLINE3=PRG_OFF;PRGLINE2=PRG_OFF; PRGLINE1=PRG_ON ; PRGLINE0=PRG_OFF; break; + case '3': PRGLINE3=PRG_OFF;PRGLINE2=PRG_OFF; PRGLINE1=PRG_ON ; PRGLINE0=PRG_ON ; break; + case '4': PRGLINE3=PRG_OFF;PRGLINE2=PRG_ON ; PRGLINE1=PRG_OFF; PRGLINE0=PRG_OFF; break; + case '5': PRGLINE3=PRG_OFF;PRGLINE2=PRG_ON ; PRGLINE1=PRG_OFF; PRGLINE0=PRG_ON; break; + case '6': PRGLINE3=PRG_OFF;PRGLINE2=PRG_ON ; PRGLINE1=PRG_OFF; PRGLINE0=PRG_ON ; break; + case '7': PRGLINE3=PRG_OFF;PRGLINE2=PRG_ON ; PRGLINE1=PRG_ON ; PRGLINE0=PRG_ON ; break; + case '8': PRGLINE3=PRG_ON ;PRGLINE2=PRG_OFF; PRGLINE1=PRG_OFF; PRGLINE0=PRG_OFF; break; + case '9': PRGLINE3=PRG_ON ;PRGLINE2=PRG_OFF; PRGLINE1=PRG_OFF; PRGLINE0=PRG_ON ; break; + default: PRGLINE3=PRG_OFF;PRGLINE2=PRG_OFF; PRGLINE1=PRG_OFF; PRGLINE0=PRG_OFF; break; + } } BUZZER=0;