![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Hey everyone
Can someone help out on the following code? The first two IF THEN statements work but, the switch IF THEN statement does not. When I run the code with the first two IF THEN statements commented out, the switch IF THEN statement is recognized. Also, if I hold down the switch and press A or B on my terminal program, the switch IF THEN statement is recognized. I am completely confused as to why it does not work. Any help is greatly appreciated. Here is the code: DEVICE 16F84A INCLUDE "MODEDEFS.BAS" PORTA = %10111 PORTB = %00000000 Cls Print AT 1, 1, " WELCOME" Dim SERDATA As Byte SINPUT: SERIN PORTA.4, 396, [SERDATA] If SERDATA = "A" Then SEROUT PORTA.3,396, ["SENDING THE LETTER A"] Cls Print AT 1, 1, "SENDING THE" Print AT 2, 1, "LETTER A" Else End If If SERDATA = "B" Then SEROUT PORTA.3,396, ["SENDING THE LETTER B"] Cls Print AT 1, 1, "SENDING THE" Print AT 2, 1, "LETTER B" Else End If IF PORTA.2 = 1 THEN Cls Print AT 1, 1, "SWITCH PUSHED" SEROUT PORTA.3,396,[ "SWITCH PUSHED"] Else End If GOTO SINPUT End
__________________
I like to tell people I have the heart of a young boy. Then I say it\'s in a jar on my desk. - Stephen King |
|
|
|
|
|
|
(permalink) |
|
never mind. i fixed it. :lol:
__________________
I like to tell people I have the heart of a young boy. Then I say it\'s in a jar on my desk. - Stephen King |
|
|
|
|