Untitled

mail@pastecode.io avatar
unknown
plain_text
9 days ago
3.4 kB
5
Indexable
Never
// generated by mBlock5 for <your product>
// codes make you happy

#include "Mikrobotik_STEMinMe/Mikrobotik_RoboMission.h"

#include <Arduino.h>

Mikrobotik_RoboMission roboracer;

void _delay(float seconds) {
  long endTime = millis() + seconds * 1000;
  while(millis() < endTime);
}

void setup() {
  roboracer.Robot_Prepare();
  // DO SOMETHING
}

void _loop() {
  if(roboracer.Bluetooth_DataCheck()){
    if(roboracer.Bluetooth_DataControl("F")){
      roboracer.Tank_Turn("forward", 150, "forward", 150);

    }else{
      if(roboracer.Bluetooth_DataControl("B")){
        roboracer.Tank_Turn("backward", 125, "backward", 125);

      }else{
        if(roboracer.Bluetooth_DataControl("L")){
          roboracer.Tank_Turn("backward", 100, "forward", 100);

        }else{
          if(roboracer.Bluetooth_DataControl("R")){
            roboracer.Tank_Turn("forward", 100, "backward", 100);

          }else{
            if(roboracer.Bluetooth_DataControl("X")){
              roboracer.Stop();

            }else{
              if(roboracer.Bluetooth_DataControl("T")){
                tone(2, 131, 500);
                delay(500);

              }else{
                if(roboracer.Bluetooth_DataControl("S")){
                  tone(2, 330, 500);
                  delay(500);

                }else{
                  if(roboracer.Bluetooth_DataControl("E")){
                    roboracer.Tank_Turn("forward", 100, "forward", 60);

                  }else{
                    if(roboracer.Bluetooth_DataControl("Q")){
                      roboracer.Tank_Turn("forward", 60, "forward", 100);

                    }else{
                      if(roboracer.Bluetooth_DataControl("C")){
                        roboracer.Tank_Turn("backward", 100, "backward", 75);

                      }else{
                        if(roboracer.Bluetooth_DataControl("Z")){
                          roboracer.Tank_Turn("backward", 75, "backward", 100);

                        }else{
                          if(roboracer.Bluetooth_DataControl("1")){
                            roboracer.TurnON_LED("#1", "ON");

                          }else{
                            if(roboracer.Bluetooth_DataControl("2")){
                              roboracer.TurnON_LED("#1", "ON");

                            }else{
                              if(roboracer.Bluetooth_DataControl("3")){
                                roboracer.TurnON_LED("#2", "ON");

                              }else{
                                if(roboracer.Bluetooth_DataControl("4")){
                                  roboracer.TurnON_LED("#2", "ON");

                                }else{
                                  if(roboracer.Bluetooth_DataControl("5")){
                                    tone(2, 220, 1000);
                                    delay(1000);

                                  }

                                }

                              }

                            }

                          }

                        }

                      }

                    }

                  }

                }

              }

            }

          }

        }

      }

    }

  }

}

void loop() {
  _loop();
}
Leave a Comment