or even my nooby 'take' might work?.
Of course with the method I've posted above, you have to hang around 3.2 seconds to work out whether the user input wanted label1 or label2 - it would really works betterif there was just say a half second pause to decide/glean if label1 or label 2 was required. (but if you're new to picbasic it means grappling with less commands/concepts!)Code:Main: if sw1=0 then pause 3200 ' wait 3.2 seconds (or whatever length of time you expect the user to press/hold the switch for) if sw1 = 0 then ' recheck to see if sw1 is still held down goto label2 ' if it is then go & do some stuff in label2 else goto label 1 ' if it wasn't held down then go & do other stuff - goto label 1 endif endif pause 10 goto main label1: do stuff! pause 20 ' bit of a pause for switch debouncing goto main label2: do other stuff! pause 20 ' ' bit of a pause for switch debouncing goto main
Disclaimer: I know bo-diddley squat really!!![]()




Bookmarks