|
|
@@ -165,6 +165,23 @@ STATIC mp_obj_t machine_lcd_rectangle(size_t n_args, const mp_obj_t *args) {
|
|
|
}
|
|
|
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_rectangle_obj, 5, 5, machine_lcd_rectangle);
|
|
|
|
|
|
+/// \method circle(x1, y1, r)
|
|
|
+///
|
|
|
+/// display a circle on the lcd, center(x1, y1) R = r.
|
|
|
+///
|
|
|
+STATIC mp_obj_t machine_lcd_circle(size_t n_args, const mp_obj_t *args) {
|
|
|
+ // extract arguments
|
|
|
+ machine_lcd_obj_t *self = MP_OBJ_TO_PTR(args[0]);
|
|
|
+
|
|
|
+ int x1 = mp_obj_get_int(args[1]);
|
|
|
+ int y1 = mp_obj_get_int(args[2]);
|
|
|
+ int r = mp_obj_get_int(args[3]);
|
|
|
+
|
|
|
+ lcd_draw_circle(x1, y1, r);
|
|
|
+ return mp_const_none;
|
|
|
+}
|
|
|
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_circle_obj, 4, 4, machine_lcd_circle);
|
|
|
+
|
|
|
STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = {
|
|
|
// instance methods
|
|
|
{ MP_ROM_QSTR(MP_QSTR_light), MP_ROM_PTR(&machine_lcd_light_obj) },
|
|
|
@@ -173,7 +190,7 @@ STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = {
|
|
|
{ MP_ROM_QSTR(MP_QSTR_text), MP_ROM_PTR(&machine_lcd_text_obj) },
|
|
|
{ MP_ROM_QSTR(MP_QSTR_line), MP_ROM_PTR(&machine_lcd_line_obj) },
|
|
|
{ MP_ROM_QSTR(MP_QSTR_rectangle), MP_ROM_PTR(&machine_lcd_rectangle_obj) },
|
|
|
-// { MP_ROM_QSTR(MP_QSTR_circle), MP_ROM_PTR(&machine_lcd_circle_obj) },
|
|
|
+ { MP_ROM_QSTR(MP_QSTR_circle), MP_ROM_PTR(&machine_lcd_circle_obj) },
|
|
|
// color
|
|
|
{ MP_ROM_QSTR(MP_QSTR_WHITE), MP_ROM_INT(WHITE) },
|
|
|
{ MP_ROM_QSTR(MP_QSTR_BLACK), MP_ROM_INT(BLACK) },
|