EA DOGM128 Driver  0.1
Driver code for the EA DOGM128
 All Files Functions Typedefs Enumerations Groups Pages
Functions
Arcs and Circles

Functions

void dog_draw_arc (uint8_t x_center, uint8_t y_center, uint8_t radius, uint8_t start_angle, uint8_t end_angle, uint8_t size, char mode)
 

Detailed Description

This file contains the prototype for the dog_draw_arc() function, which is used to set or clear an arc or unfilled circle.

Function Documentation

void dog_draw_arc ( uint8_t  x_center,
uint8_t  y_center,
uint8_t  radius,
uint8_t  start_angle,
uint8_t  end_angle,
uint8_t  size,
char  mode 
)

This function is used set or clear an arc or unfilled circle of thickness 0 or 1. If both the start and end angle are the same number, then a circle is drawn.

Parameters
  • x_center = X coordinate of the arc or circle's center.
  • y_center = Y coordinate of the arc or circle's center.
  • radius = Radius of the arc or circle

    Start and end angle are not represented in degrees nor radians. To convert from degrees to LCD_angles, use the following formula:
    LCD_angle = angle_degrees * (32/45)
    So:
    90 degrees = 64,
    180 degrees = 128,
    270 degrees = 192,
    360 degrees = 256 (due to 8-bit overflow, this is also zero) .

  • start_angle = The start angle of the arc or circle
  • end_angle = The end angle of the arc or circle


  • size = The thickness of the point to place (0 or 1)
  • mode = 's' for set, 'c' for clear
Algorithm
This function essentially draws lines between two computed coordinates through multiple iterations as it makes its way around the circle or arc.
  • First computes the difference between provided angles
  • The computes the number of required iterations.
  • Then it computes X and Y coordinates for each iteration, drawing a line between them with the dog_draw_line() function.
Assumptions
  • None