Device = 18F43k22 ' Tell the compiler what chip we are using
Clock = 8 ' Tell the compiler what we will be setting the clock to (Mhz)
Include "IntOSC.bas" //don't really need
Include "SetDigitalIO.bas"
Include "Utils.bas"
'INCLUDE "Utils.bas"
'Config MCLRE = OFF
'CONFIG fOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7 remove?
'Config boren = off
'Dim count As Byte //for keeping track of start of game after et selection
'Dim x As Byte
'Dim Time As LongWord
'Dim Et_time As LongWord
//blue leds
Dim led0 As PORTC.0
Dim led1 As PORTC.1
Dim led2 As PORTC.2
Dim led3 As PORTC.3
Dim led4 As PORTC.4
Dim led5 As PORTC.5
Dim led6 As PORTC.6
Dim led7 As PORTC.7
Dim led8 As PORTD.2
Dim led9 As PORTD.3
Dim sw0 As PORTB.0
Dim sw1 As PORTB.1
Dim sw2 As PORTB.2
Dim sw3 As PORTB.3
Dim sw4 As PORTB.4
Dim sw5 As PORTB.5
Dim sw6 As PORTB.6
Dim sw7 As PORTB.7
Dim sw8 As PORTD.0
Dim sw9 As PORTD.1
SetAllDigital
Input(sw0)
Input(sw1)
Input(sw2)
Input(sw3)
Input(sw4)
Input(sw5)
Input(sw6)
Input(sw7)
Input(sw8)
Input(sw9)
Output(led0)
Output(led1)
Output(led2)
Output(led3)
Output(led4)
Output(led5)
Output(led6)
Output(led7)
Output(led8)
Output(led9)
led0=0
led1=0
led2=0
led3=0
led4=0
led5=0
led6=0
led7=0
led8=0
led9=0
sw0 = 1
sw1 = 1
sw2 = 1
sw3 = 1
sw4 = 1
sw5 = 1
sw6 = 1
sw7 = 1
sw8 = 1
sw9 = 1
'Trisa=%00000000
'TrisB=%11111111 'make all INputs
'TrisC=%00000000 'make all outputs
'Trisd=%00000000
While true
If sw0 = 0 //pushbutton 0
Then
DelayMS(500) //debounce
Toggle (led0) //led0
End If
If sw1 = 0
Then
DelayMS(500)
Toggle (led1)
End If
If sw2 = 0
Then
DelayMS(500)
Toggle (led2)
End If
If sw3 = 0
Then
DelayMS(500)
Toggle (led3)
End If
If sw4 = 0
Then
DelayMS(500)
Toggle (led4)
End If
If sw5=0
Then
DelayMS(500)
Toggle (led5)
End If
If sw6 = 0
Then
DelayMS(500)
Toggle (led6)
End If
If sw7=0
Then
DelayMS(500)
Toggle(led7)
EndIf
Wend