On Apr 7, 2009, at 5:41 AM, Valentin Bud wrote:
I have built with a micro controller a system of power plugs that
controlled through the serial port.
I have 2 plugs that i can start/stop and check the status of them.
accomplished by sending different
letters (eg. A/W) to start/stop one of the plugs and another set of
for the other plug and one letter
to check the status.
Taking into account the fact that my C skills are almost 0 how
would be to write a program
so I can control that micro controller through the serial port. Or
some kind of program that can
read/write from/to the serial port from the command line. I don't
interactive program like minicom,
just a program that connects and send a command (a letter in my
case) to the
Why not minicom (or any other program like it)? My goal is to be
start/stop the plugs using a web interface.
I have tried using minicom and background it but when i log out
closes. If minicom is started i can
send commands to ttyd0 with echo, but i can't read anything from
Now back to my original question, how hard/complicated will it be
a C program to control the micro controller
through the serial port.
Of course on FreeBSD :).
More complicated than you need. The last time I twiddled bits on a
serial port, the choice was Assembler, or C, but today my choice
would be Ruby. You can probably do whatever you want with a few lines
of Ruby, rather than many lines of C. And since you don't know either
language, you might as easily learn Ruby as C.
Unless you are going to start writing low level code, a high level
language like Ruby will let you write any program you need. I haven't
needed to write a line of C code in probably 20 years.
Check out the Ruby serial port library:
The standard Ruby book is "Programming Ruby" (http://
www.pragprog.com). If you don't know programming at all, they have a
"Learn to Program" book that uses Ruby as a first language.
firstname.lastname@example.org mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"