Commit 2173a6d372600b0e85df1d0ffe01a3113a9e268e
1 parent
d57f2358
init gestion des touches read memory et delete memory
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
keygrbb.ino
@@ -77,16 +77,31 @@ void setup() { | @@ -77,16 +77,31 @@ void setup() { | ||
77 | void loop() { | 77 | void loop() { |
78 | // Get the currently touched pads | 78 | // Get the currently touched pads |
79 | currtouched = cap.touched(); | 79 | currtouched = cap.touched(); |
80 | + /* | ||
81 | + //effacement de la mémoire | ||
82 | + if ((currtouched & _BV(/*D*/)) && !(lasttouched & _BV(/*D*/)) ) { | ||
83 | + //effacer ce qui est présent dans la carte SD | ||
84 | + } | ||
85 | + //récupération des entrées | ||
86 | + if ((currtouched & _BV(/*R*/)) && !(lasttouched & _BV(/*R*/)) ) { | ||
87 | + //gérer la lecture du fichier contenant les entrées | ||
88 | + //récupération des entrées | ||
89 | + //Keyboard.write(entrée) | ||
90 | + } | ||
91 | + */ | ||
80 | 92 | ||
81 | for (uint8_t i=0; i<12; i++) { | 93 | for (uint8_t i=0; i<12; i++) { |
82 | // it if *is* touched and *wasnt* touched before, alert! | 94 | // it if *is* touched and *wasnt* touched before, alert! |
83 | if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) { | 95 | if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) { |
84 | Serial.print(tab[i]); Serial.println(" touched"); | 96 | Serial.print(tab[i]); Serial.println(" touched"); |
97 | + Keyboard.press('0'+tab[i]); | ||
85 | } | 98 | } |
86 | // if it *was* touched and now *isnt*, alert! | 99 | // if it *was* touched and now *isnt*, alert! |
87 | if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) { | 100 | if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) { |
88 | Serial.print(tab[i]); Serial.println(" released"); | 101 | Serial.print(tab[i]); Serial.println(" released"); |
102 | + Keyboard.release('0'+tab[i]); | ||
89 | } | 103 | } |
104 | + if(i==1 || i==5)i++; | ||
90 | } | 105 | } |
91 | 106 | ||
92 | // reset our state | 107 | // reset our state |
@@ -110,4 +125,4 @@ void loop() { | @@ -110,4 +125,4 @@ void loop() { | ||
110 | 125 | ||
111 | // put a delay so it isn't overwhelming | 126 | // put a delay so it isn't overwhelming |
112 | delay(100); | 127 | delay(100); |
113 | -} | 128 | -} |
129 | +} | ||
114 | \ No newline at end of file | 130 | \ No newline at end of file |