New Graphics library for the Attiny85 (bsd license)

Hello :slight_smile:

I wanted to publish here a first preview of my graphicslibary for the
Attiny85 and a small unfinished operating system.

Even if it is not directly usable on the Arduboy a Port should be trivial and it might be of intrest to some of you.

The version should be seen primarily as a preview, I’m looking forward to constructive feedback and will incorporate it.

Basic features of the system:

Graphics libary for the Attiny85/45,

display of layers, a console, sprites and an algorithmic layer.

Multitasking operating system with compressed virtual ram, and swap to flash.
unfinished networkstack over infrared, I grilled my IR-diode and
and still waiting for a new one, the code is not really tested at this point.
probably the network is not usable at this point because of the port configuration
which is probably still in conflict with the USI for the I2C. Code for receiving
network packets still has to be integrated, but allready works on my arduino.

In all example programs the operating system is mostly
switched off, so this release should be seen primarily as a graphics library. The multitasking and swapping of the operating system is tested and should work well.

I will fix the network as soon as my new diodes and TSOPs arrive.

There are 15 demo programs included in the libary that demonstrate the functionalities.

Here is a Youtube video of the graphic demos, the source code is linked in the text of the youtube videos
(or get it here: Meine Grafiklibary für den Attiny85/SSD1306 und ein kleines Betriebssystem - Mikrocontroller.net )

description of the demos:

#1 Diagram

In this demostration we draw 2 layers one layer is calculated, the diagram, another layer is blended over it, these layers each have brightness values from 0 to 63 are added together and then converted with error diffusion dithering to black and white

#2 Alien

This example shows subtractive blending, and text rendering, 3 layers are drawn, a text layer, above it a calculated layer with a graphic effect, and an image layer, the image layer is subtracted from the layer below it.

#3 Flexgrid
In the Flexgrid example, custom fonts are shown, 6 characters are added to the system font and with their help an animation is drawn on the console layer, on top of it there is a graphic layer

#4 Will it Bend
The “Will it Bend” example shows a classic graphics effect, a bending cuboid is drawn using the calculation plane alone.

#5 Oszilloskop
The “Oscilloscope” example shows the creation of user interfaces. A simulated oscilloscope with a mouse pointer is displayed. A text layer is output below it.

#6 Alleycat
“Alleycat” demonstrates the use of consoles and animations by switching layers. It is a “Hello World” example.

#7 Plasmastern
“Plasma star” shows fading effects and a calculated plasma graphic effect.

#8 Spaceship
“Spaceship” demonstrates additive blending and noise through random numbers.
#9 Wobble
“Wobble” shows the manipulation of layers on-the-fly. During decoding of the layer, a sine wave is superimposed over its vertical position.

#10 Origin
“Origin” is a classic Copper effect. A graphic is output and manipulated column by column. This results in a fullscreen animation. In addition, a text layer is displayed.

#11 Face Value
“Face Value” shows a line-by-line graphic effect.

#12 Boing Ball
“Boing Ball” demonstrates the shifting of layers and the use of color keying.

#13 3D Engine
The “3D Engine” shows a rotating cube. Primarily the drawing of lines is demonstrated.

#14 Crossfade
“Crossfade” reads data directly from layers to implement a crossfade between two images.

#15 Raycaster
“Raycaster” is a port of a simple raycasting engine for the PC. An engine of this type was also used in the original “Wolfenstein 3D”.

Greetings :slight_smile:

5 Likes

Wow … I wish I had an ATTiny85 powered device now. I minimalist Wolf3D comes to mind!

That’s some awesome performance for a little chip. Too bad these chips are so hard to find. It’s easier to get a 32u4 than the cheaper attiny right now. I’ve been thinking about making a “extreme low cost” arduboy based on this chip really.

porting to the atmega should be simple, only the i2c code needs to be replaced.

Tynyjoypad console uses attiny85 as far as i know

Yeah I’ve seen that and a few other examples that make use of the chip in a game system. The thing is though the 32u4 is only costs 50 cents more (msrp) and gives so much more functionality so really the product is about a dollar more expensive to have more specs and USB connection.

2 Likes

i now support zooming, and soft scrolling on multiple consoles, C++ and the Arduino IDE, and moved to github
https://github.com/GoergPflug/AttinyStreamGfxApi

2 Likes

cool, you should works on gamebuino META library too to perfect and better use his power… :slight_smile: Great job on these else.

i have not build a meta library yet, right now everything is in the header files, so you can just include the headers with "#include “/path_to_the_lib/…”… i normaly don’t use the arduino much, i use microchip studio without the arduino libs. but i tried and managed to port it to the wire library, performance is not as good as on the attiny with my own I2C driver, but it is “ok” and should now be working on all arduinos supported by wire… i need to look into it how to get that as fast as on the attiny85.

1 Like