Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot Keyboard Control without Bluetooth or RF — Parallax Forums

Boe-Bot Keyboard Control without Bluetooth or RF

GBNGADGETGBNGADGET Posts: 1
edited 2009-03-20 23:25 in Robotics
Hi,

I'm having trouble figuring out how to control a Boe-Bot using a keyboard.

I want to be able to press the "F" key on my keyboard, and an LED will turn on, and then maybe if I press the "S" key, the LED will turn off.
Hopefully I can apply this concept to servo control as well.

The Boe-Bot will be plugged directly into the computer. I can't afford/Don't need any of the bluetooth or RF adapters.

Does anyone have any code that they could share that will help me with this simple task?

Thanks.

Comments

  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-03-20 23:25
    Hi GBNGADGET,

    You can accomplish this using the DEBUGIN command and IF...THEN statements, using simple code like this below:
    [color=green]' Add DEBUG user commands here[/color] 
      
    [color=blue]DEBUGIN [/color][color=black]letter [/color]                                   [color=green]' This command reads what the user types in the debug terminal[/color]
     
        [color=blue]IF[/color][color=black] [color=black]letter[/color] =[/color] [color=red]"f"[/color] [color=blue]THEN [/color]                          [color=green]' This checks the letter entered - note that this is case sensitive
    [/color]     [color=green]  ' Code to turn the LED on here[/color]
    [color=#008000]    [color=blue]ELSEIF[/color][color=black] letter =[/color] [color=red]"s"[/color] [color=blue]THEN [/color]                  [color=green]' This checks the letter entered - note that this is case sensitive[/color][/color]
    [color=#008000]        ' Code to turn the LED off here[/color]
    

    For more information on the DEBUGIN command, see the BASIC Stamp Syntax and Reference Manual, page 171.

    Happy Developing!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
Sign In or Register to comment.