Skip to content

Commit

Permalink
add code to run chassis leds
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienMorey committed Nov 20, 2023
1 parent 9c859c7 commit 11082f1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions wsce_display_bot.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "pitcher.hpp"
#include "shooter.hpp"
#include "robot_defs.hpp"
#include "leds.hpp"

typedef enum
{
Expand All @@ -15,9 +16,10 @@ Servo shooter_flywheel;
Servo intake_motor;
Servo pitcher_motor;

Intake *intake; //{intake_motor};
Shooter *shooter; //{shooter_flywheel};
Pitcher *pitcher; //{pitcher_motor};
Intake *intake; //{intake_motor};
Shooter *shooter; //{shooter_flywheel};
Pitcher *pitcher; //{pitcher_motor};
AddressableLeds *leds;

unsigned long last_state_transition_time;
unsigned long last_tick_time;
Expand All @@ -30,6 +32,7 @@ void intake_callback()
pitcher->lower();

intake->spin();
leds->send_forward();
}

void shooter_callback()
Expand All @@ -38,6 +41,7 @@ void shooter_callback()
intake->stop();

shooter->shoot();
leds->send_backward();
}

void pitcher_callback()
Expand All @@ -46,6 +50,7 @@ void pitcher_callback()
shooter->stop();

pitcher->raise();
leds->stop();
}

void setup()
Expand All @@ -58,6 +63,8 @@ void setup()
intake = new Intake(intake_motor);
shooter = new Shooter(shooter_flywheel);
pitcher = new Pitcher(pitcher_motor);
leds = new AddressableLeds(CHASSIS_LEDS_PIN, CHASSIS_LEDS_LENGTH);
leds->set_frequency(5.0);
}

void loop()
Expand Down Expand Up @@ -109,6 +116,7 @@ void loop()
intake->tick();
shooter->tick();
pitcher->tick();
leds->tick();

last_tick_time = millis();
}
Expand Down

0 comments on commit 11082f1

Please sign in to comment.