Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- symbol rampup=b0
- symbol rampdwn=b1
- let b8 = 10
- do
- standby: 'Procedure name e.g. goto Standby
- low 0
- low 1
- low 2
- low 4
- ' Turns All Led's OFF
- pause 20
- 'ORDER OF FADE
- b5=4
- gosub Fade 'First return comes here
- b5=2
- gosub Fade 'Second return comes here
- b5=1
- gosub Fade 'Third return comes here
- b5=0
- gosub Fade 'Fourth return comes here
- goto Fade 'Go back to the start of the fade loop
- loop while b2 < 15 'Random variable that should always be 0 to keep the loop running
- Fade:
- pause 20
- ' UPWARD FADE SECTION
- for rampup=1 to 255 step 1 ' To speed up the change/fade set the step step value between 1 and 15
- pwm b5,rampup,1
- pause 4 ' To slowdown the change/fade, insert pause 1 to 10 here
- if pinC.3 = 1 then goto Start 'Checks if the button is pressed, if so then return to the start of the program (Not needed if you only want led's to to fade endlessly)
- next rampup
- ' DOWNWARD FADE SECTION
- for rampdwn=225 to 1 step -1
- pwm b5,rampdwn,1
- pause 3
- if pinC.3 = 1 then goto Start 'Checks if the button is pressed, if so then return to the start of the program (Not needed if you only want led's to to fade endlessly)
- next rampdwn
- low 0
- pause 300
- return 'Returns back to the next led in the chain
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement