Don’t be making so many assumptions I am still learning to code and have to spend much of my time Googling, reading and staring at example code, trying to pieces each puzzle part together. And if I can do that in my current foggy headed health, then I am sure you can in time as well.
PS, I volunteer here… I have no job or income due health issues… so please relax and be thankful someone is helping this much.
I have cleaned up the syntax and cleared out the redundant parts of your code… it compiles fine now, but I do not have the sensors or the Ethernet shield to test, so you need to take it from here again
// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library
#define BLYNK_PRINT Serial // Enables Serial Monitor
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h> // This part is for Ethernet stuff
#include <OneWire.h>
#define W5100_CS 10
#define SDCARD_CS 4
BlynkTimer timer;
OneWire ds(47); // on pin 7 (a 4.7K resistor is necessary) make sure you change this from the original pin 10 to an unused pin.
int adr;
float s1;
float s2;
float s3;
byte i;
byte present = 0;
byte type_s;
byte data[12];
byte addr[8];
float celsius, fahrenheit;
char auth[] = "**********************cc79"; // Put your Auth Token here. (see Step 3 above)
void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
Blynk.begin(auth); // Here your Arduino connects to the Blynk Cloud.
// You can also specify server:
//Blynk.begin(auth, "blynk-cloud.com", 8442);
//Blynk.begin(auth, IPAddress(192,168,1,100), 8442);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void myTimerEvent() {
if ( !ds.search(addr)) {
Serial.println("No more addresses.");
Serial.println();
ds.reset_search();
delay(250);
return;
}
// Serial.print("ROM =");
for ( i = 0; i < 8; i++) { //we need to drop 8 bytes of data
}
adr = (addr[7]);
if (OneWire::crc8(addr, 7) != addr[7]) {
Serial.println("CRC is not valid!");
return;
}
ds.reset();
ds.select(addr);
ds.write(0x44, 1); // start conversion, with parasite power on at the end
// delay(1000); // maybe 750ms is enough, maybe not
// we might do a ds.depower() here, but the reset will take care of it.
present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad
for ( i = 0; i < 9; i++) { // we need 9 bytes to drop off
data[i] = ds.read();
}
// Convert the data to actual temperature
// because the result is a 16 bit signed integer, it should
// be stored to an "int16_t" type, which is always 16 bits
// even when compiled on a 32 bit processor.
int16_t raw = (data[1] << 8) | data[0];
if (type_s) {
raw = raw << 3; // 9 bit resolution default
if (data[7] == 0x10) {
// "count remain" gives full 12 bit resolution
raw = (raw & 0xFFF0) + 12 - data[6];
}
} else {
byte cfg = (data[4] & 0x60);
// at lower res, the low bits are undefined, so let's zero them
if (cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms
else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
//// default is 12 bit resolution, 750 ms conversion time
}
celsius = (float)raw / 16.0;
fahrenheit = celsius * 1.8 + 32.0;
if (adr == 0x28, 0xAC, 0x35, 0xB9, 0x08, 0x00, 0x00, 0x4E ) { //replace ??? with value of sensor number 1
s1 = fahrenheit; //change celsius to fahrenheit if you prefer output in Fahrenheit
}
if (adr == 0x28, 0xE6, 0x15, 0xBD, 0x08, 0x00, 0x00, 0x02 ) { //replace ??? with value of sensor number 2
s2 = fahrenheit; //change celsius to fahrenheit if you prefer output in Fahrenheit
}
if (adr == 0x28, 0xA3, 0x49, 0xBC, 0x08, 0x00, 0x00, 0xA7 ) { //replace ??? with value of sensor number 3
s3 = fahrenheit; //change celsius to fahrenheit if you prefer output in Fahrenheit
}
Serial.print(" Sensor 1 = ");
Serial.print(s1);
Serial.print(" Sensor 2 = ");
Serial.print(s2);
Serial.print(" Sensor 3 = ");
Serial.println(s3);
Blynk.virtualWrite(V5, s1);
Blynk.virtualWrite(V6, s2);
Blynk.virtualWrite(V7, s3); //add or delete if you need more or less
}
void loop()
{
Blynk.run(); // All the Blynk Magic happens here...
timer.run(); // Initiates BlynkTimer
}