...
 
Commits (4)
![](papyr-arduino.jpg)
Papyr can be used with [Arduino](http://arduino.cc/)! this section contains how to use arduino IDE for development on papyr. The Arduino core is
based on Adafruit's [nRF52 core](https://github.com/adafruit/Adafruit_nRF52_Arduino),
which is forked from [Sandeep Mistry's](https://github.com/sandeepmistry/arduino-nRF5)
......
For e-paper, [GxEPD2](https://github.com/ZinggJM/GxEPD2) and [Adafruit-GFX](https://github.com/adafruit/Adafruit-GFX-Library) libraries are used, so make sure to install these before compiling the code.
\ No newline at end of file
......@@ -53,7 +53,7 @@ void setup()
drawBitmaps3c200x200();
delay(1000);
showBox(16, 16, 48, 32);
drawGeometries();
delay(1000);
Serial1.println("setup done");
......@@ -68,7 +68,7 @@ const char HelloWorld[] = "Hello World!";
void helloWorld()
{
//Serial1.println("helloWorld");
display.setRotation(1);
display.setRotation(3);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_BLACK);
int16_t tbx, tby; uint16_t tbw, tbh;
......@@ -88,25 +88,34 @@ void helloWorld()
//Serial1.println("helloWorld done");
}
void showBox(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
void drawGeometries()
{
//Serial1.println("showBox");
display.setRotation(1);
//Serial1.println("drawGeometries");
display.setRotation(3);
display.setFullWindow();
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.fillRect(x, y, w, h, GxEPD_BLACK);
display.fillRect(20, 10, 60, 50, GxEPD_BLACK);
display.fillCircle(100, 100, 30, GxEPD_RED);
display.fillTriangle(115, 65, 150, 5, 185, 65, GxEPD_RED);
display.fillTriangle(120, 60, 150, 20, 180, 60, GxEPD_WHITE);
display.drawRoundRect(10, 130, 50, 50, 10, GxEPD_RED);
display.drawRoundRect(13, 133, 44, 44, 10, GxEPD_BLACK);
display.drawLine(190, 130, 120, 170, GxEPD_RED);
display.drawLine(190, 131, 120, 171, GxEPD_RED);
display.drawLine(190, 132, 120, 172, GxEPD_RED);
display.drawLine(190, 133, 120, 173, GxEPD_RED);
}
while (display.nextPage());
//Serial1.println("showBox done");
//Serial1.println("drawGeometries");
}
void showFont(const char name[], const GFXfont* f)
{
display.setFullWindow();
display.setRotation(0);
display.setRotation(3);
display.setTextColor(GxEPD_BLACK);
display.firstPage();
do
......@@ -118,7 +127,6 @@ void showFont(const char name[], const GFXfont* f)
void drawFont(const char name[], const GFXfont* f)
{
//display.setRotation(0);
display.fillScreen(GxEPD_WHITE);
display.setTextColor(GxEPD_BLACK);
display.setFont(f);
......