/microbit_matrix_drips

Adventure in Python class creation for a neat display

Primary LanguagePython

Make an led screen like in The Matrix

Project Goal: Matrix drip screen

Create a display that is reminescent of the computer monitors in the movie "The Matrix". The microbit's leds allow for dimming, using this one can create a "drip" effect across the leds.

The goal of the project was to create one single "drip" as an object that can easily be used in future code. I tested the code using a while loop, works like a charm : ). Can certainly be improved upon to look more like what is seen in the matrix.

Personal Challenge: Use Class Structure

I have historically avoided classes in favor of function-oriented code, both because functional code was easier to understand and I failed to see the benefits of a class at the time. I now understand the value of classes and want to start using them frequently (when appropriate).

In terms of reusability, classes are awesome. Sure, you could copy and paste code or write neat wrapper functions to control the flow of your program, but when it comes time to implement your code in a new environment, you have to hunt through your code for relevant functions! And on top of that (at least if you're working in python), you need to be careful about where you place your functions within your new script.

With classes, everything is nicely bottled up, and if you write a class well you'll only need minimal(hopefully no) restructuring when you go to implement your class in a new script.

For more information on classes in python, see the docs https://docs.python.org/3/tutorial/classes.html