Hi, I have a 4 channel relay with a PIC controller that I want to control from AA script.
Can someone show me how to script this. I'm clueless.
Thanks for any help.
relay #2 on 254 2 1
relay #2 off 254 2 0
baud rate 2400
port 7
Serial port script help
Re: Serial port script help
Hi, here is an example:
Code: Select all
conn = Serial.Connect(7, 2400)
print "Connection = "; conn
Pause(1)
SetRelay(2, 1)
Pause(1)
SetRelay(2, 0)
sub SetRelay(num, state)
msg = Chr(254) + Chr(num) + Chr(state)
Serial.Send(msg)
end sub