Performs one iteration of pseudo-randomization onVar. Var must be a 16-bit variable. (NOTE: PBC does not support the use of the PORT variable with the RANDOM statement). The pseudo-random algorithm used has a walking length of 65535 (only zero is not produced).
W4 'Get a random number to W4
Reads the EEPROM at the specifiedAddress and stores the result in Var. If Address is 255, Var is assigned the number of EEPROM bytes available. This instruction may only be used with a PICmicro MCU that has an on-chip EEPROM data area such as the PIC16C84 or PIC16F84.
Read5,B2 'Put the value at EEPROM location 5 into B2
Returns from subroutine.RETURN resumes execution at the statement following the GOSUB which called the subroutine.
'Go to subroutine labeled sub1 sub1: Serout 0,N2400,("Lunch") 'Send "Lunch" out Pin0 serially Return 'Return to main program after Gosub
If the pin is an input, it is made an output. If the pin is an output, it is made an input. Pins are numbered 0 to 7.
Output 4 'Make Pin4 an output Reverse 4 'Change Pin4 to an input