I’m sure the issue is looking me right in the face here, but I keep getting the following error. Just getting started on this and can’t make it past this part. I’m new at this any help is much appreciated. I’m sure I’ll find more ing here as I go along.
EMT
Arduino: 1.8.10 (Mac OS X), Board: “Arduino MKR WiFi 1010”
3_mcp9808_blynk.2:27:1: error: expected unqualified-id before ‘{’ token
{
^
exit status 1
expected unqualified-id before ‘{’ token
#include <Wire.h>
#include "Adafruit_MCP9808.h"
#include <WiFi101.h>
#include <BlynkSimpleWiFiShield101.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "pSHTQXXXXXXXXXXXXXXXXX1thIKsTwt";
// Set password to "" for open networks.
char ssid[] = "XXXXXXXX 213";
char pass[] = "XXXXXXXXXX";
// Create the MCP9808 temperature sensor object
Adafruit_MCP9808 tempsensor_1 = Adafruit_MCP9808();
Adafruit_MCP9808 tempsensor_2 = Adafruit_MCP9808();
Adafruit_MCP9808 tempsensor_3 = Adafruit_MCP9808();
void setup() {
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
{ *This is the spot in the sketch I have the problem*
// Make sure the sensor is found, you can also pass in a different i2c //
(!tempsensor_1.begin(0x18)) {
if (!tempsensor_2.begin(0x19))
if (!tempsensor_3.begin(0x1A))
}
void loop() {
// Read and print out the temperature, then convert to *F
float c1 = tempsensor_1.readTempC();
float c2 = tempsensor_2.readTempC();
float c3 = tempsensor_3.readTempC();
float f1 = c1 * 9.0 / 5.0 + 32;
float f2 = c2 * 9.0 / 5.0 + 32;
float f3 = c3 * 9.0 / 5.0 + 32;
Blynk.virtualWrite(V5, f1);
Blynk.virtualWrite(V6, f2);
Blynk.virtualWrite(V7, f3);
}```