;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'Initialize Leds
Leds = b'0011'
'Step Delay
Wait Delay ms
Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'0011'
Miscellaneous Comment
Full Step Leds Left
Continued
Flow Control Mode
Forever
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Read Leds at Row number
Leds
Miscellaneous Table
StepLeft
Table Location
Leds
Output Variable
Leds
This Icon was created This Icon has no settings
when thse Do Icon was
selected
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'Initialize Leds
Leds = b'0011'
'Step Delay
Wait Delay ms
Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'0011'
Miscellaneous Comment
Full Step Leds Right
Continued
Flow Control Mode
Forever
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Read Leds at Row number
Leds
Miscellaneous Table
StepRight
Table Location
Leds
Output Variable
Leds
This Icon was created This Icon has no settings
when thse Do Icon was
selected
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define SW1 PortA.3
#define SW1up PortA.3=1
#define SW1down PortA.3=0
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
Table StepRight
0
0
9
0
0
3
0
0
12
0
0
6
End Table
'Initialize Leds
Leds = b'0011'
Start:
'Step Delay
Wait Delay ms
'Step Delay
Wait Delay ms
Comment
Configure SW1 as an Input
Miscellaneous Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Wait for PowerUp
Continued
Flow Control Length
1
Units
s
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'0011'
Miscellaneous Comment
Full Step Left
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Read Leds at Row number
Leds
Miscellaneous Table
StepLeft
Table Location
Leds
Output Variable
Leds
This Icon was created This Icon has no settings
when thse Do Icon was
selected
Miscellaneous Comment
Full Step Right
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Read Leds at Row number
Leds
Continued
Table
StepRight
Table Location
Leds
Output Variable
Leds
This Icon was created This Icon has no settings
when thse Do Icon was
selected
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Leds As Byte
Dim Delay As Word
'Initialize Leds
LEDs = b'00010001'
Start:
'Step Delay
Wait Delay ms
'Rotate Left
Rotate Leds Left Simple
Goto Start
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure Leds as Outputs
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'00010001'
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Continued
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Rotate Left
Variables Variable
Leds
Direction
Left
Alt+F2 Edit text to read:
Rotate Leds Left Simple
Flow Control Destination
Start
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Leds As Byte
Dim Delay As Word
'Initialize Leds
LEDs = b'00010001'
Start:
'Step Delay
Wait Delay ms
'Rotate Right
Rotate Leds Right Simple
Goto Start
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure Leds as Outputs
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'00010001'
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Continued
Miscellaneous Comment
Step Delay
Miscellaneous Comment
Rotate Right
Variables Variable
Leds
Direction
Right
Alt+F2 Edit text to read:
Rotate Leds Right Simple
Flow Control Destination
Start
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define SW1 PortA.3
#define SW1up PortA.3=1
#define SW1down PortA.3=0
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'Initialize Leds
Leds = b'00010001'
Start:
'Step Delay
Wait Delay ms
Rotate Leds Right Simple
Loop
Comment
Configure SW1 as an Input
Miscellaneous Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Wait for PowerUp
Flow Control Length
1
Units
s
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
B'00010001'
Miscellaneous Comment
Rotate Leds Left (Simple)
Miscellaneous Comment
Step Delay
Variables Variable
Leds
Direction
Left
Alt+F2 Edit text to read:
Rotate Leds Left Simple
This Icon was created This Icon has no settings
when thse Do Icon was
selected
Miscellaneous Comment
Rotate Leds Right (Simple)
Miscellaneous Comment
Step Delay
Variables Variable
Leds
Direction
Right
Alt+F2 Edit text to read:
Rotate Leds Right Simple
This Icon was created This Icon has no settings
when thse Do Icon was
selected
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'Initialize Leds
Leds = b'0001'
'Rotate Left
Do Forever
'Step Delay
Wait Delay ms
If Leds = b'1000' Then
Leds = b'0001'
Else
'Shift Left
Leds = Leds *2
End If
Loop
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Wait for PowerUp
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'0001'
Miscellaneous Comment
Rotate Left
Miscellaneous Comment
Step Delay
Condition
Leds = b'1000'
Variables Variable
Leds
New Value
b'0001'
Miscellaneous Comment
Shift Left
Variables Variable
Leds
New Value
Leds *2
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'Initialize Leds
Leds = b'1000'
'Rotate Right
Do Forever
'Step Delay
Wait Delay ms
If Leds = 1 Then
Leds = b'1000'
Else
'Shift Right
Leds = Leds / 2
End If
Loop
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure Leds as Outputs
Miscellaneous Comment
Step Delay
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Wait for PowerUp
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'1000'
Miscellaneous Comment
Rotate Right
Miscellaneous Comment
Step Delay
Condition
Leds = 1
Variables Variable
Leds
New Value
b'1000'
Miscellaneous Comment
Shift Right
Continued
Variables Variable
Leds
New Value
Leds /2
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16F690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define SW1 PortA.3
#define SW1up PortA.3=1
#define SW1down PortA.3=0
#define Leds PortC
;Alt+F1 Ctrl+R
;Variables
Dim Delay As word
Dim Leds As byte
'29 Rotate Leds Left ~ Right (Multiply ~ Divide by 2)
'Configure SW1 as an Input
Dir SW1 In
'Initialize Leds
Leds = b'0001'
Start:
'Rotate Left
Do While SW1up
'Step Delay
Wait Delay ms
If Leds = b'1000' Then
Leds = b'0001'
Else
'Shift Left
Leds = Leds *2
End If
Loop
Wait Until SW1up
'Rotate Right
Do While SW1up
'Step Delay
Wait Delay ms
If Leds = b'0001' Then
Leds = b'1000'
Else
'Shift Right
Leds = Leds / 2
End If
Loop
Wait Until SW1up
Goto Start
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure SW1 as an Input
Miscellaneous Comment
Configure Leds as Outputs
Miscellaneous Comment
Define Delay Length
Variables Variable
Delay
New Value
500
Miscellaneous Comment
Wait for PowerUp
Continued
Flow Control Length
1
Units
s
Miscellaneous Comment
Initialize Leds
Variables Variable
Leds
New Value
b'1000'
Miscellaneous Comment
Rotate Left
Miscellaneous Comment
Step Delay
Condition
Leds = b'1000'
Continued
Variables Variable
Leds
New Value
b'0001'
Miscellaneous Comment
Shift Left
Variables Variable
Leds
New Value
Leds *2
Miscellaneous Comment
Rotate Right
Continued
Miscellaneous Comment
Step Delay
Condition
Leds = b'0001'
Variables Variable
Leds
New Value
b'1000'
Miscellaneous Comment
Shift Right
Variables Variable
Leds
New Value
Leds /2
Continued
Flow Control Mode
Until
Condition
SW1up
Destination
Start
;Alt+F1 Ctrl+D
;Chip Settings
#chip 16f690,4
;Alt+F1 Ctrl+Q
;Defines (Constants)
#define SW1 PortA.3
#define Sw1up PortA.3=1
#define Sw1down PortA.3=0
#define Leds PortC
#define Adjust ReadAD10(AN0)
;Alt+F1 Ctrl+R
;Variables
Dim Adjust As word
Start:
Do Forever
'Change Direction?
If SW1down Then
'Change Direction
Turn = 1 xor Turn
Wait Until SW1up
End If
If Turn=0 Then
'Rotate Left
'Read Leds Row number Leds
ReadTable StepLeft, LEDs, LEDs
Else
'Rotate Right
'Read Leds Row number Leds
ReadTable StepRight, LEDs, LEDs
End If
Loop
Goto Start
'''Wait + Adjust
Sub Delays
Wait 500 ms
Wait Adjust ms
End Sub
Alt+F1 View as Icons
Subroutine/Function
Main
Icons, Category
Comment
Configure SW1 as an Input
Miscellaneous Comment
Configure Leds as Outputs
Miscellaneous Comment
Turn=0=Left
Turn=1=Right
Variables Variable
Turn
New Variable
0
Continued
Miscellaneous Comment
Wait for PowerUp
Variables Length
1
Units
s
Miscellaneous Comment
Rotate Any 4 bit Pattern
Comment
Initialize Pattern to Rotate
Variables Variable
Leds
New Variable
b'0111'
Mode
Forever
Miscellaneous Comment
Wait Delays Subroutine
Miscellaneous Comment
Change Direction
Variables Variable
Turn
New Variable
Turn = 1 xor Turn
Miscellaneous Comment
Rotate Left
Comment
Read Leds at Row number
Leds
Table
StepLeft
Table Location
Leds
Output Variable
Leds
Flow Control This Icon has no settings
Miscellaneous Comment
Rotate Right
Comment
Read Leds at Row number
Leds
Miscellaneous Table
StepRight
Table Location
Leds
Output Variable
Leds
This Icon was created This Icon has no settings
when the If Icon was
selected
Subroutines This Subroutine has no
parameters
Continued
Subroutine Delays
Main
Delays
Length
Adjust
Units
ms