Skip to content

Esplora: added reading from Tinkerkit inputs #1907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions libraries/Esplora/Esplora.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const byte CH_SLIDER = 4;
const byte CH_LIGHT = 5;
const byte CH_TEMPERATURE = 6;
const byte CH_MIC = 7;
const byte CH_TINKERKIT_A = 8;
const byte CH_TINKERKIT_B = 9;
const byte CH_JOYSTICK_SW = 10;
const byte CH_JOYSTICK_X = 11;
const byte CH_JOYSTICK_Y = 12;
Expand Down Expand Up @@ -156,6 +158,16 @@ class _Esplora {
void tone(unsigned int freq);
void tone(unsigned int freq, unsigned long duration);
void noTone();

inline unsigned int readTinkerkitInput(byte whichInput) {
return readChannel(whichInput + CH_TINKERKIT_A);
}
inline unsigned int readTinkerkitInputA() {
return readChannel(CH_TINKERKIT_A);
}
inline unsigned int readTinkerkitInputB() {
return readChannel(CH_TINKERKIT_B);
}
};


Expand Down
3 changes: 3 additions & 0 deletions libraries/Esplora/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ writeBlue KEYWORD2
readRed KEYWORD2
readGreen KEYWORD2
readBlue KEYWORD2
readTinkerkitInput KEYWORD2
readTinkerkitInputA KEYWORD2
readTinkerkitInputB KEYWORD2
tone KEYWORD2
noTone KEYWORD2

Expand Down