@@ -64,17 +64,52 @@ void initialize() {
6464 // screen.selector.selector();
6565 pros::lcd::initialize ();
6666 pros::Task screen_task ([&]() {
67- while (true ) {
68- // print robot location to the brain screen
69- pros::lcd::print (0 , " X: %f" , chassis.getPose ().x ); // x
70- pros::lcd::print (1 , " Y: %f" , chassis.getPose ().y ); // y
71- pros::lcd::print (2 , " Theta: %f" , chassis.getPose ().theta ); // heading
72- // delay to save resources
73- pros::lcd::print (3 , " Rotation Sensor: %i" , lateral_sensor.get_position ());
74- pros::lcd::print (4 , " Rotation Sensor: %i" , horizontal_sensor.get_position ());
75- pros::delay (20 );
76- }
67+ while (true ) {
68+ // print robot location to the brain screen
69+ pros::lcd::print (0 , " X: %f" , chassis.getPose ().x ); // x
70+ pros::lcd::print (1 , " Y: %f" , chassis.getPose ().y ); // y
71+ pros::lcd::print (2 , " Theta: %f" , chassis.getPose ().theta ); // heading
72+ // delay to save resources
73+ pros::lcd::print (3 , " Lateral Sensor: %i" , lateral_sensor.get_position ());
74+ pros::lcd::print (4 , " Horizontal Sensor: %i" , horizontal_sensor.get_position ());
75+ pros::lcd::print (5 , " Lady Brown Sensor: %i" , LadyBrownRotation.get_position ());
76+ pros::lcd::print (6 , " Lady Brown Target: %i" , subsystem.ladybrown .get_target ());
77+
78+
79+ pros::delay (20 );
80+ }
7781 });
82+ // pros::Task screen_task([&]() {
83+ // lv_obj_t *chart = lv_chart_create(lv_scr_act());
84+ // lv_chart_set_type(chart, LV_CHART_TYPE_LINE);
85+ // lv_chart_set_point_count(chart, 460);
86+ // lv_obj_set_size(chart, 460, 220);
87+ // lv_obj_center(chart);
88+ // lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, -15250, -14750);
89+ // lv_chart_set_zoom_y(chart, 600);
90+ // lv_chart_set_zoom_x(chart, 1000);
91+ // lv_obj_set_style_size(chart, 0, LV_PART_INDICATOR);
92+ // lv_chart_series_t *s1 = lv_chart_add_series(chart, lv_color_white(), LV_CHART_AXIS_PRIMARY_Y);
93+ // lv_chart_series_t *s2 = lv_chart_add_series(chart, lv_color_hex(0xFFFF0000), LV_CHART_AXIS_SECONDARY_X);
94+
95+ // lv_obj_t * label = lv_label_create(lv_scr_act());
96+ // lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);
97+ // lv_obj_align(label, LV_ALIGN_TOP_MID, 0, 0);
98+ // lv_obj_set_style_text_font(label, &lv_font_montserrat_20, 0);
99+
100+ // while (true) {
101+ // lv_chart_set_next_value(chart, s1, subsystem.ladybrown.get_target());
102+ // lv_chart_set_next_value(chart, s2, LadyBrownRotation.get_position());
103+ // if (pros::millis() >= 5000) {
104+ // std::string angle = std::to_string(LadyBrownRotation.get_position());
105+ // lv_label_set_text(label, angle.c_str());
106+ // break;
107+ // }
108+ // pros::delay(10);
109+ // }
110+ // });
111+
112+ pros::rtos::Task Task (electronic.controllers .notify_motor_disconnect );
78113}
79114
80115/* *
@@ -111,18 +146,6 @@ void competition_initialize() {}
111146void autonomous () {
112147
113148 pros::lcd::initialize ();
114- // pros::Task screen_task([&]() {
115- // while (true) {
116- // // print robot location to the brain screen
117- // pros::lcd::print(0, "X: %f", chassis.getPose().x); // x
118- // pros::lcd::print(1, "Y: %f", chassis.getPose().y); // y
119- // pros::lcd::print(2, "Theta: %f", chassis.getPose().theta); // heading
120- // // delay to save resources
121- // pros::lcd::print(3, "Rotation Sensor: %i", lateral_sensor.get_position());
122- // pros::lcd::print(4, "Rotation Sensor: %i", horizontal_sensor.get_position());
123- // pros::delay(20);
124- // }
125- // });
126149
127150 subsystem.autonomous .AutoDrive (subsystem.intake , subsystem.latch , electronic.distance_sensor );
128151}
@@ -146,7 +169,8 @@ void opcontrol() {
146169
147170 // Calls to event handling functions.
148171 if (controller.get_digital_new_press (pros::E_CONTROLLER_DIGITAL_DOWN)) {
149- autonomous ();
172+ // autonomous();
173+ subsystem.ladybrown .MoveToPoint (LadyBrown::ATTACK_STATE);
150174 }
151175 // Toggles the drivetrain orientation - can be forward or backward
152176 if (controller.get_digital_new_press (pros::E_CONTROLLER_DIGITAL_UP)) {
0 commit comments