Pages: [1]   Go Down
Author Topic: Simple circle on Nokia LCD  (Read 575 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Edmonton, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Enjoy

Code:
// 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();
  }
}


Logged

--

gnusci

Pages: [1]   Go Up
Jump to: