Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« on: February 02, 2013, 02:15:40 pm » |
Recently I purchased a set of capacitive sensors for my project, received them today and ran their sample code provided, but am not getting any output at the 'serial window' when the sensors are been toggled by my fingers. Sensors and program are in the following link and please advice if anything is wrong with the code or possible reason that could have caused no output from breakout board (MPR121) to Arduino Uno. http://www.dfrobot.com/wiki/index.php?title=Capacitive_Touch_Kit_For_Arduino(SKU:DFR0129)
|
|
|
|
« Last Edit: February 02, 2013, 02:29:33 pm by xaviergoh »
|
Logged
|
|
|
|
|
Miami/Florida
Offline
Full Member
Karma: 1
Posts: 149
|
 |
« Reply #1 on: February 02, 2013, 02:41:25 pm » |
Broken link for me. Can't access.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #2 on: February 02, 2013, 02:45:09 pm » |
|
|
|
|
« Last Edit: February 02, 2013, 02:47:26 pm by HazardsMind »
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #3 on: February 03, 2013, 07:23:55 am » |
Hi HazardsMind,
Thanks for replying to my post, I tried the code that they suggest at the webpage for the keypad.
/* TouchWheel.pde MPR121 WhellPad Example Code by:Waiman Zhao Mail:Binpower@foxmail.com created on: 11/2/14 license: CC-SA 3.0 Hardware: 3.3V Arduino Pro Mini SDA -> A4 SCL -> A5 IRQ -> D2 */ #include <Wire.h> #include <mpr121.h> int key = 0; // ========= setup ========= void setup() { // initialize function Serial.begin(19200); Wire.begin(); CapaTouch.begin(); delay(500); Serial.println("START"); } // ========= loop ========= void loop() { key=CapaTouch.keyPad(); if (key==11) { Serial.print("key:"); Serial.println("*"); } else if(key==12) { Serial.print("key:"); Serial.println("#"); } else if(key>0){ Serial.print("key:"); Serial.println(key); } delay(200); }
It doesnt have any output at the serial window after I added the library and flashed the Uno. I am a novice in Arduino, I am not sure whether do I need any additional code for it to have an output at the serial window. Please advice
|
|
|
|
|
Logged
|
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5929
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #4 on: February 03, 2013, 10:44:21 am » |
Does the serial output show the word START?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #5 on: February 03, 2013, 11:22:00 am » |
Did you by any chance set the baud rate in the actual serial monitor screen? In the bottom right corner, the default is 9600.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #6 on: February 03, 2013, 01:16:40 pm » |
http://postimage.org/image/6bygyc3zz/ <-- my output. only one logo after initialised, and nothing i do will add anything else to the output. Anything I need to do other than the codes above? basically I connected the boards up as shown in the seller's page and uses their code to flash. Not sure whether i missed out anything. Greatly appreciate the help given.
|
|
|
|
« Last Edit: February 03, 2013, 01:20:03 pm by xaviergoh »
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #7 on: February 03, 2013, 01:20:08 pm » |
Your baud rate in the serial monitor says 300 baud, that is wrong! It should be 19200, not 300.
|
|
|
|
« Last Edit: February 03, 2013, 01:56:59 pm by HazardsMind »
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Central MN, USA
Offline
Faraday Member
Karma: 35
Posts: 5929
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
|
 |
« Reply #8 on: February 03, 2013, 02:43:48 pm » |
Anything I need to do other than the codes above? basically I connected the boards up as shown in the seller's page and uses their code to flash. Not sure whether i missed out anything.
Greatly appreciate the help given.
Follow HazardsMind's reply and set correct baud rate.
|
|
|
|
|
Logged
|
|
|
|
|
Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #9 on: February 04, 2013, 11:27:24 am » |
Hi guys, I tried different baud rate, it shows "START", but still doesnt get any output from the sensors. 
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #10 on: February 04, 2013, 12:25:13 pm » |
Ok, great, you got START. Now do a serial print of just "key" and see what values you get for each number pressed.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #11 on: February 04, 2013, 12:41:01 pm » |
Hi, Thanks for suggestion. I tried the following, not sure if it's what u meant. None of the keys give an output to the serial window still.
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #12 on: February 04, 2013, 01:01:53 pm » |
It should be outputting atleast "key" try just Serial.println(key); right after key=CapaTouch.keyPad();
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Singapore
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #13 on: February 04, 2013, 01:28:50 pm » |
with Serial.println(key), I get endless "-1".... with Serial.println("key"), I get endless "key"... 
|
|
|
|
« Last Edit: February 04, 2013, 01:31:08 pm by xaviergoh »
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 29
Posts: 1571
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #14 on: February 04, 2013, 01:31:57 pm » |
Ok then check your wiring. Your getting something now, but its not what you want, so check your wiring for errors.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
|