Added new telstick windows drivers
Former-commit-id: 797b455c0a2b358e691a198017acea4eb5c02f73
This commit is contained in:
parent
36d0826a33
commit
af01fb9ae9
22 changed files with 2886 additions and 13 deletions
33
arduino/lib/DallasTemperature/examples/Simple/Simple.ino
Executable file
33
arduino/lib/DallasTemperature/examples/Simple/Simple.ino
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#include <OneWire.h>
|
||||
#include <DallasTemperature.h>
|
||||
|
||||
// Data wire is plugged into port 2 on the Arduino
|
||||
#define ONE_WIRE_BUS 2
|
||||
|
||||
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
|
||||
OneWire oneWire(ONE_WIRE_BUS);
|
||||
|
||||
// Pass our oneWire reference to Dallas Temperature.
|
||||
DallasTemperature sensors(&oneWire);
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
// start serial port
|
||||
Serial.begin(9600);
|
||||
Serial.println("Dallas Temperature IC Control Library Demo");
|
||||
|
||||
// Start up the library
|
||||
sensors.begin();
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
// call sensors.requestTemperatures() to issue a global temperature
|
||||
// request to all devices on the bus
|
||||
Serial.print("Requesting temperatures...");
|
||||
sensors.requestTemperatures(); // Send the command to get temperatures
|
||||
Serial.println("DONE");
|
||||
|
||||
Serial.print("Temperature for the device 1 (index 0) is: ");
|
||||
Serial.println(sensors.getTempCByIndex(0));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue