Temperature control
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 2
- Joined: Fri Oct 21, 2011 1:42 am
Temperature control
Greetings! I bought the Arduino starter pack and I've been through the tutorial lessons but I seem to be hitting a wall. I'm looking for a sketch that will read a temp sensor (I have the TMP36 and the 10k precision epoxy thermistor) and at a certain temperature set one digital output to high, then at a higher temperature set it to low and at the same time set another digital output pin to high. I can read the sensor without a problem, but I'm not getting the statement that turns the digital output to high or low at certain temp readings. I know this is probably simple but I'm just not getting it and could use a push in the right direction. My end goal is a temp controlled fan system that turns a small, low speed fan on at one temperature then at a higher temp switches that fan off and switches a larger, higher speed fan on. It's eventually going to be more complex than that, but I'm trying to start at the simplest level first. If someone could give me a basic example or point me to one I'd appreciate it.
-
- Posts: 12
- Joined: Sat Oct 29, 2011 8:40 am
Re: Temperature control
http://arduino.cc/en/Reference/HomePage
You'll want to look at the digitalWrite() command.
It will look something like this,
in the setup loop you'll want to have a pinMode line in there to set whatever digital pins you're using as outputs.
-Ian
You'll want to look at the digitalWrite() command.
It will look something like this,
Code: Select all
if(temp > hihi) {
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
else if (temp > hi) {
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
else {
digitalWrite(4, LOW);
digitalWrite(5, LOW);
-Ian
-
- Posts: 2
- Joined: Fri Oct 21, 2011 1:42 am
Re: Temperature control
Thanks! I'll give it a shot when I get home this evening!
Please be positive and constructive with your questions and comments.