1717
1818#include <pybricks/common.h>
1919#include <pybricks/hubs.h>
20+ #include <pybricks/parameters.h>
2021
2122typedef struct _hubs_VirtualHub_obj_t {
2223 mp_obj_base_t base ;
2324 mp_obj_t battery ;
2425 mp_obj_t buttons ;
2526 mp_obj_t light ;
27+ mp_obj_t screen ;
2628 mp_obj_t system ;
2729} hubs_VirtualHub_obj_t ;
2830
@@ -32,6 +34,7 @@ static mp_obj_t hubs_VirtualHub_make_new(const mp_obj_type_t *type, size_t n_arg
3234 self -> buttons = pb_type_Keypad_obj_new (MP_OBJ_FROM_PTR (self ), pb_type_button_pressed_hub_single_button );
3335 // FIXME: Implement lights.
3436 // self->light = common_ColorLight_internal_obj_new(pbsys_status_light_main);
37+ self -> screen = pb_type_Image_display_obj_new ();
3538 self -> system = MP_OBJ_FROM_PTR (& pb_type_System );
3639 return MP_OBJ_FROM_PTR (self );
3740}
@@ -40,6 +43,7 @@ static const pb_attr_dict_entry_t hubs_VirtualHub_attr_dict[] = {
4043 PB_DEFINE_CONST_ATTR_RO (MP_QSTR_battery , hubs_VirtualHub_obj_t , battery ),
4144 PB_DEFINE_CONST_ATTR_RO (MP_QSTR_buttons , hubs_VirtualHub_obj_t , buttons ),
4245 // PB_DEFINE_CONST_ATTR_RO(MP_QSTR_light, hubs_VirtualHub_obj_t, light),
46+ PB_DEFINE_CONST_ATTR_RO (MP_QSTR_screen , hubs_VirtualHub_obj_t , screen ),
4347 PB_DEFINE_CONST_ATTR_RO (MP_QSTR_system , hubs_VirtualHub_obj_t , system ),
4448 PB_ATTR_DICT_SENTINEL
4549};
0 commit comments