Help.. why the motor doesn't run SOLVED!

void TempToMotor()
{
  if (s1 >= 30)
  {
  motor(); // <-----------
  }
}
1 Like

sry i have to change my account cuz i need to w8 13 hours for next reply.

1 Like

okey my code now like this. the motor still not work

#define BLYNK_PRINT Serial // Enables Serial Monitor
#include <SoftwareSerial.h>
SoftwareSerial SerialBLE(5, 4); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <TimeLib.h>
#include <WidgetRTC.h>   
#include <OneWire.h>
const float tempMax = 30.0;// (watch video)
#include <Stepper.h>
const int stepsPerRevolution = 800;
OneWire  ds(2);  // 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;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
int stepCount = 0;  // number of steps the motor has taken
//Dg-xL4X7Bi8pnGnIeE_GShZIwJ3i_FzO
//AtAZzlRjrtJAPKZ-vKdgj1PTVO2NEt5i
//4rsZaSxJlLy9biW0PQk-znfcbsAGC2Rl
char auth[] = "4rsZaSxJlLy9biW0PQk-znfcbsAGC2Rl"; // Put your Auth Token here. (see Step 3 above)
BlynkTimer timer;
WidgetRTC rtc;

  
// Digital clock display of the time
void clockDisplay()
{
  // You can call hour(), minute(), ... at any time
  // Please see Time library examples for details

  String currentTime = String(hour()) + ":" + minute() + ":" + second();
  String currentDate = String(day()) + " " + month() + " " + year();
  Serial.print("Current time: ");
  Serial.print(currentTime);
  Serial.print(" ");
  Serial.print(currentDate);
  Serial.println();

  // Send time to the App
  Blynk.virtualWrite(V1, currentTime);
  // Send date to the App
  Blynk.virtualWrite(V2, currentDate);
}

BLYNK_CONNECTED() {
  // Synchronize time on connection
  rtc.begin();
}


void setup()
{
  Serial.begin(9600); // See the connection status in Serial Monitor
SerialBLE.begin(9600);
  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");
  
  pinMode(2,OUTPUT);// for EN1
  digitalWrite(2,HIGH);// enable EN1
  pinMode(3,OUTPUT);// for EN1
  digitalWrite(3,HIGH); // enable EN2
  
  setSyncInterval(10 * 60); // Sync interval in seconds (10 minutes)

  // Display digital clock every 10 seconds
  timer.setInterval(10000L, clockDisplay);
  timer.setInterval(500L, motor );
  timer.setInterval(1400L, suhu );
  timer.setInterval(2000L, TempToMotor );
}

void motor()
{
  // read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, -2000, 2000, -1000, 1000);
// set the motor speed:
if (motorSpeed > 0) {
myStepper.setSpeed(motorSpeed);
// step 1/100 of a revolution:
//myStepper.step(stepsPerRevolution / 100);
myStepper.step(stepsPerRevolution / 800);
}
}

void suhu()
{
    // 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!
    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 == 229)  {         //replace ??? with value of sensor number 1    
    s1 = celsius;           //change celsius to fahrenheit if you prefer output in Fahrenheit
  
  }
  
  if(adr == 235)  {         //replace ??? with value of sensor number 2
    s2 = celsius;           //change celsius to fahrenheit if you prefer output in Fahrenheit
  
  }

  if(adr == 16)  {         //replace ??? with value of sensor number 3
    s3 = celsius;           //change celsius to fahrenheit if you prefer output in Fahrenheit
    
  }
Serial.print(" Sensor 1 = ");
Serial.println(s1);
Serial.print(" Sensor 2 = ");
Serial.println(s2);
Serial.print(" Sensor 3 = ");
Serial.println(s3);
  
  Blynk.virtualWrite(V5, s1);
  Blynk.virtualWrite(V6, s2);
  Blynk.virtualWrite(V7, s3);
  
}

void TempToMotor()
{
  if (s1 >= 30)
  {
  motor(); 
  }
}
void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...
  timer.run(); 
}

Where does BLYNK come into play in all of this? Are you just using it for the RTC and display? I do not see any BLYNK commands, other than displaying the time and temperatures.

Also, I think you should take some time and learn how to control the parts you need to complete this task. Start with just writing some simple code to get the stepper motor to run at a constant speed. Once you can successfully do that you may have an easier time adding in the temp sensor control part. Also, the use of the Dallas Temp library would make getting the temperatures from the sensors much easier. I would also look into the accelstepper library for controlling the stepper motor.

Since this seem to be for a school project,

It may be beneficial for you to actually learn the subject you are trying to present. Instead of trying to get the people here to do it for you.

2 Likes

i’ve already get the code motor run but when i combine or inject the code. motor not run well. i try all accelstepper code example but its same. That’s why i get stack. i know this code work properly

void TempToMotor()
{
  if (s1 >= 30)
  {
  motor(); 
  }
}

and i think this code its not work when i combine to any code, i dont why. i try very simple code but still not work. but if i upload this code motor run normally

void motor()
{
  // read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, -2000, 2000, -1000, 1000);
// set the motor speed:
if (motorSpeed > 0) {
myStepper.setSpeed(motorSpeed);
// step 1/100 of a revolution:
//myStepper.step(stepsPerRevolution / 100);
myStepper.step(stepsPerRevolution / 800);
}
}

Also do a search for “code examples for basic tasks” if I remember correctly they might be an example there for stepper motors

Are you using a potentiometer on the analog pin to control the speed?

myStepper.step(stepsPerRevolution / 800); is telling the stepper motor to turn one revolution, if put in the loop() this may make it appear to move continuously. If put in a timed loop it will probably appear to move very jerky.

1 Like

i dont using potentiometer, can u give for example ?
i got this code but i don’t understand this code works

//#define BLYNK_PRINT DebugSerial


// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <BlynkSimpleStream.h>
#include <Stepper.h>
const int stepsPerRevolution = 100;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
int stepCount = 0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Your_Auth_Token";
int val;
int absl;
void setup()
{
  // Debug console
  DebugSerial.begin(9600);

  // Blynk will work through Serial
  // Do not read or write this serial manually in your sketch
  Serial.begin(9600);
  Blynk.begin(Serial, auth);
}
BLYNK_WRITE(V1)
{
  int pinValue = param.asInt();
  val = pinValue;
  absl = abs(val);
}
void loop()
{
  Blynk.run();
  int motorSpeed = map(absl, -3000, 3000, -150, 150);
    int motorSpeedabsl = abs(motorSpeed);
    if (motorSpeedabsl > 0) {
    myStepper.setSpeed(motorSpeedabsl);
    // step 1/100 of a revolution:
    myStepper.step(((stepsPerRevolution*val)/absl) / 100);
  }
}
// read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, -2000, 2000, -1000, 1000);

then what is the reason for this chunk of code?

As mentioned before, try understanding what you are coding. Just copying and pasting examples may get some stuff to work, but when trying to modify or add stuff you will be lost and it probably won’t work.

1 Like

cuz i don’t know what should i put in the sketch. that’s why i need help from you all guys.

// read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, -2000, 2000, -1000, 1000);

so what should i change in the code ?

I have been waiting and finally, it’s good at least you’ve done some basic research for your school project. We certainly don’t condone cheating by doing the must-do work for any school project, because this will create a potential harm to the society in the future.

Now we can help you to move further, but you have to do some more research to master the subject and know the root cause before presenting it.

At least I can see these issues:

  1. Duplicated usage of pin 2 => problem for stepper motor control
  2. Use complicated suhu(), instead of using DallasTemp library
  3. Don’t use the timer correctly

This is the sample code, you can have a look and modify according to your project. I just compiled and OK, not tested yet.

#define BLYNK_PRINT Serial // Enables Serial Monitor

#include <BlynkSimpleSerialBLE.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <OneWire.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>

/********************************************************************/
// Data wire is plugged into pin 7 on the Arduino
#define ONE_WIRE_BUS      7     // on pin 7 (a 4.7K resistor is necessary) 
/********************************************************************/
// 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);

#include <Stepper.h>
#define stepsPerRevolution        800

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

float s1;
float s2;
float s3;

char auth[] = "***"; // Put your Auth Token here. (see Step 3 above)

SoftwareSerial SerialBLE(5, 4); // RX, TX
BlynkTimer timer;
WidgetRTC rtc;


// Digital clock display of the time
void clockDisplay()
{
  // You can call hour(), minute(), ... at any time
  // Please see Time library examples for details

  String currentTime = String(hour()) + ":" + minute() + ":" + second();
  String currentDate = String(day()) + " " + month() + " " + year();
  Serial.print("Current time: ");
  Serial.print(currentTime);
  Serial.print(" ");
  Serial.print(currentDate);
  Serial.println();

  // Send time to the App
  Blynk.virtualWrite(V1, currentTime);
  // Send date to the App
  Blynk.virtualWrite(V2, currentDate);
}

BLYNK_CONNECTED() {
  // Synchronize time on connection
  rtc.begin();
}

int motorTimer;

#define TEMP_DELAY_TIME     30000L
#define TEMP_MAX            30

void checkTemp()
{
  if ( (s1 >= TEMP_MAX) || (s2 >= TEMP_MAX) || (s3 >= TEMP_MAX) )
  {
    // Run Stepper Motor every TEMP_DELAY_TIME (30s) if temp is still HIGH
    timer.enable(motorTimer);   
  }
  else
    timer.disable(motorTimer); 
}


void setup()
{
  Serial.begin(115200); // See the connection status in Serial Monitor
  SerialBLE.begin(9600);

  sensors.begin();

  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

  pinMode(2, OUTPUT); // for EN1
  digitalWrite(2, HIGH); // enable EN1
  pinMode(3, OUTPUT); // for EN1
  digitalWrite(3, HIGH); // enable EN2

  setSyncInterval(10 * 60); // Sync interval in seconds (10 minutes)

  // Display digital clock every 10 seconds
  timer.setInterval(10000L, clockDisplay);
  // check temp every 0.5s to see if to run motor
  timer.setInterval(500L, checkTemp);

  // Read temp every 5s
  timer.setInterval(5000L, suhu );

  // Check if temp still HIGH after 30s
  motorTimer = timer.setInterval(TEMP_DELAY_TIME, motorRun);
  timer.disable(motorTimer); 
}

void motorRun()
{
  int motorSpeed = map(analogRead(A0), 0, 1023, 0, 100);
  // set the motor speed
  if (motorSpeed > 0)
  {
    myStepper.setSpeed(motorSpeed);
    // step 1/100 of a revolution:
    myStepper.step(stepsPerRevolution / 100);
  }
}

void suhu()
{
  Serial.print(" Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperature readings
  Serial.println("DONE");
  
  // You can have more than one DS18B20 on the same bus.
  // 0 refers to the first IC on the wire
  s1 = sensors.getTempCByIndex(0);
  s2 = sensors.getTempCByIndex(1);
  s3 = sensors.getTempCByIndex(2);

  Serial.print("Temperature s1, s2, s3 are: " + String(s1) + ", " + String(s2) + ", " + String(s3));
}

void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...
  timer.run();
}

Good luck with your further research.

2 Likes

thank you very much @khoih for your helped. but its still not work. when reach 30 the motor move just for 1 second then stop

I just follow your idea of motor run when s1 get 30ºC or s2 get 30ºC or s3 get 30ºC for 30 seconds, that means

  1. After temp HIGH for 30s, step the motor 1/100 (8 steps) of 1 revolution
  2. After 30 secs, if temp still high, step more 1/100 (8 steps) of 1 revolution, so on
  3. If temp < 30 => stop motor

If you’d like something else, such as

  1. Temp HIGH => motor runs continuously
  2. Temp lower than HIGH =>motor stops

then it’s much easier, just remove the timer and have simpler code.

If you meant motor run for 30 seconds when s1 get 30ºC or s2 get 30ºC or s3 get 30ºC, then it’s a different scenario. And you can do it easily by modifying the code.

I’m waiting and expecting for you to do it, them post the final code

2 Likes

i try to modified the step

#define BLYNK_PRINT Serial // Enables Serial Monitor

#include <BlynkSimpleSerialBLE.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <OneWire.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>

/********************************************************************/
// Data wire is plugged into pin 7 on the Arduino
#define ONE_WIRE_BUS      7    // on pin 7 (a 4.7K resistor is necessary) 
/********************************************************************/
// 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);

#include <Stepper.h>
#define stepsPerRevolution        1000

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

float s1;
float s2;
float s3;

char auth[] = "4rsZaSxJlLy9biW0PQk-znfcbsAGC2Rl"; // Put your Auth Token here. (see Step 3 above)

SoftwareSerial SerialBLE(5, 4); // RX, TX
BlynkTimer timer;
WidgetRTC rtc;


// Digital clock display of the time
void clockDisplay()
{
  // You can call hour(), minute(), ... at any time
  // Please see Time library examples for details

  String currentTime = String(hour()) + ":" + minute() + ":" + second();
  String currentDate = String(day()) + " " + month() + " " + year();
  Serial.print("Current time: ");
  Serial.print(currentTime);
  Serial.print(" ");
  Serial.print(currentDate);
  Serial.println();

  // Send time to the App
  Blynk.virtualWrite(V1, currentTime);
  // Send date to the App
  Blynk.virtualWrite(V2, currentDate);
}

BLYNK_CONNECTED() {
  // Synchronize time on connection
  rtc.begin();
}

int motorTimer;

#define TEMP_DELAY_TIME     3000L
#define TEMP_MAX            30

void checkTemp()
{
  if ( (s1 >= TEMP_MAX) || (s2 >= TEMP_MAX) || (s3 >= TEMP_MAX) )
  {
    // Run Stepper Motor every TEMP_DELAY_TIME (30s) if temp is still HIGH
    timer.enable(motorTimer);   
  }
  else
    timer.disable(motorTimer); 
}


void setup()
{
  Serial.begin(115200); // See the connection status in Serial Monitor
  SerialBLE.begin(9600);

  sensors.begin();

  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

  pinMode(2, OUTPUT); // for EN1
  digitalWrite(2, HIGH); // enable EN1
  pinMode(3, OUTPUT); // for EN1
  digitalWrite(3, HIGH); // enable EN2

  setSyncInterval(10 * 60); // Sync interval in seconds (10 minutes)

  // Display digital clock every 10 seconds
  timer.setInterval(10000L, clockDisplay);
  // check temp every 0.5s to see if to run motor
  timer.setInterval(500L, checkTemp);

  // Read temp every 5s
  timer.setInterval(5000L, suhu );

  // Check if temp still HIGH after 30s
  motorTimer = timer.setInterval(TEMP_DELAY_TIME, motorRun);
  timer.disable(motorTimer); 
}

void motorRun()
{
  int motorSpeed = map(analogRead(A0), 0, 1023, 0, 100);
  // set the motor speed
  if (motorSpeed > 0)
  {
    myStepper.setSpeed(motorSpeed);
    // step 1/100 of a revolution:
    myStepper.step(stepsPerRevolution / 1);
  }
}

void suhu()
{
  Serial.print(" Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperature readings
  Serial.println("DONE");
  
  // You can have more than one DS18B20 on the same bus.
  // 0 refers to the first IC on the wire
  s1 = sensors.getTempCByIndex(0);
  s2 = sensors.getTempCByIndex(1);
  s3 = sensors.getTempCByIndex(2);

  Serial.print("Temperature s1, s2, s3 are: " + String(s1) + ", " + String(s2) + ", " + String(s3));
}

void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...
  timer.run();
}

the motor run smooth, i am very happy :smile:

Btw my sensor ds18b20 in my phone not work now :rofl:
where i put this code ?

 Blynk.virtualWrite(V5, s1);
  Blynk.virtualWrite(V6, s2);
  Blynk.virtualWrite(V7, s3);
  

Try to know what you did wrong, then learn something from that to enrich your experience.

It’s very good that you can master the project by yourself now.

PS: Sensor not displaying because of missing Blynk.virtualWrite() code, you can try and add where appropriate

1 Like

call me master pls :rofl:

#define BLYNK_PRINT Serial // Enables Serial Monitor

#include <BlynkSimpleSerialBLE.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <OneWire.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>

/********************************************************************/
// Data wire is plugged into pin 7 on the Arduino
#define ONE_WIRE_BUS      7    // on pin 7 (a 4.7K resistor is necessary) 
/********************************************************************/
// 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);

#include <Stepper.h>
#define stepsPerRevolution        1000

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

float s1;
float s2;
float s3;

char auth[] = "4rsZaSxJlLy9biW0PQk-znfcbsAGC2Rl"; // Put your Auth Token here. (see Step 3 above)

SoftwareSerial SerialBLE(5, 4); // RX, TX
BlynkTimer timer;
WidgetRTC rtc;


// Digital clock display of the time
void clockDisplay()
{
  // You can call hour(), minute(), ... at any time
  // Please see Time library examples for details

  String currentTime = String(hour()) + ":" + minute() + ":" + second();
  String currentDate = String(day()) + " " + month() + " " + year();
  Serial.print("Current time: ");
  Serial.print(currentTime);
  Serial.print(" ");
  Serial.print(currentDate);
  Serial.println();

  // Send time to the App
  Blynk.virtualWrite(V1, currentTime);
  // Send date to the App
  Blynk.virtualWrite(V2, currentDate);
}

BLYNK_CONNECTED() {
  // Synchronize time on connection
  rtc.begin();
  sensors.begin();
}

int motorTimer;

#define TEMP_DELAY_TIME     3000L
#define TEMP_MAX            30

void checkTemp()
{
  if ( (s1 >= TEMP_MAX) || (s2 >= TEMP_MAX) || (s3 >= TEMP_MAX) )
  {
    // Run Stepper Motor every TEMP_DELAY_TIME (30s) if temp is still HIGH
    timer.enable(motorTimer);   
  }
  else
    timer.disable(motorTimer); 
}


void setup()
{
  Serial.begin(115200); // See the connection status in Serial Monitor
  SerialBLE.begin(9600);

  sensors.begin();

  Blynk.begin(SerialBLE, auth);

  Serial.println("Waiting for connections...");

  pinMode(2, OUTPUT); // for EN1
  digitalWrite(2, HIGH); // enable EN1
  pinMode(3, OUTPUT); // for EN1
  digitalWrite(3, HIGH); // enable EN2

  setSyncInterval(10 * 60); // Sync interval in seconds (10 minutes)

  // Display digital clock every 10 seconds
  timer.setInterval(10000L, clockDisplay);
  // check temp every 0.5s to see if to run motor
  timer.setInterval(500L, checkTemp);

  // Read temp every 5s
  timer.setInterval(5000L, suhu );

  // Check if temp still HIGH after 30s
  motorTimer = timer.setInterval(TEMP_DELAY_TIME, motorRun);
  timer.disable(motorTimer); 
}

void motorRun()
{
  int motorSpeed = map(analogRead(A0), 0, 1023, 0, 100);
  // set the motor speed
  if (motorSpeed > 0)
  {
    myStepper.setSpeed(motorSpeed);
    // step 1/100 of a revolution:
    myStepper.step(stepsPerRevolution / 1);
  }
}

void suhu()
{
  Serial.print(" Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperature readings
  Serial.println("DONE");
  
  // You can have more than one DS18B20 on the same bus.
  // 0 refers to the first IC on the wire
  s1 = sensors.getTempCByIndex(0);
  
  s2 = sensors.getTempCByIndex(1);
  s3 = sensors.getTempCByIndex(2);
  
  
  Serial.print("Temperature s1, s2, s3 are: " + String(s1) + ", " + String(s2) + ", " + String(s3));
  Blynk.virtualWrite(V5, s1);
  Blynk.virtualWrite(V6, s2);
  Blynk.virtualWrite(V7, s3);
}

void loop()
{
  Blynk.run(); // All the Blynk Magic happens here...
  timer.run();
}

Lets just hope his teacher doesn’t ask the “master” anything about the code, or how it works.

@malik967, Don’t forget to site @khoih as one of your sources. LOL

3 Likes

Using multiple accounts is not acceptable on the forum.
I’ve suspended the @Maulana_Ibrahim account.

Pete.

1 Like