ask yourself
what is the biggest command sequence that will be input ?
how does the pic know when the input seq is complete ?
when you know those answers then the answer will be obvious
ask yourself
what is the biggest command sequence that will be input ?
how does the pic know when the input seq is complete ?
when you know those answers then the answer will be obvious
Warning I'm not a teacher
The commands following the * will not be more than 99 so * and two digits for the commands.
The parameters are max 6.
Once Melanie had posted a similar example for rs232 communication but has its limits.
Ioannis
so a command is *99 or *9 or *09 [where 9 == a numeric digit]
and a parameter is 9 up to 999999
how do you signal that the command has been input and the parameter begins
i would be tempted to use the # as enter
so cmd 33 p2010 would be
*33#2100#
you will need to establish a method to cope with numbers bigger than a word
you need a method first then code it
Warning I'm not a teacher
For a more compact and maybe easier to code the command and data be at defined length.
So command 9 would be 09 and data 9 (this is extreme but for the sake of discussion) would be 00009.
So there is no need for extra termination character.
Also I think word or long variable may not be helpful here. Better an array, since the data are distinct in meaning so a 433925 would mean 433,925MHz in reality as an absolute value.
The beeps would help user to step with confidence entering the commands and data.
I think stuffing an array and then select case is the way to do it.
Ioannis
Bookmarks