Hello,
I am currently working on a project that involves using switches (handled the same was as a button) and node.js. I am stuck on a part that involves making sure the switches are pressed in the correct order. There is an Up switch and a Down switch.
The things I need to do:
- The Up switch needs to be the first switched pressed, if the Down switch is pressed first I need to print an error (console.log will do)
- The Up switch cannot be pressed two or more times in a row without having a Down switch press in between, if there are two or more Up switch presses in a row it will result in printing an error.
- The Down switch cannot be pressed two or more times in a row without having an Up switch press in between, if there are two or more Down switch presses in a row it will result in printing an error.
Any help I can get would be greatly appreciated! I have been stuck on this for quite a while and I know it shouldn’t be hard its just not coming to me very easily. Everything I have tried so far as been unsuccessful.
Thanks.