const int cooler = 19;
const int Hotend = 18;
const int but = 14;
int sla;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(cooler, OUTPUT);
pinMode(Hotend, OUTPUT);
pinMode(but, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
if(digitalRead(but)==1)
{
sla=1;
if(sla==1)
{
digitalWrite(cooler, HIGH);
digitalWrite(Hotend, HIGH);
}
}
Serial.println(sla);
}