This is the code . I am new to codding and whole iot stuff . After i work this code it says connected to wifi and stops there nothing happening . ( sorry for my bad english)
#define BLYNK_PRINT Serial
char auth[] = "********************";
char ssid[] = "TurkTelekom_TBB3E";
char pass[] = "******";
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
BLYNK_WRITE(V5)
{
int i = param.asInt(); // assigning incoming value from pin V1 to a variable
// You can also use:
// String i = param.asStr();
// double d = param.asDouble();
Serial.print("V5 Slider value is: ");
Serial.println(i);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
#define role 13
#include <HX711_ADC.h>
#include <Servo.h>
Servo servo;
const int HX711_dout = 4; //mcu > HX711 dout pin
const int HX711_sck = 5; //mcu > HX711 sck pin
const int HX711_dout2 = 6; //mcu > HX711 dout pin
const int HX711_sck2 = 7; //mcu > HX711 sck pin
//HX711 constructor:
HX711_ADC LoadCell(HX711_dout, HX711_sck);HX711_ADC LoadCell2(HX711_dout2, HX711_sck2);
const int calVal_eepromAdress = 0;
long t;long k;
int pos1=0;int pos2=180;//servo motor pozisyonları
void setup() {
servo.attach(9);
pinMode(role,OUTPUT);
Serial.begin(9600); delay(10);
Serial.println();Serial.println("Starting...");
LoadCell.begin(); LoadCell2.begin();
float calibrationValue; // calibration value (see example file "Calibration.ino")
calibrationValue = 696.0; // uncomment this if you want to set the calibration value in the sketch
long stabilizingtime = 2000; // preciscion right after power-up can be improved by adding a few seconds of stabilizing time
boolean _tare = true; //set this to false if you don't want tare to be performed in the next step
LoadCell.start(stabilizingtime, _tare); LoadCell2.start(stabilizingtime, _tare);
if (LoadCell.getTareTimeoutFlag()||LoadCell2.getTareTimeoutFlag()) {
Serial.println("Timeout, check MCU>HX711 wiring and pin designations");
while (1);
}
else {
LoadCell.setCalFactor(calibrationValue);
LoadCell2.setCalFactor(calibrationValue);// set calibration value (float)
Serial.println("Startup is complete");
}
////////////////////////////////////////////////////ESP&BLYNK////////////////////////////////////
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
//////////////////////////////////////////////////////////////////////////////////////////
}
void loop() {
static boolean newDataReady = 0;static boolean newDataReady2 = 0;
const int serialPrintInterval = 0; const int serialPrintInterval2 = 0; //increase value to slow down serial print activity
if (LoadCell.update()&&LoadCell2.update()){
newDataReady = true;newDataReady2 = true;
}
if (newDataReady) {
if (millis() > t + serialPrintInterval) {
float i = LoadCell.getData();
Serial.print("Load_cell output val: ");
Serial.println(i);
newDataReady = 0;
t = millis();
if (i <=30)
{delay(100);
servo.write(pos2);
delay(100);
}
else
{
servo.write(pos1);
}}
}
if (newDataReady2) {
if (millis() > k + serialPrintInterval2) {
float v = LoadCell2.getData();
Serial.print("Load_cell2 output val: ");
Serial.println(v);
newDataReady2 = 0;
k = millis();
if (v <=30)
{delay(100);
digitalWrite(role,LOW);
delay(100);
}
else
{
digitalWrite(role,HIGH);
}}
}
Blynk.run();
}