{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 11/30/2013 *
* Version : 1.0 *
* Notes : candle code that works but very simplistic *
* : *
*****************************************************************************
}
Device = 18F2420
Clock = 8
Include "InternalOscillator.bas"
Include "RandGen.bas"
Include "Utils.bas"
Const led(12)As Byte = (%11111000, %11111010, %11111010,%11111010,
%11111010, %11111000, %11111010,%11111010,
%11111010, %11111010, %11111010,%11111010)'first 3 bits G B R)
Dim INDEX As Byte
Dim x As Byte
Dim LED1 As PORTA
Dim RandomVAL As Byte
Sub flicker()
Dim x As Byte
For x = 0 To 12
' RandomVAL = RandGen.Rand
'PORTA = led(RandomVAL)
PORTA = led(x)
DelaymS(300)
porta = %11111010
delayus(700)
Next
End Sub
' START OF PROGRAM
INDEX = 0
TRISA = %00000000
SetAllDigital
RandGen.Initialize(12)
While true
' RandomVAL = RandGen.Rand
flicker
Wend
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?