Serin RX, 2, 500, MainMenu, cereal
This line goes to MainMenu if nothing is received after 500 ms therefore [00]Dingleberry will only be printed if something is received.
What is going on?
Can you send the whole code again please?
Serin RX, 2, 500, MainMenu, cereal
This line goes to MainMenu if nothing is received after 500 ms therefore [00]Dingleberry will only be printed if something is received.
What is going on?
Can you send the whole code again please?
Steve Earl www.datageo.co.uk
you are correct. However, when that didnt work, I removed it again. But when its there, it just cycles back (basically blinks) to the Main Menu unless you send a keystroke, in which case you get [00]Dingleberry.
[00] is Null is it not? Is it possible somewhere in the serin process it's trying to take the char before or after my keystroke? I tried 11, and 23 tho and still returns [00] even though 11 and 23 showed on the receiving terminal. I even tried it with a wait command llike wait for "A" then take the next char. Still same thing. And that was straight from the PBP manual....
#CONFIG
__config _FOSC_HS & _WDT_OFF & _PWRTE_ON & _BODEN_ON & _LVP_OFF & _CPD_OFF & _WRT_OFF & _DEBUG_OFF & _CP_OFF
#ENDCONFIG
TRISC=%10000000
DEFINE OSC 12
el var PORTD.7
TRISD.7 = 0
low el
az var PORTB.5
TRISB.5 = 0
low az
dir var PORTD.5
TRISD.5 = 0
low dir
TX var PORTC.6
TRISC.6 = 0
RX var PORTC.7
CNT var word
cereal var byte
i var byte
goto MainMenu
CLR:
For i = 0 to 30
serout TX, 2, [10]
next i
return
MainMenu:
gosub CLR
serout Tx, 2, ["******** MAIN MENU ********", 13, 10, 10]
serout Tx, 2, [" 1. Start Homing Sequence", 13, 10]
serout Tx, 2, [" 2. Manual JOG Mode", 13, 10]
serout Tx, 2, [" 3. Auto-Acquire Satellite", 13, 10]
serout Tx, 2, [" 4. Stow Dish for Travel", 13, 10, 10]
serout Tx, 2, ["Enter Your Selection:", 13, 10]
pause 500
Serin RX, 2, 500, MainMenu, cereal
If cereal = "1" then goto HomeDish
If cereal = "2" then goto JogMenu
If cereal = "3" then goto AutoAcquire
If cereal = "4" then goto StowDish
serout TX, 2, [cereal] 'For debugging only
serout TX, 2, ["Dingleberry"]
pause 1500
goto MainMenu
HomeDish:
gosub CLR
serout Tx, 2, ["******** HOME DISH ********", 13, 10, 10]
serout Tx, 2, [" 1. Start Homing Sequence", 13, 10, 10]
serout Tx, 2, [" 2 Abort Homing", 13, 10, 10]
serout Tx, 2, ["Enter Your Selection:", 13, 10]
Serin RX, 2, cereal
if cereal = "1" then goto StartHoming
if cereal = "2" then goto MainMenu
serout TX, 2, [cereal] 'For debugging only
pause 500
goto HomeDish
JogMenu:
gosub CLR
serout TX, 2, [" JOG MENU ", 13, 10, 10]
serout TX, 2, ["1. Elevation", 13, 10]
serout tx, 2, ["2. Azimuth", 13, 10]
serout tx, 2, ["3. Skew", 13, 10]
serout tx, 2, ["4. Main Menu", 13, 10, 10]
serout tx, 2, ["Enter Your Selection:"]
serin RX, 2, cereal
goto MainMenu
AutoAcquire:
gosub CLR
serout TX, 2, [" AUTO-ACQUIRE ", 13, 10, 10]
serout TX, 2, ["*** UNDER CONSTRUCTION *** ", 13, 10]
pause 3000
goto MainMenu
StowDish:
gosub CLR
serout TX, 2, [" STOW DISH ", 13, 10, 10]
serout TX, 2, ["*** UNDER CONSTRUCTION *** ", 13, 10]
pause 3000
goto MainMenu
StartHoming:
gosub CLR
serout TX, 2, [" Begin Homing, Homie ", 13, 10, 10]
serout TX, 2, ["*** UNDER CONSTRUCTION *** ", 13, 10]
pause 3000
goto MainMenu
TestPattern:
HIGH el
pause 1000
low el
pause 1000
high dir
pause 50
high el
pause 1000
low el
low dir
pause 1000
HIGH az
pause 1000
low az
pause 1000
high dir
pause 50
high az
pause 1000
low az
low dir
pause 1000
goto TestPattern
Bookmarks