Hi
I am working on home automation project (for fun ) and trying to control appliances using this **broken link removed** by Protosmart in Visual basic. I have tested the board with provided software & it all works fine.
Also, I tried controlling the relays using hyper terminal and they worked as expected.
Now, I am programming in visual basic (am a beginner) to control the Relays and dont know how to send <ENTER> ?
Relays can be controller by sending very simple commands. For example,
O0=1<ENTER> turns on Relay 1
and I am not sure how to send "enter" key?
I will appreciate any help in this regards.
Thanks
The question is refering to the PC side programming, moved to PC Programming and Interfacing [Alexan_e]
The program then halts as you type the keys for the number or letters you want. Then press the 'return' or 'enter' key. The variable is given the value you input.
If you don't want the program to halt, then you cannot use 'INPUT'. Instead you must periodically check for keypresses with a different command. It might be something like 'INKEY' or "GETKEY", etc. This is called polling.
Check your Visual Basic manual to see what code it gives the 'enter' key. It probably has the ascii value of 13 (carriage return).
It may be tricky to use polling. You will have to detect all keypresses.
You'll have to string separate keypresses together. You'll have to store it in a variable, on the chance the next keypress is the 'Enter' key.
Then you'll have to process the string to see if it's made up of letters or numbers, etc.
I fear, the question is very unclear. It's actually asking how to send a specific string to the COM port. "<ENTER>" is somewhat misleading, because it obviously means carriage return, or a carriage return/linefeed combination.