API Reference

adafruit_display_analogclock

Draw a traditional 12-hour analog clock face with hour and minute hands. Allows you to provide graphics to customize the clock.

  • Author(s): Tim C

Implementation Notes

Hardware:

Any CircuitPython device with displayio support

Software and Dependencies:

class adafruit_display_analogclock.AnalogClock(hour_hand_file, minute_hand_file, center_xy, number_label_radius, number_label_scale=1, number_label_color=0x000000, hand_transparency_index=0, background_color=None, background_size=None, background_img_file=None, background_img_anchor_point=None, background_img_anchored_position=None, scale=1, x=0, y=0)
Parameters:
  • scale (int) – Scale of layer pixels in one dimension.

  • x (int) – Initial x position within the parent.

  • y (int) – Initial y position within the parent.

static points_around_circle(circle_x, circle_y, r, point_count)

Return a list containing x,y points around a circle with the given parameters.

Parameters:
  • circle_x – Center x coordinate

  • circle_y – Center y coordinate

  • r – Radius of the circle

  • point_count – How many points

Return List:

A list containing (x,y) points around the circle

set_time(hour, minute)

Set the hour and minute hands to the appropriate angles based on the given time.

Parameters:
  • hour – The hour to set 0-23

  • minute – The minute to set 0-59

Returns:

None