mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-10 21:24:12 +01:00
Merge pull request #1907 from egueli/master
Esplora: added reading from Tinkerkit inputs
This commit is contained in:
commit
4a10c1c5a8
@ -40,6 +40,8 @@ const byte CH_SLIDER = 4;
|
|||||||
const byte CH_LIGHT = 5;
|
const byte CH_LIGHT = 5;
|
||||||
const byte CH_TEMPERATURE = 6;
|
const byte CH_TEMPERATURE = 6;
|
||||||
const byte CH_MIC = 7;
|
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_SW = 10;
|
||||||
const byte CH_JOYSTICK_X = 11;
|
const byte CH_JOYSTICK_X = 11;
|
||||||
const byte CH_JOYSTICK_Y = 12;
|
const byte CH_JOYSTICK_Y = 12;
|
||||||
@ -156,6 +158,16 @@ public:
|
|||||||
void tone(unsigned int freq);
|
void tone(unsigned int freq);
|
||||||
void tone(unsigned int freq, unsigned long duration);
|
void tone(unsigned int freq, unsigned long duration);
|
||||||
void noTone();
|
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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@ writeBlue KEYWORD2
|
|||||||
readRed KEYWORD2
|
readRed KEYWORD2
|
||||||
readGreen KEYWORD2
|
readGreen KEYWORD2
|
||||||
readBlue KEYWORD2
|
readBlue KEYWORD2
|
||||||
|
readTinkerkitInput KEYWORD2
|
||||||
|
readTinkerkitInputA KEYWORD2
|
||||||
|
readTinkerkitInputB KEYWORD2
|
||||||
tone KEYWORD2
|
tone KEYWORD2
|
||||||
noTone KEYWORD2
|
noTone KEYWORD2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user