Bhuvanesh Nick
Member level 1
int x=0;
void setup()
{
Serial.begin(14400);
Serial.print("starting");
Serial.println("Program");
pinMode(13,OUTPUT);
pinMode(7,INPUT);
digitalWrite(7,HIGH);//internal pull up
}
void loop()
{
if(digitalRead(7)==0)
{
x=!x;
digitalWrite(13,x);
while(digitalRead(7)==0);
delay(50);//debounce of the spring action of switch
Serial.print(x);
}}
once i press the button its blowing.but next time time when i press its blowing off how is that
void setup()
{
Serial.begin(14400);
Serial.print("starting");
Serial.println("Program");
pinMode(13,OUTPUT);
pinMode(7,INPUT);
digitalWrite(7,HIGH);//internal pull up
}
void loop()
{
if(digitalRead(7)==0)
{
x=!x;
digitalWrite(13,x);
while(digitalRead(7)==0);
delay(50);//debounce of the spring action of switch
Serial.print(x);
}}
once i press the button its blowing.but next time time when i press its blowing off how is that