jasonwebb / openSipPuff

Simple, low-cost "sip and puff" USB interface for expressive interactions, enabling breath-based control of keypresses, mouse actions and much more using USB HID.
11 stars 4 forks source link

Implement an OOP-based approach for the firmware #3

Open jasonwebb opened 8 years ago

jasonwebb commented 8 years ago

In order to properly represent and work with sensor data, I want to implement an OOP-based approach that transforms raw data into events (custom objects) that can be passed around and manipulated in useful ways. In particular I'm thinking about making custom objects for input data (and collections of input data) as well as for output behaviors like keypresses, mouse clicks and combinations of multiple behaviors.

This will also have the additional benefit of making the firmware in general more modular, easier to read (with proper documentation) and easier to build upon. For example, by abstracting all of the configuration storage and retrieval functionality into a custom class it becomes much simpler to use and easier to upgrade. If we want to switch to an external flash chip, just change the implementation details of the public functions and none of the rest of the firmware needs to be changed.