TinyScreen code switch/ case/ break

Started by kfahrner, January 07, 2016, 09:51:25 PM

Previous topic - Next topic

kfahrner

*
Newbie
Posts: 1
Logged
Hi,
I am trying to use the switch / case statements to detect which button has been pressed on the TinyScreen.
My code runs well on an Arduino UNO.
On TinyScreen switch and case seem to work, but the break statements are not recognised. This means that the sketch runs through the following statements too instead of branching out.
I wonder if there is a general problem with this procedure on TinyScreen, or if I am just making a mistake?
I attach the section of the code showing the problem.
Thanks   Klaus


calvinthedestroyer

*****
Hero Member
Posts: 106
Logged
Not sure if I can help you, In one of my sketches I replaced my non-working case statement with IF statements:

https://codebender.cc/sketch:60785

www.DSPrototyping.com
www.youtube.com/calvinthedestroyer/

GordieGii

**
Jr. Member
Posts: 6
Location: Toronto
Logged
Why are there single quotes around the numbers?
Is "mySwitches" a number or a string?
Perhaps the UNO compiler parses the single quotes differently than the Tiny compiler.

SMF spam blocked by CleanTalk