I try to make a temperature sensor where I need to data log it on my pc to later use.
i have try to use Gobetwino but i can figure out where to bluge ind the code ( the code there say what Command Gobetwino shall log)
code to temperature sensor
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into pin 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
delay(1000);
Serial.begin(9600);
Serial.println("wellcome");
Serial.println("Temperature Sensor DS18B20");
delay(1000);
// 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 is: ");
Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"?
// You can have more than one IC on the same bus.
// 0 refers to the first IC on the wire
delay(6000);
}
What happened to the "S|"? The S is a command, followed by a separator followed by some data (where and what). Remove the command, and GoBetwino has no idea what to do.
By the way, logging the address of the function seems rather pointless. Logging the data from the sensor would make sense. But, that is NOT the way to do it.
Here is my function, I have four sensors.
TempF_0 etc are global variables.
The error test is to put a # at the start of each bad line of data.
Problem is what if one sensor is gone?
// Begin get four validated temps.
// It writes to global variables
// A bad read of the one wire temp sensors results in all
// four sensors showing 185.0. I test sensor 0 only
// I test for the value and substitute 0.00
//
void get_four_validated_temps(void){
float testTemp=185.0;
int problem_counter=0;
void requestTemperatures(void); // Original call is sensors.requestTemperatures(void)
delay(750);
tempF_0 = sensors.getTempF(deviceAddress0);
void get_four_validated_temps(void){
float testTemp=185.0;
int problem_counter=0;
void requestTemperatures(void); // Original call is sensors.requestTemperatures(void)
Why is there a function prototype in the middle of this function?