Mini OS emulator for Digispark.
The sketch allows you to log in to Digispark, execute several commands, and then log out. It works on the default Digispark with micronucleus bootloader installed, and uses the DigiCDC module to emulate USB communication, because Digispark itself does not have any additional USB chip and everything is done in the AtTiny85 software.
When powering the Digispark via the VIN pin, you can connect to it via USB at any time, and after performing the commands, disconnect the terminal and the device – Digispark will continue to execute the code taking into account to sent commands - as in the video:
Sketch was intended to take up as little space as possible – instead of strings I used character arrays, instead of pinMode/digitalWrite registers and bit operations, thanks to which it was possible to push so many functions on such a small device. All three components together occupy almost 100% of Digispark’s memory, but to increase the amount of available space for your own code, it is enough to remove the reference to unnecessary functions (e.g. temp, uptime, vcc). These references are marked in a special code block – after deleting them, more than 30% of the memory will be available (excluding bootloader).
You can log in to Digispark under Windows with Putty (after installing Digistump drivers), to Linux with Minicom application and to Android with Serial USB Terminal.
Compilation of DigiOS sketch requires installation of an earlier version of Arduino IDE – 1.8.6, correct installation of Digispark in IDE and latest Micronucleus release.
DigiOS is licensed under GNU General Public License v3.0
For more information please visit my website: https://jm.iq.pl/digios