A-Bot Whisker Test w/ Terminal Fail
EvilSockMonkey
Posts: 5
I am using a basic Activity Bot with XBee Pro SI installed.
Attempting the "Navigate by Touch" section.
When running the "Test Whiskers with Terminal.c", the terminal window opens, but "wL =" and "wR=" do not appear at all.
Rather long strings of characters print, with the numerals "2" & "3" predominating.
Have attempted to run with the xBee removed. No change
Have shifted whisker circuit from pins 7&8 to 5&6, adjusted program. No change
Have completely removed all components of whisker circuits. No change
I made no changes to the program downloaded from the Learn Library.
Perhaps all of my lower pins have become possessed by a cyber demon?
Attempting the "Navigate by Touch" section.
When running the "Test Whiskers with Terminal.c", the terminal window opens, but "wL =" and "wR=" do not appear at all.
Rather long strings of characters print, with the numerals "2" & "3" predominating.
Have attempted to run with the xBee removed. No change
Have shifted whisker circuit from pins 7&8 to 5&6, adjusted program. No change
Have completely removed all components of whisker circuits. No change
I made no changes to the program downloaded from the Learn Library.
Perhaps all of my lower pins have become possessed by a cyber demon?
Comments
Yessir, the whiskers are grounded. The fun part is that the bug appears before any interaction at all. The default state for the test is never reached.
Code as follows:
/*
Test Whiskers with Terminal.c
Display whisker states in terminal. 1 = not pressed, 0 = pressed.
*/
#include "simpletools.h" // Include simpletools header
int main() // main function
{
freqout(4, 2000, 3000); // Speaker tone: P4, 2 s, 3 kHz
while(1) // Endless loop
{
int wL = input(7); // Left whisker -> wL variable
int wR = input(8); // Right whisker -> wR variable
print("%c", HOME); // Terminal cursor home (top-left)
print("wL = %d wR = %d", wL, wR); // Display whisker variables
pause(50); // Pause 50 ms before repeat
}
}
Just the stock code from the Learn library.
As requested.
As the same output is being produced with the circuit completely removed, I suspect that the problem lies in something highjacking P30
And here we see the output to the terminal.
As you can see, "wL" and "wR" fail to print at all leading me to believe that something else is highjacking p30 for output.
Can you power up the board without the USB cable plugged in and see if you get the same "activity"? I'm thinking that you may have a program in EEPROM that may be causing what you are suspecting re pin 30. Are you able to load and execute other Tutorial programs like blinking the leds? If you can then load that program into the EEPROM to overwrite whatever is there. If it won't let you load anything perhaps one of the wiser gurus on this forum can tell you how to clear the EEPROM. Maybe by trying to load a program before the EEPROM image is pulled into the prop after pressing reset.
and then run your program with terminal (F8) and see if that helps.
If not just run a simple program that uses the terminal to test it such as:
Tom
When I press Load RAM & RUN Icon the RED LED blinks once real quick and then stays on and the BLUE LED will blink twice near the beginning and once more at the end and the RED LED goes out.
I can load another program into EEPROM and run it. (Forward Stop Face Right)
Red and Blue LEDs near the Serial input flash robustly when loading. A veritable discotheque!
Changing the Baud rate did indeed work!
Now the question becomes why did it work?