969Re: [smartsockets] Re: Using IV-17 smartsocket with usb>ttl adapter
- Dec 20, 2012
> --to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So youHappy to, I uploaded it to my server for you:
>> could use C or C++ without having to learn a lot of new things.
>> If you like, I can write a C program equivalent to the Arduino one you posted to get you started.
> If you can do that that would be very nice. Of course, I am looking into some C programming in Linux also at the moment.
I don't remember offhand how many bits per second the smartsockets want - the program is written
to use 9600bps, 8 bits, no parity. There's a #define near the top that sets the port speed, change it
A couple of lines below it, a string is set to the name of the serial port device - you'll likely have to change
this to whatever it is on your system. Many Unix systems offer two versions of serial ports, some have names
like tty.s0, and others have names like cu.s0. The difference is the kind of flow control required to operate. If
your system offers both kinds, try them both. Note that you can specify which port to use at run time (see below).
Compile it with a command like this:
gcc smartsocket.c -o smartsocket
To run it, type:
and it should attempt to connect to the port, configure it, and start sending commands. To use a different
port than the one compiled in, add the port name to the command line:
Like the Arduino original, it loops forever until interrupted.
Let me know if you have any questions!
- << Previous post in topic Next post in topic >>