cleaned up and yes it is pretty basic nothing fancy. after Monday's party I want to tweek the scrolling text. As I have the code written it has just non scrolling text. Easier to read.
// halloween costume 2
DEVICE = 18F4520
CLOCK = 8
// sOME LCD OPTIONS...
#option LCD_DATA = PORTB.4
#option LCD_RS = PORTB.2
#option LCD_EN = PORTB.3
// IMPORT LCD LIBRARY...
INCLUDE "LCD.bas"
INCLUDE "utils.bas"
INCLUDE "InternalOscillator.bas"
DIM LED1 AS PORTA.0 //eyes
DIM LED2 AS PORTA.1 //eyes
DIM mask0 AS PORTC.0
DIM mask1 AS PORTc.1
DIM mask2 AS PORTC.2
DIM hose0 AS PORTD.2
DIM hose1 AS PORTD.3
DIM hose2 AS PORTc.4
DIM hose3 AS PORTc.5
DIM hose4 AS PORTc.6
DIM hose5 AS PORTc.7
DIM hose6 AS PORTd.4
DIM hose7 AS PORTd.5
// subroutine
SUB eyes()
DIM x AS BYTE
FOR x = 0 TO 200
LOW(LED1)
HIGH (LED2)
DELAYMS(30)
TOGGLE (LED1)
TOGGLE (LED2)
DELAYMS(20)
x = x +1
IF x >= 200
THEN END IF
NEXT
END SUB
sub mask_hose ()
mask0 =1
hose0 =0
hose1 =1
hose2 =0
hose3 =1
hose4=0
hose5=1
hose6=0
hose7=1
DELAYMS(50)
TOGGLE (mask0) // I need to use port bits here
TOGGLE (hose1) // in a for next loop
DELAYMS(50) // use a random number
TOGGLE (mask1)
TOGGLE (hose2)
DELAYMS(50)
TOGGLE (mask2)
TOGGLE (hose3)
DELAYMS(50)
TOGGLE (mask0)
TOGGLE (hose4)
DELAYMS(50)
TOGGLE (mask0)
TOGGLE (hose5)
DELAYMS(50)
TOGGLE (mask1)
TOGGLE (hose5)
DELAYMS(50)
TOGGLE (mask2)
TOGGLE (hose6)
DELAYMS(50)
TOGGLE (mask2)
TOGGLE (hose7)
end sub
// PROGRAM START...
SetAllDigital
lcd.cls
DELAYMS(200) // warm up LCD
TrisA=%000000 // set port A as outputs (the eyes)
WHILE true
mask_hose ()
WriteAt(1,1,"GRETTINGS")
WriteAt(2,1," EARTHLING")
eyes()
DELAYMS(80)
lcd.cls // clear lcd display
mask_hose ()
WriteAt(1,1,"I have ")
WriteAt(2,1," landed ")
eyes()
DELAYMS(80)
lcd.cls
mask_hose ()
WriteAt(1,1,"to collect")
eyes()
DELAYMS(90)
lcd.cls
mask_hose () // clear lcd display
WriteAt(1,1,"EARTHLING")
WriteAt(2,1," SPECIMENS")
eyes()
DELAYMS(80)
mask_hose ()
lcd.cls
WriteAt(1,1,"are you a")
WriteAt(2,1,"WILLING")
eyes()
DELAYMS(80)
mask_hose ()
lcd.cls
WriteAt(1,1,"SPECIMEN")
eyes()
DELAYMS(80)
WEND /