My very first project so go easy on me!
I'm trying to make a controller for use with a fog horn on a boat. The important signals are various sequences of long and short sounds which are then repeated every two minutes for as long as necessary.
There are also a number of sequences which are used "one off" for instance to say "I'm turning left", "I'm reversing" etc. etc. (Yes, I know I'm not using very nautical language!). To be honest these don't really need to be programmed into the controller but I'm going to do it anyhow.
The main programme is pretty simple....it's just a number of calls to subroutines, with pauses and "high" "low" commands as appropriate. My problem is that I want to control this using just 5 switches (It suits what I want to do and it also by coincidence suits the chip I am using). To do this I need to be able to use each switch on it's own to initiate a subroutine, and I then need to use a combination of switches to initiate other routines. There's no problem with the first bit.......I've just used an "if....then" command. However, to use two keys I've tried using "If switch 1 and switch 2...then". Inevitably this doesn't work as it is impossible to press both switches simultaneously and the wrong routine is called before it then goes onto the correct routine.
I suspect that there is a very simple solution but I can't find it. I've looked at the manual and wonder if "button" would do it but the explanation of this command has me completely flummoxed.
I'm using a PICAXE 18X for no other reason than that is what came with my board!
Any help gratefully received!
I'm trying to make a controller for use with a fog horn on a boat. The important signals are various sequences of long and short sounds which are then repeated every two minutes for as long as necessary.
There are also a number of sequences which are used "one off" for instance to say "I'm turning left", "I'm reversing" etc. etc. (Yes, I know I'm not using very nautical language!). To be honest these don't really need to be programmed into the controller but I'm going to do it anyhow.
The main programme is pretty simple....it's just a number of calls to subroutines, with pauses and "high" "low" commands as appropriate. My problem is that I want to control this using just 5 switches (It suits what I want to do and it also by coincidence suits the chip I am using). To do this I need to be able to use each switch on it's own to initiate a subroutine, and I then need to use a combination of switches to initiate other routines. There's no problem with the first bit.......I've just used an "if....then" command. However, to use two keys I've tried using "If switch 1 and switch 2...then". Inevitably this doesn't work as it is impossible to press both switches simultaneously and the wrong routine is called before it then goes onto the correct routine.
I suspect that there is a very simple solution but I can't find it. I've looked at the manual and wonder if "button" would do it but the explanation of this command has me completely flummoxed.
I'm using a PICAXE 18X for no other reason than that is what came with my board!
Any help gratefully received!