1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #define BOARD Versa1
- #include <fruit.h>
- #include <analog.h>
- t_delay mainDelay;
- void setup(void) {
- fruitInit();
-
- pinModeDigitalOut(LED);
- digitalClear(LED);
- delayStart(mainDelay, 5000);
- analogInit();
- analogInitTouch();
-
- analogSelect(0,K1);
- analogSelect(1,K2);
- analogSelect(2,K3);
- analogSelectTouch(3,K5);
- }
- void loop() {
- fraiseService();
- analogService();
- if(delayFinished(mainDelay))
- {
- delayStart(mainDelay, 5000);
- analogSend();
- }
- }
- 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');
- }
- }
|