Line | |
---|
1 | /*
|
---|
2 | Keyboard Test
|
---|
3 |
|
---|
4 | Check how the robot's keyboard works. This example
|
---|
5 | sends the data about the key pressed through the
|
---|
6 | serial port.
|
---|
7 |
|
---|
8 | All the buttons on the Control Board are tied up to a
|
---|
9 | single analog input pin, in this way it is possible to multiplex a
|
---|
10 | whole series of buttons on one single pin.
|
---|
11 |
|
---|
12 | It is possible to recalibrate the thresholds of the buttons using
|
---|
13 | the Robot.keyboardCalibrate() function, that takes a 5 ints long
|
---|
14 | array as parameter
|
---|
15 |
|
---|
16 | Circuit:
|
---|
17 | * Arduino Robot
|
---|
18 |
|
---|
19 | created 1 May 2013
|
---|
20 | by X. Yang
|
---|
21 | modified 12 May 2013
|
---|
22 | by D. Cuartielles
|
---|
23 |
|
---|
24 | This example is in the public domain
|
---|
25 | */
|
---|
26 |
|
---|
27 | #include <ArduinoRobot.h>
|
---|
28 | #include <Wire.h>
|
---|
29 | #include <SPI.h>
|
---|
30 |
|
---|
31 | void setup() {
|
---|
32 | // initialize the serial port
|
---|
33 | Serial.begin(9600);
|
---|
34 | }
|
---|
35 |
|
---|
36 | void loop() {
|
---|
37 | // print out the keyboard readings
|
---|
38 | Serial.println(Robot.keyboardRead());
|
---|
39 | delay(100);
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.