Shop OBEX P1 Docs P2 Docs Learn Events
A-Bot Whisker Test w/ Terminal Fail — Parallax Forums

A-Bot Whisker Test w/ Terminal Fail

EvilSockMonkeyEvilSockMonkey Posts: 5
edited 2014-11-16 16:06 in Learn with BlocklyProp
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?

Comments

  • Hal AlbachHal Albach Posts: 747
    edited 2014-11-11 13:52
    Welcome to the Forums! Are the whiskers grounded? Check with a meter. Can you post the actual program you have loaded to the activity board and possibly provide a picture that shows the connections?
  • EvilSockMonkeyEvilSockMonkey Posts: 5
    edited 2014-11-12 09:38
    Hal Albach wrote: »
    Welcome to the Forums! Are the whiskers grounded? Check with a meter. Can you post the actual program you have loaded to the activity board and possibly provide a picture that shows the connections?

    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.
  • Hal AlbachHal Albach Posts: 747
    edited 2014-11-12 10:34
    The program runs just fine on my Activity Board. Can you post a picture of your hookup?
  • EvilSockMonkeyEvilSockMonkey Posts: 5
    edited 2014-11-14 10:51
    IMG_2091.jpg


    As requested.

    As the same output is being produced with the circuit completely removed, I suspect that the problem lies in something highjacking P30
    1024 x 768 - 86K
  • EvilSockMonkeyEvilSockMonkey Posts: 5
    edited 2014-11-14 12:36
    abot whisker error.jpg



    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.
    1024 x 576 - 82K
  • Hal AlbachHal Albach Posts: 747
    edited 2014-11-14 12:53
    Thank you for the pic, can't really see anything out of the ordinary.
    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.
  • twm47099twm47099 Posts: 867
    edited 2014-11-14 14:28
    Try loading a "do nothing" program into the EEPROM (F11)
    main()
    {
    }
    

    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:
    include simpletools.h
    
    int x = 5;
    main()
    {
    while(x)
      {
       print(" this is a test  x = %d\n", x);
       x-- ;
      }
    }
    

    Tom
  • Hal AlbachHal Albach Posts: 747
    edited 2014-11-14 16:36
    When you load the test program do the red and blue LEDs next to the usb port flash on and off like they did when when you loaded previous programs that worked?

    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.
  • edited 2014-11-15 07:12
    I think if you change the SimpleIDE Terminal's baud rate dropdown from 9600 to 115200, it'll start displaying normally.
  • Hal AlbachHal Albach Posts: 747
    edited 2014-11-15 12:19
    OMG!!! Man, did I go off on a wild tangent or what? I had myself convinced that a program in EEPROM was preventing him from being able to load new programs. Goes to show how very little knowledge can really make me look dumb! :blush:
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-11-15 12:52
    The Baud rate was the first thing I thought of when I read this. However, I did not chime in because I thought someone smarter than me would discount that!!! I guess next time I will put my 2 pennies worth in!
  • EvilSockMonkeyEvilSockMonkey Posts: 5
    edited 2014-11-16 16:06
    Sorry for the delay in responding- out of town for work.

    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?
Sign In or Register to comment.