You're using GOTO with RETURN in the sub-routine. Try this version;
Code:;************************************************* ******* CMCON = %00000111 'Port A all digital CVRCON = %00000000 'CVref turned off OPTION_REG = %10000111 Main: low HoldTxON ; Initialize by clearing all the outputs low LED Low MotorControl_1 LOW MotorControl_2 pause 5000 gosub Lowvoltagecheck goto Main end ;************************************************* ****************************** ; Subroutine to check for battery voltage at the beginning and end of ; transmission flashing to signify low voltage or high voltage LowVoltageCheck: If lowVoltage = 1 then ; If the battery voltage is OK high led ; turn on the LED for 5 seconds pause 5000 LOw LEd else for loop = 1 to 10 ; If the battery voltage is low high led ; Flash the LED 10 times Pause 500 ; at a rate discernable from the low led ; transmit LED flash rate next endif return ;************************************************* *******




Bookmarks