Skip to content

Commit

Permalink
Merge pull request #45 from bearbotics2358/LED_Fix_The_Squeakquel
Browse files Browse the repository at this point in the history
LED issue involving the WHITE command has been fixed
  • Loading branch information
44RAV authored Mar 30, 2024
2 parents 1cfa301 + 48f678c commit 44ba9f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/main/cpp/LED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ LED::LED()
void LED::Init()
{
int i;
LED_prevCommand = LED_currentCommand = RIO_msgs_enum::MSG_IDLE;
LED_currentCommand = RIO_msgs_enum::MSG_IDLE;
LED_prevCommand = RIO_msgs_enum::WHITE;

/*
sport = new SerialPort(baud);
Expand Down Expand Up @@ -186,7 +187,7 @@ void LED::SetMSGIdle(){

void LED::SendIdleMSG() {
char cmd[10];
strncpy(cmd, "(1,0)\r\n", 8);
strncpy(cmd, "1,0\r\n", 8);
m_pserial->Write(cmd, strlen(cmd));
m_pserial->Flush();

Expand All @@ -203,7 +204,7 @@ void LED::SendNoCommsMSG() {

printf("in SetNoComms\n");
char cmd[10];
strncpy(cmd, "(2,0)\r\n", 8);
strncpy(cmd, "2,0\r\n", 8);
printf("about to Write: %s\n", cmd);
ret = m_pserial->Write(cmd, strlen(cmd));
printf("written: %d characters\n", ret);
Expand All @@ -222,7 +223,7 @@ LED_currentCommand = RIO_msgs_enum::NOTE_ON_BOARD;

void LED::SendNoteOnBoardMSG() {
char cmd[10];
strncpy(cmd, "(3,0)\r\n", 8);
strncpy(cmd, "3,0\r\n", 8);
m_pserial->Write(cmd, strlen(cmd));
m_pserial->Flush();

Expand Down Expand Up @@ -253,7 +254,7 @@ LED_currentCommand = RIO_msgs_enum::SHOOTER_READY;

void LED::SendShooterReadyMSG() {
char cmd[10];
strncpy(cmd, "(5,0)\r\n", 8);
strncpy(cmd, "5,0\r\n", 8);
m_pserial->Write(cmd, strlen(cmd));
m_pserial->Flush();

Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void Robot::RobotPeriodic() {

a_Gyro.Update();

//a_LED.Update();
a_LED.Update();


a_SwerveDrive.updateOdometry();
Expand Down

0 comments on commit 44ba9f3

Please sign in to comment.