TinyCircuits Forum

General Category => User Projects / Code Examples => Topic started by: kfahrner on January 07, 2016, 09:51:25 PM

Title: TinyScreen code switch/ case/ break
Post by: kfahrner on January 07, 2016, 09:51:25 PM
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

Title: Re: TinyScreen code switch/ case/ break
Post by: calvinthedestroyer on June 03, 2016, 10:05:24 AM
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 (https://codebender.cc/sketch:60785)

Title: Re: TinyScreen code switch/ case/ break
Post by: GordieGii on October 22, 2016, 12:09:14 PM
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.