Skip to content

Commit 8642df7

Browse files
committed
Esplora: added reading form Tinkerkit inputs
1 parent 3baa0ce commit 8642df7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

libraries/Esplora/Esplora.h

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const byte CH_SLIDER = 4;
4040
const byte CH_LIGHT = 5;
4141
const byte CH_TEMPERATURE = 6;
4242
const byte CH_MIC = 7;
43+
const byte CH_TINKERKIT_A = 8;
44+
const byte CH_TINKERKIT_B = 9;
4345
const byte CH_JOYSTICK_SW = 10;
4446
const byte CH_JOYSTICK_X = 11;
4547
const byte CH_JOYSTICK_Y = 12;
@@ -156,6 +158,16 @@ class _Esplora {
156158
void tone(unsigned int freq);
157159
void tone(unsigned int freq, unsigned long duration);
158160
void noTone();
161+
162+
inline unsigned int readTinkerkitInput(byte whichInput) {
163+
return readChannel(whichInput + CH_TINKERKIT_A);
164+
}
165+
inline unsigned int readTinkerkitInputA() {
166+
return readChannel(CH_TINKERKIT_A);
167+
}
168+
inline unsigned int readTinkerkitInputB() {
169+
return readChannel(CH_TINKERKIT_B);
170+
}
159171
};
160172

161173

libraries/Esplora/keywords.txt

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ writeBlue KEYWORD2
2828
readRed KEYWORD2
2929
readGreen KEYWORD2
3030
readBlue KEYWORD2
31+
readTinkerkitInput KEYWORD2
32+
readTinkerkitInputA KEYWORD2
33+
readTinkerkitInputB KEYWORD2
3134
tone KEYWORD2
3235
noTone KEYWORD2
3336

0 commit comments

Comments
 (0)