123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #define BOARD Versa1
- #include <fruit.h>
- #include <switch.h>
- t_delay mainDelay;
- void setup(void) {
- fruitInit();
-
- pinModeDigitalOut(LED);
- digitalClear(LED);
- delayStart(mainDelay, 5000);
- switchInit();
- switchSelect(0,K1);
- switchSelect(1,K2);
- switchSelect(2,K3);
- switchSelect(3,K4);
- }
- void loop() {
- fraiseService();
- switchService();
- if(delayFinished(mainDelay))
- {
- delayStart(mainDelay, 5000);
- switchSend();
- }
- }
- void fraiseReceiveChar()
- {
- unsigned char c;
-
- c=fraiseGetChar();
- if(c=='L'){
- c=fraiseGetChar();
- digitalWrite(LED, c!='0');
- }
- else if(c=='E') {
- printf("C");
- c = fraiseGetLen();
- while(c--) printf("%c",fraiseGetChar());
- putchar('\n');
- }
- }
|