Description
16-Key Capacitive Touch Unit (MEGA328P) is inspired by an Invention kit called Makey Makey which brings the concept that users can connect everyday objects to computer programs. Using a circuit board, alligator clips, and a USB cable, the circult uses closed loop electrical signals to send the microprocessor either a keyboard stroke or mouse click signal. We've tried connect a bounch of fruits, one for each key,to this Unit. When you touch the apple, you make a connection, and MaKey sends the processor a keyboard message. The buzzer inside or speaker on M5core will exhibit the key value, so instead of using a keyboard, you can make a fruit piano.
This Unit communicates with the M5Core via the GROVE A I2C(0x51).
Product Features
- Arduino Mega328p Controller
- Buzzer inside
- Up to 16 keys
- Software Development Platform: Arduino, UIFlow(Blockly,Python)
- Two Lego-compatible holes
Kit includes
- 1x 16-Key Capacitive Touch Unit (MEGA328P)
- 1x GROVE Cable
Application
- Fruit piano
Documents
Learn
Example
1. Arduino IDE
The code below is incomplete. To get complete code, please click here.
#include <M5Stack.h>
#include <Wire.h>
// initialization
M5.begin();
pinMode(21, INPUT); pinMode(22, INPUT);
Wire.begin();// Init I2C
// read data
Wire.requestFrom(MAKEY_ADDR, 2);
while (Wire.available()) {
Key1 = Wire.read();//read data from MAKEY
Key2 = Wire.read();//read data from MAKEY
tone_key = (Key2<<8) | Key1;// the following picture will explain "tone_key"
}
2. UIFlow
TO get complete code, please click here.
More information
Instructions
1)Use the buzzer on the unit to exhibit sounds:
Take a Dupont wire(male to male), one end plug into GND, hold the other end to your hand. Take another Dupont wire(male to male), one end plug into different key holes, the other end hold by the other hand. Make it a close circult. Plug into different key tones the buzzer will emit the corresponding tones.
2)Use the speaker on the M5core to exhibit sounds: Connct MAKEY with M5Core via Grove A Download this example.
Repeat the same operation as above. you will see this sound much better.
Schematic
PinMap
M5Core(GROVE A) | GPIO22 | GPIO21 | 5V | GND |
MAKEY Unit | SCL | SDA | 5V | GND |