Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed LedStripGradient PololuLedStrip
main.cpp
00001 #include "mbed.h" 00002 #include "PololuLedStrip.h" 00003 00004 PololuLedStrip ledStrip(D9); 00005 00006 #define LED_COUNT 60 00007 rgb_color colors[LED_COUNT]; 00008 00009 Timer timer; 00010 00011 int main() 00012 { 00013 uint8_t u=0; 00014 timer.start(); 00015 00016 while(1) 00017 { 00018 // Update the colors array. 00019 //uint8_t time = timer.read_ms() >> 2; 00020 for(uint32_t i = 0; i < LED_COUNT; i++) 00021 { 00022 //uint8_t x = time - 1*i; 00023 colors[i] = (rgb_color){ 0, 0, 0 }; 00024 } 00025 00026 colors[u] = (rgb_color){ 255, 255, 255 }; 00027 u++; 00028 if(u>=LED_COUNT)u=0; 00029 00030 // Send the colors to the LED strip. 00031 ledStrip.write(colors, LED_COUNT); 00032 wait_ms(15); 00033 } 00034 }
Generated on Tue Jul 19 2022 15:01:36 by
1.7.2