Close

End of the day report (Not daily I think.)

A project log for Keypad console

A two Arduino project that I hope to make into a gaming device.

inferno4youinferno4you 05/03/2020 at 02:210 Comments

I'm currently writing a java project that will be able to help those that would want to make their own sprites for this project. 



I have had a lot of issues with the library the last day, but most of them were from me not knowing C or C++ mainly since I work with java. Yet the library is "stable", but I would want to change and add more features before I can say that progress had been made. I do plan to do documentation on the library, but for now I may include a few comments on what does what. Now if you want to test this yourself all you need to do is include the GameGraphics folder from this project,GitHub repository located here, to the Arduino Library's folder. Depending on what display you use You may want to change the TFT_ILI9163C settings to match you display size. 

I am thinking of possibly adding more "modules" to the project so that the "console" can have more features such as storage, networking, and external display support. Hoping to upload concept sketches soon for this idea.

I do have an example sketch for the library (code below). It maybe outdated the next time I do a log thought. 

#include <Adafruit_GFX.h>

#include <SPI.h>

#include <TFT_ILI9163C.h>
#include <Display.h>
#include <Colors.h>
#include <Sprite.h>

#define __DC 9
#define __CS 10

TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC);
Display display = Display(&tft);

int x_0 = 128/2, x = 0, oldX= 0, y_0 = 128/2, y = 0, oldY = 0, R = 30;
double t = 0;


bool dirX = true, dirY = true;

void setup(){
    display.begin();
    display.getDisplay()->clearScreen();
}

void Display::draw(){
    getDisplay()->fillRect(oldX, oldY, 10, 10, BLACK);
    getDisplay()->fillRect(x, y, 10, 10, RED);
    oldX = x; oldY = y;
}

void gameUpdate(){
    x = R*cos(t) + x_0;
    y = R*sin(t) + y_0;
    
    (!(t < 2*PI)) ? t = 0 : t += 0.01;
}

void loop(){
    if ((millis() % 100) == 0){
        display.draw();
    }
    if ((millis() % 200) == 0){
        gameUpdate();
    }
}

TL;DR

Many changes are happening. Hope you stick around to see them as they come.

Discussions