Joystick and LCD Flashcards
What is the resolution of the LCD?
84x48
How is the LCD controlled?
Using an SPI interface
What are the 4 wires for SPI?
> SCLK
MOSI
MISO
SS (CSE)
How does the microcontroller control the screen?
It has a screen buffer. This is a 84x48 char array which maps directly to each pixel.
When refresh is sent it transfers the entire buffer over to the screen
What is required to set up the screen?
N5110 lcd;
lcd. init();
lcd. setContrast(0.4);
What is the print string command for the LCD?
lcd.printString(“string”,0,0);
How do you change a pixel to black or white?
lcd. setPixel(2,5,false);
lcd. setPixel(2,5,true);
What is the command to check the status of a pixel?
lcd.getPixel(2,2);
What is the required setup for the joystick?
Joystick joystick(PTB11,PTB10); joystick.init();
What is the issue with getting just the x and y coordinates? How is this solved?
> When the joystick is in a corner, it will be faster because the magnitude of the vector is larger.
To solve this, we plot all points on a points inside a unit circle.