I keep getting a error when compiling related to "{"

Im looking for some help/adivse as to while i keep getting this error message “a function-definition is not allowed here before ‘{’ token”.

Its the “{” right below the void setup. iv tried variuos things with no luck.

Could anyone point me in the right direction.
Thanks in advance.
Adam.

#include <SimpleTimer.h>
#include <OneWire.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
SimpleTimer timer;
/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************

  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - Arduino Mega 2560 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <SPI.h>
#include <BlynkSimpleEthernet.h>

// 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

OneWire  ds(48);  // on pin 48 (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;
float s4;
float s5;
float s6;
float s7;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "d27bf6f0a098498a81a5c65dab79b851";

#define W5100_CS  10
#define SDCARD_CS 4
float SetPoint            = 20;          //temperature set-point
float Differential        = 2;           //temperature control differential
int Relay1 = 22;
int Relay2 = 23;
int Relay3 = 24;
int Relay4 = 25;
int Heater1 = 50;
int Heater2 = 51;
int Cooling = 28;
float temperature  = NAN;
float lowAlarm     = NAN;
float highAlarm    = NAN;
int   int_probe_type = 0;            //convert char to int to use Switch case
int   button_pressed = 0;            //virtual button variable


// temperature control 

BLYNK_WRITE(V11){
  //reads the setppoint
  SetPoint = param.asFloat();
}
BLYNK_WRITE(V12){
  //reads the differential
  Differential = param.asFloat();
}
BLYNK_WRITE(V32){
  //reads low alarm
  lowAlarm = param.asFloat();
}
BLYNK_WRITE(V33){
  //reads high alarm
  highAlarm = param.asFloat();
}
BLYNK_WRITE(V40){
  //receive button state from Blynk App
  button_pressed = param.asInt();
}


void HandleRLYControl(){
  //if sensor not sending temperature turn relay OFF for safety
  if (isnan(temperature) && Heater1 HIGH) {
    Heater1  = false;
    Heater2 = false;
    digitalWrite(Heater1, LOW);
    digitalWrite(Heater2, LOW);
  }

  else if (!isnan(temperature))
  {
    if(Heater1){
        if (temperature < (SetPoint - Differential) && !Heater1 HIGH)   {
          digitalWrite(Heater1, HIGH);
          digitalWrite(Heater2, HIGH);
          Heater1    = true;
          Heater2 = true;
        }
        else if (temperature >= SetPoint && Heater1 HIGH) {
          digitalWrite(Heater1, LOW);
          digitalWrite(Heater2, LOW);
          Heater1  = false;
          Heater2 = false;
        }
    }
      if (Cooling){
          if (temperature > (SetPoint + Differential) && !Cooling HIGH)   {
            digitalWrite(Cooling, HIGH);
            Cooling  = true;
          }
          else if (temperature <= SetPoint && Heater1 HIGH,Heater2 HIGH ) {
            digitalWrite(Heater1, LOW);
            digitalWrite(Heater2, LOW);
            Heater1 = false;
            Heater2 = false;
          }
      }
  }
      
void setup()
{
  
  //Prevent relay trigger on bootup
  pinMode(22, INPUT_PULLUP);
//Define the relay pins
  pinMode(22, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(23, INPUT_PULLUP);
//Define the relay pins
  pinMode(23, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(24, INPUT_PULLUP);
//Define the relay pins
  pinMode(24, OUTPUT);
  //Prevent relay trigger on bootup
  pinMode(25, INPUT_PULLUP);
//Define the relay pins
  pinMode(25, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(26, INPUT_PULLUP);
//Define the relay pins
  pinMode(26, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(27, INPUT_PULLUP);
//Define the relay pins
  pinMode(27, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(28, INPUT_PULLUP);
//Define the relay pins
  pinMode(28, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(29, INPUT_PULLUP);
//Define the relay pins
  pinMode(29, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(30, INPUT_PULLUP);
//Define the relay pins
  pinMode(30, OUTPUT);

  // Debug console
  Serial.begin(9600);

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  //Blynk.begin(auth, IPAddress(192,168,1,100), 8080);

// relay control- delay - turning off multiple relays with the return pump
}
      }
void TurnRelaysOn()
  digitalWrite(Relay2, HIGH);
  digitalWrite(Relay3, HIGH);
}
BLYNK_WRITE(V1)  // Set to your Buttons vPin
 int pinValue = param.asInt(); // Get State of Virtual Button, Return pump
if (pinValue == 0); // if button off 
digitalWrite(Relay2, LOW); // turn skimmer off 
digitalWrite(Relay2, LOW); // turn Reactor off 
 if (pinValue == 1); // if button on 
 timer.setTimeout(3000, TurnRelaysOn);}
 }
}
void loop()
{
 Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
 // to avoid delay() function!
 // Debug console
  Serial.begin(9600);
}
{
    byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
  
  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;
  }
  Serial.println();
 
  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();
  }
  Serial.println();

  // 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 == 239)  {         //replace ??? with value of sensor number 1    
    s1 = celsius;           //change celsius to fahrenheit if you prefer output in Fahrenheit
  }

  if(adr ==2 )  {         //replace ??? with value of sensor number 2
    s2 = celsius;           //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.print(s3);
Serial.print(" Sensor 4 = ");
Serial.print(s4);
Serial.print(" Sensor 5 = ");
Serial.print(s5);
Serial.print(" Sensor 6 = ");
Serial.print(s6);
Serial.print(" Sensor 7 = ");   //add or delete if you need more or less
Serial.print(s7);

  Blynk.virtualWrite(V5, s1);
  Blynk.virtualWrite(V6, s2);
  Blynk.virtualWrite(V7, s3);
  Blynk.virtualWrite(V8, s4);
  Blynk.virtualWrite(V9, s5);
  Blynk.virtualWrite(V10, s6);
  Blynk.virtualWrite(V11, s7);    //add or delete if you need more or less
}




 

Your brackets are missing or you have too many. you wil have to go through them one by one and check.

plus you have a serial.begin(9600) in you loop(). and lots of other thing that seem out of place.

one bracket to delete.

serial.begin must be in setup.

{
    byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;

???
no function …
must be something like that

void function (){
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
.
.
.
}

:wink:

Thank you for your reply, i have made the changes you said about but now i have a issue with the line added "n=void function (){.

Once again its the “{” causing the isse.

i dont understand where im going wrong as it compiled after adding some coding. i then modified it to suite my needs and then i get this. i havnt deleted or added any “{}”.

It was after i modified this bit.
BLYNK_WRITE(V11){
//reads the setppoint
SetPoint = param.asFloat();
}
BLYNK_WRITE(V12){
//reads the differential
Differential = param.asFloat();
}
BLYNK_WRITE(V32){
//reads low alarm
lowAlarm = param.asFloat();
}
BLYNK_WRITE(V33){
//reads high alarm
highAlarm = param.asFloat();
}
BLYNK_WRITE(V40){
//receive button state from Blynk App
button_pressed = param.asInt();
}
void HandleRLYControl(){
//if sensor not sending temperature turn relay OFF for safety
if (isnan(temperature) && rly1On) {
rly1On = false;
digitalWrite(Heater1, LOW);
digitalWrite(Cooling, LOW);
}

else if (!isnan(temperature))
{
if(Heater1){
if (temperature < (SetPoint - Differential) && !rly1On) {
digitalWrite(Heater1, HIGH);
rly1On = true;
}
else if (temperature >= SetPoint && rly1On) {
digitalWrite(Heater1, LOW);
rly1On = false;
}
}
if (Cooling){
if (temperature > (SetPoint + Differential) && !rly2On) {
digitalWrite(Cooling, HIGH);
Cooling = true;
}
else if (temperature <= SetPoint && rly2On) {
digitalWrite(Cooling, LOW);
Cooling = false;
}
}
}

#include <SimpleTimer.h>
#include <OneWire.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
SimpleTimer timer;
/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************

  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - Arduino Mega 2560 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData
  example.
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <SPI.h>
#include <BlynkSimpleEthernet.h>

// 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

OneWire  ds(48);  // on pin 48 (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;
float s4;
float s5;
float s6;
float s7;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "d27bf6f0a098498a81a5c65dab79b851";
#define BLYNK_PRINT Serial


#define W5100_CS  10
#define SDCARD_CS 4

int Relay1 = 22;
int Relay2 = 23;
int Relay3 = 24;
int Relay4 = 25;
int Heater1 = 50;
int Heater2 = 51;
int Cooling = 28;

//*************************************USER CONFIGURATION THAT CAN BE CHANGED***********************************************//
float SetPoint            = 20;          //temperature set-point
float Differential        = 2;           //temperature control differential
bool  HEATING       = true;             //Heating assigned to relay 1
bool  COOLING        = false;             //Cooling assigned to relay 2
float temperature  = NAN;
float humidity     = NAN;
float lowAlarm     = NAN;
float highAlarm    = NAN;
int   int_probe_type = 0;            //convert char to int to use Switch case
int   button_pressed = 0;            //virtual button variable
bool      rly1On           = false;
bool      rly2On           = false;
bool      rly3On           = false;

BLYNK_WRITE(V11){
  //reads the setppoint
  SetPoint = param.asFloat();
}
BLYNK_WRITE(V12){
  //reads the differential
  Differential = param.asFloat();
}
BLYNK_WRITE(V32){
  //reads low alarm
  lowAlarm = param.asFloat();
}
BLYNK_WRITE(V33){
  //reads high alarm
  highAlarm = param.asFloat();
}
BLYNK_WRITE(V40){
  //receive button state from Blynk App
  button_pressed = param.asInt();
}
void HandleRLYControl(){
  //if sensor not sending temperature turn relay OFF for safety
  if (isnan(temperature) && rly1On) {
    rly1On  = false;
    digitalWrite(Heater1, LOW);
    digitalWrite(Cooling, LOW);
  }

  else if (!isnan(temperature))
  {
      if(Heater1){
        if (temperature < (SetPoint - Differential) && !rly1On)   {
          digitalWrite(Heater1, HIGH);
          rly1On    = true;
        }
        else if (temperature >= SetPoint && rly1On) {
          digitalWrite(Heater1, LOW);
          rly1On  = false;
        }
      }
      if (Cooling){
          if (temperature > (SetPoint + Differential) && !rly2On)   {
            digitalWrite(Cooling, HIGH);
            Cooling  = true;
          }
          else if (temperature <= SetPoint && rly2On) {
            digitalWrite(Cooling, LOW);
            Cooling  = false;
          }
      }
  }

void setup()
{

  //Prevent relay trigger on bootup
  pinMode(22, INPUT_PULLUP);
//Define the relay pins
  pinMode(22, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(23, INPUT_PULLUP);
//Define the relay pins
  pinMode(23, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(24, INPUT_PULLUP);
//Define the relay pins
  pinMode(24, OUTPUT);
  //Prevent relay trigger on bootup
  pinMode(25, INPUT_PULLUP);
//Define the relay pins
  pinMode(25, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(26, INPUT_PULLUP);
//Define the relay pins
  pinMode(26, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(27, INPUT_PULLUP);
//Define the relay pins
  pinMode(27, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(28, INPUT_PULLUP);
//Define the relay pins
  pinMode(28, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(29, INPUT_PULLUP);
//Define the relay pins
  pinMode(29, OUTPUT);
//Prevent relay trigger on bootup
  pinMode(30, INPUT_PULLUP);
//Define the relay pins
  pinMode(30, OUTPUT);

 
  

  // Debug console
  Serial.begin(9600);

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  //Blynk.begin(auth, IPAddress(192,168,1,100), 8080);
Blynk.syncAll();
}
void TurnRelaysOn(){
  digitalWrite(Relay2, HIGH);
  digitalWrite(Relay3, HIGH);
}

BLYNK_WRITE(V1){ // Set to your Buttons vPin
 int pinValue = param.asInt(); // Get State of Virtual Button, Return pump
if (pinValue == 0); // if button off 
digitalWrite(Relay2, LOW); // turn skimmer off 
digitalWrite(Relay2, LOW); // turn Reactor off 
 if (pinValue == 1); // if button on 
 timer.setTimeout(3000, TurnRelaysOn);
}
void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
 // to avoid delay() function!
 // Debug console
  Serial.begin(9600);

   // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!

}
void Function(){
    byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
}
  
  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;
  }
  Serial.println();
 
  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();
  }
  Serial.println();

  // 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 == 239)  {         //replace ??? with value of sensor number 1    
    s1 = celsius;           //change celsius to fahrenheit if you prefer output in Fahrenheit
  }

  if(adr ==2 )  {         //replace ??? with value of sensor number 2
    s2 = celsius;           //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.print(s3);
Serial.print(" Sensor 4 = ");
Serial.print(s4);
Serial.print(" Sensor 5 = ");
Serial.print(s5);
Serial.print(" Sensor 6 = ");
Serial.print(s6);
Serial.print(" Sensor 7 = ");   //add or delete if you need more or less
Serial.print(s7);

  Blynk.virtualWrite(V5, s1);
  Blynk.virtualWrite(V6, s2);
  Blynk.virtualWrite(V7, s3);
  Blynk.virtualWrite(V8, s4);
  Blynk.virtualWrite(V9, s5);
  Blynk.virtualWrite(V10, s6);
  Blynk.virtualWrite(V11, s7);    //add or delete if you need more or less
}




im still very new to this so learning along the way. what would be out of place? i wish to learn from thos for other projects id like to do some time in the future.

i realise my stupidity with my serial.begin and have now moved that but still getting the “{” error.

any help would be greatly appriciated.
thanks in advance.

I think that your code is not structured, it seems that you have used copy/paste code :wink:

void HandleRLYControl() {
  //if sensor not sending temperature turn relay OFF for safety
  if (isnan(temperature) && rly1On) {
    rly1On  = false;
    digitalWrite(Heater1, LOW);
    digitalWrite(Cooling, LOW);
  }

  else if (!isnan(temperature))
  {
    if (Heater1) {
      if (temperature < (SetPoint - Differential) && !rly1On)   {
        digitalWrite(Heater1, HIGH);
        rly1On    = true;
      }
      else if (temperature >= SetPoint && rly1On) {
        digitalWrite(Heater1, LOW);
        rly1On  = false;
      }
    }
    if (Cooling) {
      if (temperature > (SetPoint + Differential) && !rly2On)   {
        digitalWrite(Cooling, HIGH);
        Cooling  = true;
      }
      else if (temperature <= SetPoint && rly2On) {
        digitalWrite(Cooling, LOW);
        Cooling  = false;
      }
    }
  }
} //<----------- is missing

Serial.begin(9600); must be in void setup, not void loop

you never call this function
I think you have to had this in your setup

timer.setInterval(120000L, Function);  // check every 120s 


void Function() {
    byte i;
    byte present = 0;
    byte type_s;
    byte data[12];
    byte addr[8];
    float celsius, fahrenheit;
  }<---- remove it
.
.
.
.
.
  Blynk.virtualWrite(V8, s4);
  Blynk.virtualWrite(V9, s5);
  Blynk.virtualWrite(V10, s6);
  Blynk.virtualWrite(V11, s7);    //add or delete if you need more or less
}  // <------   end of void function

yes slightly but learning along the way and trying to understand what each bit of code dos. thoght i had moved that but obvously not.

still get the same error.

i want to learn where im going worng and get some understanding of it all.

I just edited my post, take a look

get some funky error now when compiling:
thank you so much for your helo so far.

Exception in thread “Thread-472” java.lang.NullPointerException
at org.fife.ui.rsyntaxtextarea.RSyntaxUtilities.getMatchingBracketPosition(RSyntaxUtilities.java:529)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.doBracketMatching(RSyntaxTextArea.java:778)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.fireCaretUpdate(RSyntaxTextArea.java:839)
at javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:4394)
at javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:4416)
at javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:802)
at javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1274)
at javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:1173)
at javax.swing.text.DefaultCaret$DefaultFilterBypass.setDot(DefaultCaret.java:1913)
at javax.swing.text.NavigationFilter.setDot(NavigationFilter.java:64)
at org.fife.ui.rtextarea.ConfigurableCaret$FoldAwareNavigationFilter.setDot(ConfigurableCaret.java:724)
at javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1151)
at javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:1051)
at javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1631)
at processing.app.Editor.addLineHighlight(Editor.java:1642)
at processing.app.Editor.statusError(Editor.java:2552)
at processing.app.Editor$BuildHandler.run(Editor.java:1626)
at java.lang.Thread.run(Thread.java:748)

managed to clear that but still get a issue with “{” straight after the void loop.

The “{” error is what it is, an extra { or missing one. I would recommend you staying with a simpler example in order to get familiar with the language as this has nothing to do with the Blynk platform.

2 Likes

you have to clean your code.
or learn Arduino basic code
I can help you, but not teach you