I have finally received my Arduino and have been able to write a few simple programs for it. For my thermostat program I am interested in being able to read several analog sensors (temperature and humidity). I also need to be able to poll specific sensor values from the computer using the serial interface so I can log their values in 5 minute intervals. I don't have all the electronic components yet to build my thermostat so I wanted to write up some test sketches. I based my sketches on a todbot blog entry that I found very useful.
I was originally going to use the C code that todbot wrote to test communication with the Arduino but I soon realized the limitations. What I ended up doing is using "screen" to open a terminal connection to the serial port so I could send and receive data to/from the Arduino. In the future I will have to write a daemon that will run on my linux box that will constantly poll the Arduino for data but thats another story. For now screen will work.
Download serial_tty.pde for the source code.
Using Screen
On my Mac all I had to type to communicate with my Arduino running the above sketch was:
screen /dev/cu.usbserial 9600
To "kill" your screen session you have to type: ctrl+a k
Hope you enjoy. I'm out.
This blog is a place for me to tell you all about my projects I'm working on or want to work on. Hope you enjoy!
Subscribe to:
Post Comments (Atom)
Twittering from the linux command line using curl
Recently I signed up for twitter and have found the need to "twit" from the command line. I found a quick tutorial on how to use ...
-
For my ongoing thermostat project I require some sort of temperature and humidity sensor. Because I'm fairly new to all this I decided ...
-
Yeah, I dont know what to say. This is my first post..... SO yeah.. take that. Peace to your hommies.
-
It's been a while since I've made a post so I have decided that it was about time I did. This time I'll be talking about my H...
No comments:
Post a Comment