GithubHelp home page GithubHelp logo

fartknox / 3d-on-an-atmega328p Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ttsiodras/3d-on-an-atmega328p

0.0 0.0 0.0 188 KB

Real-time 3D on an ATmega328p and an OLED https://www.youtube.com/watch?v=nsqmnkfZtSw

Makefile 4.08% Arduino 22.69% C 51.16% C++ 22.07%

3d-on-an-atmega328p's Introduction

My renderer is quite a "beast"; supporting many rendering modes. I've almost forgotten what it was like when I begun playing with 3D code, 2 decades ago...

...so it was time for a trip "down memory lane": I implemented the points-only mode on a "naked" ATmega328P sitting on a breadboard, and had it drive an OLED screen via SPI at the magnificent resolution of 128x64 :-)

This was fun :-)

Points of note:

  • Fixed point calculations, of course (8 bits for the fractional part)
  • I stored and read the statue data from the .text segment (Google PROGMEM). Even though the ATmega328P has 32KB of flash available to store the program code, it only has 2K of RAM. So I use the flash storing the code to also store the constant data of the XYZ point coordinates.
  • Bonus "distance LED": shines brightly when the statue gets close :-)
  • Conditionally outputs FPS info to serial port.
  • The code uses the U8G2 library to access the OLED; edit file myscreen.h to define the appropriate constructor for your own OLED.
  • I had to use SPI in two places: the ATmega328P drives the OLED via its SPI pins, but it is itself programmed via the SPI pins of the "big brother" siting on the right of the breadboard: a Raspberry PI2 I use to program the ATmega328P's flash via avrdude. And yes, the SPI pins are shared.

Thoroughly enjoyed playing with HW again :-)

3d-on-an-atmega328p's People

Contributors

ttsiodras 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.