this is my coding
#include <ESP8266WiFi.h>
#include <CTBot.h>
#define P_BUTTON
#define LOCK
int b_cond = 0;
CTBot myTelebot;
String ssid = "#";
String password = "#";
String token = "#";
const int id = #;
void setup() {
Serial.begin(9600);
pinMode(P_BUTTON, INPUT_PULLUP);
pinMode(LOCK, OUTPUT);
myTelebot.wifiConnect (ssid,password);
myTelebot.setTelegramToken(token);
if(myTelebot.testConnection())
{
Serial.print("Connecting to");
Serial.println(ssid);
Serial.println("Connection Success.....");
Serial.println();
}
else
Serial.println("Connection Failed");
}
void loop() {
b_cond = digitalRead(P_BUTTON);
if(b_cond == HIGH){
digitalWrite(LOCK,LOW);
delay(3000);
myTelebot.sendMessage(id, "YOUR CAGE IS OPEN");
}else{
digitalWrite(LOCK, HIGH);
}
}
but when i run, i get error...
this is my error..
D:\project_juta2\project_juta2.ino: In function 'void setup()':
project_juta2:21:18: error: expected primary-expression before ',' token
21 | pinMode(P_BUTTON, INPUT_PULLUP);
| ^
project_juta2:22:14: error: expected primary-expression before ',' token
22 | pinMode(LOCK, OUTPUT);
| ^
D:\project_juta2\project_juta2.ino: In function 'void loop()':
project_juta2:40:32: error: too few arguments to function 'int digitalRead(uint8_t)'
40 | b_cond = digitalRead(P_BUTTON);
| ^
In file included from sketch\project_juta2.ino.cpp:1:
C:\Users\User\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:170:5: note: declared here
170 | int digitalRead(uint8_t pin);
| ^~~~~~~~~~~
project_juta2:43:22: error: expected primary-expression before ',' token
43 | digitalWrite(LOCK,LOW);
| ^
project_juta2:48:22: error: expected primary-expression before ',' token
48 | digitalWrite(LOCK, HIGH);
| ^
exit status 1
expected primary-expression before ',' token
