Hardware Reference
In-Depth Information
tone in milliseconds, also expressed as an unsigned int . If omitted, the tone
continues until interrupted, either by calling the tone() function with new
parameters or by calling the noTone() function.
Esplora.noTone();
This function immediately stops the output of a tone() function.
The tone() and noTone() functions are part of the Arduino language, but
these two variants are modii ed to be used on the Esplora. As such, it is not nec-
essary to specify the pin; the actions are immediately applied to the correct pin.
NOTE The buzzer is controlled by high-speed PWM, as is the red component of the
RGB LED. Using the buzzer may interfere with the red light.
TinkerKit
The Arduino Esplora comes with four TinkerKit connectors; two are inputs
and two are outputs.
To read the TinkerKit inputs, use readTinkerkitInputA() and
readTinkerkitInputB() .
resultA = Esplora.readTinkerkitInputA();
resultB = Esplora.readTinkerkitInputB();
These two functions do not take any parameters and return an int , the
value detected on the TinkerKit input. Values range from 0 (0 V) to 1,023
(5 V). There is another way to read TinkerKit inputs, using a single function:
readTinkerkitInput() .
result = Esplora.readTinkerkitInput(whichInput);
This function takes a parameter, whichInput . This parameter is a Boolean :
if it is false (or 0 ), then the value of TinkerKit input A is returned. If it is true
(or 1 ), then the value of TinkerKit input B is returned.
The Esplora also has two TinkerKit outputs, but currently, there are no Esplora
specii c functions allowing easy output. However, they are digital outputs just
like on any Arduino, so it is still easy to write to their outputs—the trick is to
know which output goes where.
There are two outputs: OUT-A and OUT-B. Just below the connector, next to
the output identii er, is another piece of information: D3 for Output A and D11
for Output B. These are the reference to the digital outputs, and using digi-
talWrite() , you can output digital data. These two pins are also capable of
PWM, so you can also use analogWrite() .
 
Search WWH ::




Custom Search