first commit

This commit is contained in:
Jérôme Delacotte
2025-03-06 11:15:32 +01:00
commit 7b30d6e298
5276 changed files with 2108927 additions and 0 deletions

69
ATMEGA_NOKIA/ATMEGA_NOKIA.ino Executable file
View File

@@ -0,0 +1,69 @@
#include <Adafruit_GFX.h>
#include <SPI.h>
#include "Adafruit_PCD8544.h"
//Define the pins you are connecting the LCD too.
//PCD8544(SCLK, DIN/MOSI, D/C, SCE/CS, RST);
PCD8544 nokia = PCD8544(3,4,5,7,6);
void setup(void)
{
nokia.init(); //Initialize lcd
// set display to normal mode
nokia.command(PCD8544_DISPLAYCONTROL | PCD8544_DISPLAYNORMAL);
nokia.clear(); //Clear the display
}
void loop(void)
{
// For all functions:
// x range is 0-84
// y range is 0-48
// color is BLACK or WHITE
int pause=2000;
// draw a single pixel
// nokia.setPixel(x, y, color);
nokia.setPixel(30, 30, BLACK);
nokia.display();
delay(pause);
nokia.clear();
// draw line
// nokia.drawline(x1,y1,x2,y2,color); draws a line from (x1,x2) to (y1,y2)
nokia.drawline(5,5,15,40,BLACK);
nokia.display();
delay(pause);
nokia.clear();
// draw rectangle
// nokia.drawrect(x1,y1,x2,y2,color);
//draws a rectange with top left @ (x1,x2) and bottom right @ (y1,y2)
nokia.drawrect(1,1,30,30,BLACK);
nokia.display();
delay(pause);
nokia.clear();
// draw filled rectangle
nokia.fillrect(10,10,20,20,BLACK);
nokia.display();
delay(pause);
nokia.clear();
// draw circle
// nokia.drawcircle(x,y,r,color);
// x,y position with a radius of r
nokia.drawcircle(30,20,5,BLACK);
nokia.display();
delay(pause);
nokia.clear();
// draw filled circle
nokia.fillcircle(10,10,5,BLACK);
nokia.display();
delay(pause);
nokia.clear();
}