Hi everyone,
I'm quite new to C and have not had much practise.
I have a question in 'revision handout' that asks me to:
Design c code (non-blocking) that uses two switches, SW1 and SW2, so that SW1 will increment a variables value up to 99 and SW2 will decrement the value down to 0. (Skeleton of the code)
My idea was this: (assuming switch presses toggle the value to 1)
Code:int SW1; int SW2; int MyVariable; if(SW1 == 1 & MyVariable <= 0) { MyVariable ++; } else(SW2 == 1 & MyVariable >=99) { MyVariable --; }
I don't know what IDE to use at home to test this, can anyone suggest one suitable for a beginner such as myself
Any help is greatly appreciated
Joel