I think you are not taking into account what is really happening on BOTH systems. When you press a key on the PC, that key gets sent out ONCE on the PCs serial port (making certain assumption about your PC code). If it a simple "serial out" type of application, then it may start sending rapid-fire individual bursts of the character determined by your "auto-repeat" time and rate settings (again, making certain assumptions). In no case, is there any indication that a key has been released. Now take this info and think about what your Stamp "sees". It will either see a single character (again, without any indication that the character has been "released") or a series of the same character at the auto-repeat rate. As was suggested earlier, you will have to program the Stamp to "keep doing the last thing I told you to do" until it sees som indication that it needs to do something else...most probably, by seeing another command. Perhaps you should consider each command as a "start-only" command and assign a key to stop the current process. So you might press "a" once to turn left and then press "x" to stop that action when your 'bot is pointed the way you want. Press "w" to go forward and again "x" to stop.
It is a very doable task, but perhaps a little more complicated than you perceive it to be because the PC doesn't send anything special when you release the key.
HTH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Hello
I have control my BoE-bot (picture on the left) with de bedug window of the basic stamp editor. It was working very good. But in the futere I think its better to control my BoE-bot with a Visual Basic program.
The program I use: ···· Transmitter:
' Martin van Leussen - Control BoE-Bot Wireless - Transmitter.bs2
' Keys: Vooruit
' [noparse][[/noparse]w]
' links [noparse][[/noparse]a][noparse][[/noparse]s][noparse][[/noparse]d] Rechts
' Achteruit
' {$STAMP BS2}
' {$PBASIC 2.5}
Command VAR Byte
counter VAR Word
OUTPUT 0 'Transmitter
DEBUG "Welkom" 'Start a new Debug-Window
DO
SERIN 16, 16468, [noparse][[/noparse]Command] 'Recieving command from keyboard (with Debug)
SEROUT 0, 17197, [noparse][[/noparse]Command] 'Transmitting (RF) too the BoE-bot
LOOP
Receiver:
' Martin van Leussen - Control BoE-Bot Wireless - Receiver.bs2
' Keys: Vooruit
' [noparse][[/noparse]w]
' links [noparse][[/noparse]a][noparse][[/noparse]s][noparse][[/noparse]d] Rechts
' Achteruit
' {$STAMP BS2}
' {$PBASIC 2.5}
command VAR Byte
counter VAR Word
INPUT 1
DO
SERIN 1, 17197, [noparse][[/noparse]command]
IF command= 100 THEN
PULSOUT 12, 800
PULSOUT 13, 800
PAUSE 20
ELSEIF command= 97 THEN
PULSOUT 12, 700
PULSOUT 13, 700
PAUSE 20
ELSEIF command= 119 THEN
PULSOUT 12, 650
PULSOUT 13, 850
PAUSE 20
ELSEIF command= 115 THEN
PULSOUT 12, 850
PULSOUT 13, 650
PAUSE 20
ENDIF
LOOP
I like some reply for use Visual Basic to control my BoE-bot.
Post Edited (Martin_vL) : 11/12/2005 12:43:31 PM GMT
Please stop expecting people to write code for you! That will get you nowhere! Please take your time and learn visual basic.NET (not hard to learn) if you still plan on using it. For the basic stamp, keep experimenting. Keep your mind to this project and your nose on the proverbial grindstone. If you give up, that attitude will inevetibly doom you to failure in life.
I wish you the best of luck,
Over and Out
Post Edited (Lightfoot) : 12/18/2005 8:47:41 AM GMT
Comments
RoboGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people in the world,
those that know binary and those that don't.
Formerly bugg.
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com
·
Then nothing happens. If it is like this
Then it has the usual problem of not stopping when I release the key
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = Window
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
0............................................0
0............................................0
0.(Microman171@hotmail.com)..0
0............................................0
0............................................0
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
It is a very doable task, but perhaps a little more complicated than you perceive it to be because the PC doesn't send anything special when you release the key.
HTH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
I have control my BoE-bot (picture on the left) with de bedug window of the basic stamp editor. It was working very good. But in the futere I think its better to control my BoE-bot with a Visual Basic program.
The program I use:
···· Transmitter:
Receiver:
I like some reply for use Visual Basic to control my BoE-bot.
Post Edited (Martin_vL) : 11/12/2005 12:43:31 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = Window
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
0............................................0
0............................................0
0.(Microman171@hotmail.com)..0
0............................................0
0............................................0
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1 + 1 = Window
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
0............................................0
0............................................0
0.(Microman171@hotmail.com)..0
0............................................0
0............................................0
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
I wish you the best of luck,
Over and Out
Post Edited (Lightfoot) : 12/18/2005 8:47:41 AM GMT
Martin