Hello to all,
Can somebody give me an example of as using the instruction CASE?.
Thank you
Printable View
Hello to all,
Can somebody give me an example of as using the instruction CASE?.
Thank you
Code:select case Avar
Case 1
' blah blah blah
Case 2
' ZZZzzzzZZZZ
Case 3
' Swing la baquaisse dans le fond d'la boite a bois
Case NothingWork
' Read PBP manual... everything is explain black on white
END SELECT
Leonardo,
Here is a file that uses the SELECT CASE. It is a templete for decoding and then acting on different buttons from a 16 key pad. I use it as an "INCLUDE" to add the routines to the project. Only a couple of CASEs have any meaningful actions in them at this point. Hope it helps.
Steve
Select case dtmf ' dtmf is the variable that I am comparing the cases to
case "1" 'this says if dtmf = "1" then
portc = %10010111 'do this
case "2"
portc = %10011001
case "3"
portc = %10011011
case "4"
portc = %10011101
case "5"
portc = %10011111
case "6"
portc = %10100001
case "7"
portc = %10100011
case "8"
portc = %10100101
case "9"
portc = %10100111
case "0"
portc = %10101001
end select ' gets you out of the case statement like endif
This is the general gist of it. I too just learned how this thing works.
Travin
Hello,
Thank you to all for their answers, I will make the tests and then I inform them.
Greetings
Leonard
Quote:
Originally Posted by Travin77
Hello,
Can you publish the circuit please?
Leonard
Quote:
Originally Posted by SteveB
Leonard,
I am using a basic 16-key keypad, which can be bought surplus on the cheap (BG Micro, All Electronics Corp are a couple places that carry some).
Here is a link that has info on setting up a keypad matrix. The matrix size can be adjusted as required for your application:
http://www.rentron.com/serkey16.htm
Or do a google search (that's how I found the link).
Steve