Go Down

Topic: Simple circle on Nokia LCD (Read 867 times) previous topic - next topic

bporter88

Hi all,

Could anyone help me. I want to know the simplest way to display a black circle on a nokia 5110 lcd screen using the adafruit GFX library. Can you call it using a simple ellipse function? I'm just not entirely whats in the library to call.

Cheers,

Ben

gnusci

Enjoy

Code: [Select]
// Sketch to draw circles in the Nokia 5110 LCD
// http://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives

#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>

Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);

void setup()   {
  //Serial.begin(9600);
  display.begin();
  display.setContrast(60);
  delay(2000);
  // clears the screen and buffer
  display.clearDisplay();   
}

void loop() {
  // draw circles with center pooint at the center of the screen
  // upto "display.height()" pixel radius
  for (int16_t i=0; i<display.height(); i+=2) {
    display.drawCircle(display.width()/2, display.height()/2, i, BLACK);
    display.display();
    delay(100);
    display.clearDisplay();
  }
}


--

gnusci

Go Up