News for hackers. Stuff that matters.
Re:EABitTricks.h by riskable on Monday December 19, 2022 @02:11PM (#34056246)
In embedded programming it can be useful to control an animation on an LED matrix since a lot of LED drivers and multiplexers enable pins based on the bits passed through their respective drivers. Example of how you might animate 8 LED connected to 8 pins:

    10000000
    01000000
    00100000
    00010000
    00001000
    00000100
    00000010
    00000001
You could turn that into an array to animate an LED going from left-to-right or you could just write a simple function that bit-shifts your current state to the right.

It's also useful in scrolling text: Imagine that 8x8 above contains a character like O. You could animate the O moving to the left by shifting the bits in each row to the left by one over and over again (according to whatever speed you've defined).

Re:EABitTricks.h by erksa on Monday December 19, 2022 @03:22PM (#34057139)
Thanks man, this was a very clear explanation!