Touch Sensor
The sensor contains two touch parts (left and right) and can detect changes in capacitance when a finger approaches. This means the touch sensor will output a high level whether your finger touches lightly or presses hard. You can realize the function you want by judging the detected value (1 for high level, 0 for low level).

Connecting to the NyBoard with wire as shown in the following picture, connect to the NyBoard Grove interface which include D6, D7:

For specific use, the end connected to the sensor can be fixed on the robot's head (included in Bittle's mouth, or attached to the top of Nybble's head), of course, you can also use your creativity according to your needs.
The code using this sensor has been integrated into the OpenCat project. Uncomment the line
#define DOUBLE_TOUCH
in the OpenCat.ino, as shown in the figure below, and then use the Arduino IDE to upload the sketch to the robot main board, which can reproduce the example function of integrating the robot action.
If you want to test the function of a touch sensor alone or want to learn more about its principle. You can use the Arduino IDE to upload the demo sketch(doubleTouch.ino), as shown below:

This demo sketch implements real-time printing of the detection values of D6 and D7 pins in the serial monitor:

doubleTouch.zip
573B
Binary
If you want to use the sensor with the Mind+ program:
- 1.You must upload the OpenCat.ino as follows, uncomment the line
#define GROVE_SERIAL_PASS_THROUGH
in the OpenCat.ino: - 2.Follow the instruction to import the Petoi Coding Blocks in the app Mind+, and load the Mind+ code file.
- 3.
- 4.Power on the robot and click the Run buttonin Mind+.
DoubleTouch.mp
280KB
Binary
Last modified 3mo ago