How to stop all codes in MBot - mBot - Makeblock Forum


#1

// generated by mBlock5 for mBot
// codes make you happy

#include <MeMCore.h>
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

float Speed = 0;
float Distance = 0;
float True = 0;
float Mission = 0;
float NoStop = 0;

MeBuzzer buzzer;

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

void setup() {
pinMode(A7, INPUT);
NoStop = “True”;
Mission = 0;
while(!(NoStop == “False”))
{
_loop();
if((0 ^ (analogRead(A7) > 10 ? 0 : 1))){
Mission += 1;

}
if(Mission == 1.000000){
    buzzer.tone(65, 0.25 * 1000);
    delay(20);
    Mission += 1;

}
if(Mission == 3.000000){
    buzzer.tone(65, 0.25 * 1000);
    delay(20);
    Mission += 1;

}
if(Mission == 4.000000){
    Mission += 1;

}

}

}

void _loop() {
}

void loop() {
_loop();
}


#2

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.