I can't figure out why I am unable to read the state of a particular input pin.
I'm running a Sound FX board with an Arduino Nano.
The Sound FX has an "Activity" pin that goes low when it's playing a sound.
Otherwise, the pin is high.
I have confirmed this operation with an oscilloscope.
I have tied the Activity pin to the Nano D7
#define Activity 7
pinMode(Activity, INPUT);
But when I play the track, the Nano does not seem to see the low state of Activity:
sfx.playTrack(name); // play a bell
delay(500);
if (!Activity) Serial.println("Activity");
Problem with input
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- clocktower
- Posts: 60
- Joined: Sun May 24, 2015 3:10 pm
Re: Problem with input
Okay, yet again I have committed a STUPID error and have found it five minutes after posting my question.
The correct code is:
if (!digitalRead(Activity)) Serial.println("Activity");
The Forum is a great help, even without replies. Just by posting a question I receive an answer from the ether...
The correct code is:
if (!digitalRead(Activity)) Serial.println("Activity");
The Forum is a great help, even without replies. Just by posting a question I receive an answer from the ether...
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Problem with input
Thanks for posting your findings. I was just about to suggest a pullup resistor for the pin but am relieved you found a solution.
Please be positive and constructive with your questions and comments.