Hi, I'm trying to us an MPR121 Arduino shield like a button to where if you push it sends power to a servo motor. I want the servo motor to go back and forth (Sweep Preset). I've tried using "if" and "then" statements. It's not working, the shield is reading my fingers and showing the output on the serial monitor, but it's not moving the servo motor. Thanks for your help! Here's my code:
if (!cap.begin(0x5A)) {
Serial.println("MPR121 not found, check wiring?");
while (1);
}
Serial.println("MPR121 found!");
}
void loop() {
currtouched = cap.touched();
for (uint8_t i=0; i<12; i++) {
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
Serial.print(i); Serial.println(" touched");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000);
}