B4R Question help with console command

electronik54

Member
Licensed User
Longtime User
hi guys..
i am new with arduino.

i was wondering if it was possible to send commands to arduino over serial comm... for example if i type setDo 1 1 on hyperterminal connected to arduino it will set DO 1 pin to high..

all that i was able to do was read just a single character. i need is some help or some push in right direction.
 

Adie

Member
Licensed User
Longtime User
hi E54
It is better to be specific.
1. Read the string in Arduino
2 or the return value in B4R
Etc etc.
Also sometimes 2 line code snip will give us even better idea of what and how you did it.

OK I'll assume that you send the string setDo 1 1 with B4R to the arduino.

the arduino code must read ALL characters in the string before it 'parse' the line into variables. setDo, 1 and 1.

secondly it is not good programming practice to separate values with spaces as it could limit future features. We use the '~' as seperator because the chance of that in a 'sentence' is about NIL.

Adie
 
Upvote 0
Top