This project uses two Arduino Nanos. One to handle the matrix keypad and the other to control the 1.8" spi tft display. The two Arduinos communicate over i2c.
Currently working on schematics of the device for others to wire up.
Future plans are to make a game engine for this device to use. The device has an i2c output to hook up more devices.
The problem below has be fixed for a more than a few days. I realized that the default settings did not match the screen size that I had. - 5/3/2020
Problems currently faced by the device is the 1.8" tft display which has an area of noise. The lower half does not update correct.
Components
2×
Arduino Nano
The microcontollers used in the project.
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;
voidsetup(){
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;
}
voidgameUpdate(){
x = R*cos(t) + x_0;
y = R*sin(t) + y_0;
(!(t < 2*PI)) ? t = 0 : t += 0.01;
}
voidloop(){
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.
Not sure if it's clear, but there is a "sprite" near the keypad indicator on the display the screen is rendering much smoother than before after setting up the settings for the TFT_ILI9163C Library. In my current design the screen needs a manual reset by jumping the RES pin to ground easy to do with the usb connector casing or some wire.
No worries! It looks like it is software. You are using D8,D9,D10 ect. You can find the Hardware SPI connection between VIN and TX1. Its faster and saves I/O pins.
Nice to see i2c communication between those nanos. Have you used the hardware or software SPI for tft? (hardware spi is way faster !). Got some similar device, but with 126x64 oled and 4 by 4 neopixel array (will post soon here), but i have no idea what to do with it...
No worries! It looks like it is software. You are using D8,D9,D10 ect. You can find the Hardware SPI connection between VIN and TX1. Its faster and saves I/O pins.