school project using led strip

Fork of PololuLedStrip by David Grayson

Files at this revision

API Documentation at this revision

Comitter:
DavidEGrayson
Date:
Fri Mar 01 04:46:25 2013 +0000
Parent:
12:b6df8ac053c8
Child:
14:672baf3cf941
Commit message:
The code is working and I tuned the timings to try to be pretty good on the M3.

Changed in this revision

PololuLedStrip.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/PololuLedStrip.cpp	Fri Mar 01 04:34:54 2013 +0000
+++ b/PololuLedStrip.cpp	Fri Mar 01 04:46:25 2013 +0000
@@ -4,7 +4,7 @@
 
 uint8_t led_strip_write_delays[3];
 
-static const uint8_t delay_fudges[] = { 32, 0, 0 };
+static const uint8_t delay_fudges[] = { 23, 28, 23 };
 
 void PololuLedStrip::calculateDelays()
 {
@@ -12,7 +12,7 @@
     int f_mhz = SystemCoreClock / 1000000;
     
     // Arrange for a 700 nanosecond delay between the rise time and the fall time for a 0 bit.
-    led_strip_write_delays[0] = 700*f_mhz/1000 - 32;
+    led_strip_write_delays[0] = 700*f_mhz/1000;
     
     // Arrange for a 600 nanosecond delay between the fall time for a 0 bit and the fall time for a 1 bit.
     // This means the pulses representing a 1 will be 700+600 = 1300 nanoseconds.