-
Couldn't load subscription status.
- Fork 20
MBot
This is the guide for mbot and connecting it to remo.tv
Please note, I am not responsible for any technical errors during this process, and may not be able to provide support. You can still contact me on the remo.tv discord at: @sticks#0001
What you need:
- A camera
- The mbot kit and the mcore bord
- Speaker
- raspberry pi 3+ or 4
- internet
- Battery pack
Now what you want to do, is follow the instructions to put together the bot, linked here.
After that's done, find a place for the pi, camera, speaker, mbot core board, and a battery pack
A wiring diagram is below for battery:
- Battery -> Bot: Connected to Cam
- Battery -> Bot: Connected to Speaker
- Battery -> Bot: Connected to mbot board (not USB, 4 AA bats)
The wiring diagram is below for connections to pi and mcore board:
- pi -> Cam: Connected to Cam over USB
- pi -> Speaker: Connected to Speaker over AUX
- pi -> mcore board: Connected to mcore over USB serial
The robot type must be serial_board.
The following code must be flashed to the board with the mbot software.
// RemoTV Controller for mbot
// Code used: Dan's handler,mblock init things
// compiled and published by sticks
// helpers: H2020,Dan,Brooke
// ver 1.0.0-beta
//for firmware: latest
// start
// Created by mblock START
#include <MeMCore.h>
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
MeDCMotor motor_9(9);
MeDCMotor motor_10(10);
void move(int direction, int speed) {
int leftSpeed = 0;
int rightSpeed = 0;
if(direction == 1) {
leftSpeed = speed;
rightSpeed = speed;
} else if(direction == 2) {
leftSpeed = -speed;
rightSpeed = -speed;
} else if(direction == 3) {
leftSpeed = -speed;
rightSpeed = speed;
} else if(direction == 4) {
leftSpeed = speed;
rightSpeed = -speed;
}
motor_9.run((9) == M1 ? -(leftSpeed) : (leftSpeed));
motor_10.run((10) == M1 ? -(rightSpeed) : (rightSpeed));
}
//delay code (some wired thing)
//void _delay(float seconds) {
// long endTime = millis() + seconds * 1000;
// while(millis() < endTime) _loop();
//}
// this is motor moves 1,f 2,b 3,r 4,l
// num = sec delay, so code before _delay 1 is forward
// move(1, 50 / 100.0 * 255);
// _delay(1);
// move(1, 0);
// move(2, 50 / 100.0 * 255);
// _delay(2);
// move(2, 0);
// move(4, 50 / 100.0 * 255);
// _delay(3);
// move(4, 0);
// move(3, 50 / 100.0 * 255);
// _delay(4);
// move(3, 0);
// created by mblock STOP
//custom code (by dan) START
String inData;
void STOP() {
motor_9.run(0);
motor_10.run(0);
}
void setup(){
Serial.begin(9600);
}
void loop()
{
while (Serial.available() > 0)
{
char recieved = Serial.read();
inData += recieved;
switch (recieved) {
case 'f':
move(1, 100 / 100.0 * 255);
delay(500);
STOP();
break;
case 'b':
move(1, 0);
move(2, 100 / 100.0 * 255);
delay(500);
STOP();
break;
case 'r':
move(4, 0);
move(4, 100 / 100.0 * 255);
delay(500);
STOP();
break;
case 'l':
move(2, 0);
move(3, 100 / 100.0 * 255);
delay(500);
STOP();
break;
default:
delay(1);
}
inData = "";
}
}
//custom code (by dan) END
//end
Thanks for reading!
© sticks#0001 on discord. Written by sticks. Formatted & Edited by Brooke
- Adafruit Motor Hat
- Adafruit PWM / Servo Hat
- Anki Cozmo on MacOS/Linux
- Anki Cozmo on Windows
- Cytron MDD10 10 Amp Motor Driver
- GoPiGo2
- GoPiGo3
- L298N Dual Motor Driver
- MAX7219 SPI LED Driver
- MotoZero 4 Motor Controller
- MQTT Publish Controller
- OWI 535 Robotic Arm (USB Controller)
- Serial Based Controllers (Parallaxy or Arduinos)
- PiBorg ThunderBorg Motor Driver
- Pololu Daul MC33926 Motor Driver (experimental)
- Pololu DRV8835 Dual Motor Driver
- Pololu Maestro Servo Controller (experimental)