'this is my project that blinks 2 led's Option Explicit 'declare variables dim redLed as byte dim greenLed as byte dim LightIsOn as boolean dim GLightIsOn as boolean 'declare counter variables dim countVar as integer dim countVar2 as integer Public Sub Main() 'initialize variables - only called once! redLed = 11 greenLed = 12 countVar = 0 countVar2 = 0 'flag variables LightIsOn = false GLightIsOn = false 'make sure LEDs are off at the start call PutPin(redLed,0) call PutPin(greenLed,0) do if getPin(13) =1 then call blinkRed() end if if getPin(14) = 1 then call blinkGreen() end if loop End Sub sub blinkRed() 'blinks red LED if countVar > 500 then if LightIsOn = true then 'you can also write "if LightIsOn then" call PutPin(redLed,0) LightIsOn = false else call PutPin(redLed,1) LightIsOn = true end if countVar = 0 else countVar = countVar + 1 end if end sub sub blinkGreen() 'blinks green LED if countVar2 > 1000 then if GLightIsOn = true then 'you can also write "if GLightIsOn then" call PutPin(greenLed,0) GLightIsOn = false else call PutPin(greenLed,1) GLightIsOn = true end if countVar2 = 0 else countVar2 = countVar2 + 1 end if end sub