Hello,
I've been experimenting recently on using the Esplora and Uno together, and I'm having a little trouble. I hooked up pin 14 on the Esplora to pin 3 on the Uno. I uploaded this code to the Esplora:
#include <Esplora.h>
int out = 14;
void setup() {
pinMode(out, OUTPUT);
}
void loop() {
Esplora.readButton(SWITCH_DOWN);
if (SWITCH_DOWN == LOW) {
digitalWrite(out, HIGH);
}
else {
digitalWrite(out, LOW);
}
}
And this code to the Uno:
int in = 3;
void setup() {
pinMode(in, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
digitalRead(in);
if (in == HIGH) {
digitalWrite(13, HIGH);
}
else {
digitalWrite(13, LOW);
}
What I expected to happen was when I pressed the bottom button on the Esplora, the tiny LED on the Uno (pin 13) would turn on. Could someone explain why this didn't happen and how I could fix it? Both codes are uploaded to the correct boards. The Esplora is powered via usb, and the Uno is powered by a 9V battery. Attached is a diagram.
