hey guys, i've googled around for the past 4 hours or so, and I haven't learned much about what I'm looking for. As of right now all I'm trying to do is use a DS1621 to read temperature, and then output the temperature, in farenheit, on a double - 7seg display.
I've already learned how to use a shift register to count from 0 to 9, but it was not multiplexing... just using an array of hard-written binary values, looping through as it shifts the bytes out for each number. I'm able to get a temperature reading via the serial console of the arduino IDE, but i'm lost as of right now.
yes, i am pretty new to this... but the more i learn, the more i really enjoy making electrons do my bidding.
This is the code I am using for the temperature sensor:
#include <Wire.h>
// Simple DS1621 demo
// -- by Jon McPhalen (www.jonmcphalen.com)
// -- 19 DEC 2007
// SDA pin is Analog4
// SCL pin is Analog5
// DS1621 has A2, A1, and A0 pins connected to GND
#define DEV_ID 0x90 >> 1 // shift required by wire.h
void setup()
{
Serial.begin(9600);
Wire.begin();
Wire.beginTransmission(DEV_ID); // connect to DS1621 (#0)
Wire.send(0xAC); // Access Config
Wire.send(0x02); // set for continuous conversion
Wire.beginTransmission(DEV_ID); // restart
Wire.send(0xEE); // start conversions
Wire.endTransmission();
}
void loop()
{
int tempC = 0;
int tempF = 0;
delay(1000); // give time for measurement
Wire.beginTransmission(DEV_ID);
Wire.send(0xAA); // read temperature
Wire.endTransmission();
Wire.requestFrom(DEV_ID, 1); // request one byte from DS1621
tempC = Wire.receive(); // get whole degrees reading
tempF = tempC * 9 / 5 + 32; // convert to Fahrenheit
Serial.print(tempC);
Serial.print(" / ");
Serial.println(tempF);
}
any guidance, please?! thanks!