arduino uno interruption code 2 leds 1 switch -


I have tried to make a blockage in my arduino uno board, the wired is connected correctly, but I do not know What is wrong with the code .. What do I need is that Leadership 1 is running by default and when I press the switch button it stops the functioning of 1 and starts making a loop for the lead 2. I've checked the code several times and I still do not know the mistake in code

  int led1 = 13; Int led2 = 12; Int button = 0; Boolean x = false; Zero setup () {pinomoda (lead 1, output); Pinomoda (lead 2, output); Pinomato (button, input); AttachInterrupt (Button, ledchange, CHANGE); } Zero loop () {digital light (lead 1, high); // current LED (high voltage level) // delay (1000); // 1000 ml-sec} wait for zero lidchange () {x = true; DigitalWrite (LED1, less); For (int i = 0; i  

Any suggestions?

@TOMATO The right delay is not going to lead to an ISR, because all interrupts are disabled, Will not be out

Unless you re-enable the interrupt

without the lead () {interrupt (); // Re-enable so that MS can be increased for delay () x = true; DigitalWrite (LED1, less); For (int i = 0; i

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -