proton

Firmware for Ghostbusters proton pack
git clone https://git.woozle.org/neale/proton.git

commit
2424f3e
parent
059eda4
author
Neale Pickett
date
2016-09-27 21:21:53 -0600 MDT
Make it brighter, also stop trying to do clever (and broken) anti-aliasing
1 files changed,  +6, -9
M Synchrotron.cpp
+6, -9
 1@@ -2,6 +2,7 @@
 2 #include <Adafruit_NeoPixel.h>
 3 #include "Synchrotron.h"
 4 
 5+#define width 6
 6 #define brightness 255
 7 
 8 Synchrotron::Synchrotron(uint16_t n, uint8_t p, neoPixelType t)
 9@@ -37,18 +38,14 @@ Synchrotron::discharge() {
10 }
11 
12 Synchrotron::tick(unsigned long jiffies) {
13-  byte raa = r * ticks / tickrate;
14-  byte gaa = g * ticks / tickrate;
15-  byte baa = b * ticks / tickrate;
16-  byte ra = r - raa;
17-  byte ga = g - gaa;
18-  byte ba = b - baa;
19-
20   pxl->clear();
21-  pxl->setPixelColor((cur + 1) % npixels, pxl->Color(raa, gaa, baa));
22+  for (int i = 0; i < width; i += 1) {
23+    pxl->setPixelColor((cur + i) % npixels, pxl->Color(r, g, b));
24+  }
25   for (int i = 0; i < 4; i += 1) {
26     int div = 1 << (2*i);
27-    pxl->setPixelColor((cur + npixels - i) % npixels, pxl->Color(ra/div, ga/div, ba/div));
28+    pxl->setPixelColor((cur + npixels - i) % npixels, pxl->Color(r/div, g/div, b/div));
29+    pxl->setPixelColor((cur + npixels + width + i) % npixels, pxl->Color(r/div, g/div, b/div));
30   }
31 
32   pxl->show();