Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- AtomSoftTech
- http://atomsoft.wordpress.com
- Jason Lopez
- Flipper :MADE FOR: XMOS StartKIT
- */
- #include <xs1.h>
- #include <timer.h>
- #define MODES 4
- int leds[MODES] = {
- 0xE1C00,
- 0x61700,
- 0xC1B00,
- 0xC1580
- };
- /* This the port where the leds reside */
- port p32 = XS1_PORT_32A;
- int main(void) {
- int delay = 150; // initial delay 50 ms
- int led_counter = 0; // A counter to count through the leds array
- while(1) {
- delay_milliseconds(delay); // Wait
- //delay += 1; // Gradually increase the delay
- p32 <: leds[led_counter]; // Drive the next led pattern
- led_counter++; // Pick the next pattern
- if (led_counter == MODES) { // If we are at the last pattern
- led_counter = 0; // then wrap around.
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement