hi or should i say HIGH
i have been trying to write code to publish an event and also turn on and output when a button is pressed
i can not get it to work and the led to come on. (it works when i flash a blink demo) i have gone over my code multiple times but can not see where i am going wrong . please could you point me in the right direction
int highfloat = D3; // high float will be connected to pin d2 on the unit
int highlevellight = D7;
void setup()
{
pinMode(highfloat, INPUT_PULLUP); // declare that pin an INPUT
pinMode(highlevellight, OUTPUT);// declare the highlevellight pin as an output
//highfloat = LOW; // set the input as low to make sure the program is not started with it on
//highlevellight = HIGH;
}
void loop() {
if (digitalRead(highfloat) == HIGH)
{
Particle.publish("highlevelreached");
digitalWrite(highlevellight, HIGH);
delay(10000);
}
else
{
digitalWrite(highlevellight, LOW);
}
delay(10000);
}
Thanks