Go Down

Topic: i need help for a switch case assignment (Read 6025 times) previous topic - next topic

23jordan01

as corona has forced at homeschooling, I have seriously struggled with coding in general. I am not getting the hands-learning I need to understand these concepts and the videos my teacher has sent me are giving me some context to what to do, but I still feel lost. We have a simple project where we are supposed to design code for a state machine using "case". The state machine should toggle an LED while also having a countermeasure against it bouncing. I can get state machine without "case" that makes an LED toggle on and off, but I can't seem to think of a way to do it with "case". I was hoping anyone could give me a rundown to how I should be going about this assignment as it will be used for a future project.

TheMemberFormerlyKnownAsAWOL

#1
Apr 21, 2020, 03:30 pm Last Edit: Apr 21, 2020, 03:32 pm by TheMemberFormerlyKnownAsAWOL
Show us what you've got so far.
Use code tags.

(I've never seen a LED bounce - what did you mean by that?)

Please also remember to use paragraph breaks.
Please don't PM technical questions - post them on the forum, then everyone benefits/suffers equally

J-M-L

May be you can use google translate to read my tutorial on state machines

I'm using there the OneButton library from Matthias Hertel which is state machine based if you read his documentation

Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

jubukraa

Quote
give me a rundown to how I should be going about this assignment
I'm not giving the game away for a school assignment since the answer is already published and OP just didn't find it ;) but look at example 4 here.

(But also wondering what the bouncing thing is?)


Cheetor

I think what he may mean by 'bouncing' is falling through the case because of a missing break statement.

Go Up