Jump to content

code not working unless I put a delay(0) within the loop

Recommended Posts


I have the code attached here for testing a 3digit 7 segment display and some pushbuttons.

I use an interrupt routine to update the display, manage blinking and debouncing buttons.

The program should just change the value on the 7 segment display when pushing a button (falling edge on the pin).

Code is working if I put a delay(0) within my while loop (line 87). Without the delay(0) the code in the while loop is doing nothing (it also works if I eg. put random(0) iso. delay(0) )

Looks like the compiler is ignoring the code in the while loop for some strange reason.

Anyone who can explain what is going wrong ? And how to avoid it ?

I am running this on an MSP430G2452; energia version 1.8.11E23 (but same behaviour in 1.6)






Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...