Hi all,
I am in the process of building a program that will operate Christmas lights.
I will be using all 8 outputs on port B and was wondering if there is an easier and more compact (code wise) way to write the sequences.
At the moment I am just using simple output / delay /output / delay routines switching one byte on/off at a time.
I would like to put as many different sequences on the chip as possible (16F chips) so would like to keep the code to a minimum to allow this.
Would using macros keep the number of code lines down?
cheers
Gaz
led sequences / macros?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: led sequences / macros?
Hello
Yes using macros is a good option to save on code size. You could also use a timer interrupt to control the switching on and off of the LEDs. Then simply update the values as part of the main program loop.
Yes using macros is a good option to save on code size. You could also use a timer interrupt to control the switching on and off of the LEDs. Then simply update the values as part of the main program loop.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel