Larson scanner shade software enhancements with Tony D! @adafruit #LIVE
Live stream to http://twitch.tv/adafruit showing enhancements to the Larson scanner shade project. See below for important bug fix!
Bug fix from code in the stream:
- You might have noticed some issues with the computation of the dark pixel color during the stream. After a bit of debugging it turns out the problem is with bit shifting an 8 bit value 16 positions--the upper red component (and green component too) were actually getting wiped out because they were shifted too many positions and turned into zeros. This is a very subtle and easy to make mistake. The correct dark color computation should look like this:
uint32_t dark = ((uint32_t)dark_r // 16) | ((uint32_t)dark_g // 8) | dark_b;
(NOTE: Replace // with 'less than symbol, less than symbol' (i.e. bitshift left operator). Curiously YouTube does not allow less than symbols/brackets in descriptions! See the link to the full code below for the exact line/fix.)
Notice how each of the shifted components are cast to a 32 bit value first so they can be shifted more than 8 positions, then it's all reassembled into a single value.
See the full code for this sketch (including the above fix) here: https://gist.github.com/tdicola/dc05a71e75a53e6b2bdd8276e3396cf0
Links mentioned in the video:
- Pt. 1 Larson shade build: https://www.youtube.com/watch?v=SKawJj9qcjY
- Larson scanner shades guide: https://learn.adafruit.com/larson-scanner-shades/software
Acknowledgements:
- Music: bartlebeats
- Intro shuttle footage: NASA
- Intro fonts: Typodermic
- Intro inspiration: Mr. Wizards's World
- Matrix background: cool-retro-term & cmatrix
-----------------------------------------
Visit the Adafruit shop online - http://www.adafruit.com
Subscribe to Adafruit on YouTube: http://adafru.it/subscribe
Join our weekly Show & Tell on G+ Hangouts On Air: http://adafru.it/showtell
Watch our latest project videos: http://adafru.it/latest
New tutorials on the Adafruit Learning System: http://learn.adafruit.com/
Music by bartlebeats: http://soundcloud.com/bartlebeats
-----------------------------------------