 }
 
 void message_leftCb(const std_msgs::Bool& toggle_msg) {
-  if (toggle_msg.data) {
+  if (toggle_msg.data && digitalRead(3)) {
     digitalWrite(LEFT, HIGH);
   } else {
     digitalWrite(LEFT, LOW);


void loop()
{
  if (millis() > publisher_timer) {
    if (digitalRead(RIGHT)) {
      str_msg_right.data = "ON";

{
  pinMode(RIGHT, OUTPUT);
  pinMode(LEFT, OUTPUT);
  pinMode(3, INPUT_PULLUP);
  nh.getHardware()->setBaud(115200);
  nh.initNode();
  nh.subscribe(sub_right);
