Hi Josh,
I've been having a unique issue with the Behavior ports becoming unresponsive. Here's the setup: I'm altering the firmware to input wire terminal TTL's to control the on and off activation of solenoids through the behavior ports. I'm pasting at the end a sample of the code in the 'loop' section. I've got 1 bpod working in this way, however during the development some of the behavior ports just got 'stuck' either on or off, and therefore I used the next 3 ports that I didn't use during development (5,6,7). Yesterday I attempting to set this up, but I had the intention of also setting up a breadboard switch that would turn one solenoid off via a manual button (so I wouldn't have to turn on the computer to start flushing the line). There is one deviation I used because I ran out of micro-usb wires, that is I powered the bpod with a 9V, 1M amp AC cable I had from another arudino kit. In the beginning the solenoids would turn on, but after a bit of debugging I noticed the solenoids just weren't anymore. I didn't mind because my goal was to work on setting up a button with the wire-terminals (it's actually quite tricky because of how the grounding is handled for Outputs, which I try using as Inputs). When I was finally ready to test the buttons, I couldn't get the solenoids to work. I then reflashed the firmware-21, opened Matlab and tried to turn on the solenoids the 'original' way, and I couldn't do that either. Oddly enough, I can't activate the solenoids on ANY behavior port. I'm using 2 valve-port modules and one ethernet wire, so I'll swap these out later in the unlikely chance that it's a wire or module problem, but to me is a very odd issue. I'm worried that somehow using the 9V AC source, the TDK-Lambda voltage converter burned out. I hope not, these arduino's support up to 12 V for the AC in I believe. Anyhoo, if you have any thoughts while reading this, let me know.
Thanks!
Travis
Code:
void loop() {
int sol1 = 5;
int sol2 = 6;
int sol3 = 7;
int val1 = digitalReadDirect(31);
int val2 = digitalReadDirect(41);
int val3 = digitalReadDirect(39);
if (val1 == HIGH) {
digitalWriteDirect(43,HIGH);
outputValve[sol1] = 1;
outputValve[sol2] = 0;
outputValve[sol3] = 0;
valveWriteTM();
}
if (val1 == LOW) {
digitalWriteDirect(43,LOW);
outputValve[sol1] = 0;
valveWriteTM();
}