Author Topic: Switch Case vs IF's  (Read 170 times)

Wayne

  • RFduino Jr. Member
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Switch Case vs IF's
« on: August 09, 2017, 01:30:24 PM »
With the help of Patty, Aaron and all here, Thanks.. I have basically finish the Wireless Foot Switch 1st phase with demo boards and software.

Using the Simblee under SimbleeCOM, I have pairing, Pulse, Battery tests, and even WDT on the receiver side.

Now to the question.. I'm trying not to have lots of stuff like LED's on or having a Solid State Relay active via the loop function.  Like in the IF statement, if some == this, do a HIGH..

So I have create the switch case whereas case 51  if passthru == 0, void to turn on led and pasthru =1.
I do a timeout if I loose BT signal or an end of action sent via the Foot Switch as endsend which is 69.

I was thinking that once the case 51 and passthru == 0, it will skip and the void will still have the led on.  When either BT dies via a loss of BT or the case 69 recvd, I drop all stuff
via another void.

If it was under the if statements, it will have lots of workings going on in which in my thinking, slows the loop down somewhat.

I was hoping the speed of this will keep the SSR's on when required with lets say, no flicker.. Unlike a regular relay that is slower in reaction..
But as the systems go, they use micro switches originally which can jitter.  So maybe I'm safe..

Educated guess is I'm fine without having a tiny bit of chatter..