Giter Site home page Giter Site logo

ketrab2004-arduino / stars_screensaver Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 454 KB

test to see how quickly i can draw and hide single pixel stars that move around

C++ 80.34% C 19.66%
arduino arduino-mega arduino-mega-2560 mega mega2560 tft tft-display screensaver star

stars_screensaver's Introduction

Stars Screensaver

A slightly blurry image of the star screensaver on an Arduino MEGA 2560, with a fps counter in the top left, but the screen is rotated 90 degrees counter-clockwise in the photo. (old photo with a lesser fps rate than with the sin lookup table)

Parts:

Setup:

  1. Attach the TFT to the top of the arduino
  2. Change your settings in settings.h
    • DEBUG: if you would like to compile debug Serial.prints
    • TFT_CS, TFT_DC & TFT_BL: if you use different ports for your lcd
    • TFT_BRIGHTNESS: 0-255 for the backlight strength
    • STAR_COUNT: if you would like more or less stars (32 stars gives a nice 52-58fps on my Arduino MEGA 2560)
    • STAR_MIN_SPEED & STAR_MAX_SPEED: for changing the speed of the stars in pixels per second (stars at the center travel at MIN speed and stars near the edge of the screen will travel at MAX speed)
    • SHOW_FPS: if you would like to see the fps count
    • FPS_UPDATE_INTERVAL: how many milliseconds should pass between updating the fps counter (to improve performance)
    • SHOW_MINMAX_FPS: if you would like to clearly see the min and max fps got (only takes effect if SHOW_FPS is 1)
  3. Upload the sketch
  4. See the stars fly by
  5. (don't keep it running for too long, since my Arduino starts to get warm)

stars_screensaver's People

Contributors

ketrab2004 avatar

Stargazers

 avatar

stars_screensaver's Issues

Stuck stars

Sometimes stars get stuck on the screen

They aren't actually stuck because if i add this

if (pos == nextPos) {
    debugVar("pos: ", pos);
}

into Star::doStep() nothing actually prints.

It must be a star that doesn't get properly undrawn somehow...

(also if another star goes to the same position, it does get undrawn properly)

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.