Hi, I'd like to implement some buttons from DFRobot to my Retrocade Synth. I naively believed that I could just connect the 3 wires to the analog input but maybe that's not that simple. And I don't know which pin number I have to listen... so I've tried every possible pin number but I always get "key = 0" even if I press a button. Could someone help me ? Please see my code and the wiring below.
#include "SPIADC.h"
#include "SPI.h"
int pin = 32;
int key_in = -1;
int last_key = -1;
void setup()
{
Serial.begin(115200);
Serial.println("BEGINNING");
}
void loop()
{
key_in = analog.read(pin);
if (key_in != last_key) {
Serial.print("key = ");
Serial.println(key_in);
last_key = key_in;
}
}