Giter Club home page Giter Club logo

runtiny's Introduction

RunTiny

Endless runner game developed for the AVR ATtiny10 microcontroller and a 128x32 monochrome OLED Display. The input is provided by a push-button so that the entire set-up requires just 3 components (besides power source).

The entire code is written in assembly to optimize the space and fit it into the 1kB flash memory. The entire firmware occupies 778 bytes of flash memory. It contains the game as well as handling the microcontroller I/O and display communication (through TWI).

RunTiny - ATtiny10 Game

Usage

The game mechanics is quite intuitive: use the button to jump the obstacles. When an obstacle hits the player the microcontroller goes into sleep mode. A new button press will awake the microcontroller and restart the game.

Power Source

Anything between 3.3V-4.5V will do. Tested with:

  • 1S 150mAh Lipo
  • CR2032 button battery.

Wiring

The ATtiny10 has 3 usable I/O (PB3 is the reset) and are all used as follows:

  • PB0: SDA
  • PB1: SCL
  • PB2: Push-button (INT0)

This schematic shows the circuit connections:

Firmware Build

If you use PlatformIO you can follow this guide. It shows how to set-up the ATtiny10 environment. After that, it's very easy to compile and upload the firmware on the chip. As an alternative, it can be compiled using avr-gcc directly.

Firmware Upload

If you just want to upload the firmware, you can do so using avrdude and USBASP.

Be sure the USBASP jumper is set on 5V and the firmware is up to date (the firmware loaded on most devices sold doesn't support TPI required for the ATTiny10). You can use these instructions to update the USBASP firmware.

Use this command (mind the paths of avrdude and its config file):

./avrdude -e -v -p attiny10 -C ./avrdude.conf -c usbasp -U flash:w:firmware.hex:i -P usb

ATtiny85 and more

The game should work on other AVR devices (i.e. ATtiny85) with minor changes (not tested yet though).

runtiny's People

Contributors

ridoluc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.