Skip to content

Flamewheel_(SKU__ROB0139)

Angelo edited this page Sep 22, 2016 · 5 revisions

Introduction

This product is a two-wheeled robot laser cut from 3mm MDF. It is designed using Luban lock assembly to use as few screws as possible allowing a very easy assembly process for younger users, while being beneficial to developing logical thinking. This product has agile mobility using two wheels, with humorous and fun movement patterns. The unit can be expanded with other DFRobot modules and can be used in a number of different user scenarios, including education.

Specification

  • Dimensions: 120 x 120 x 85mm
  • Operating Voltage: 6 - 10V
  • Operating Current: 0 - 3A
  • Operating Temperature: 0 - 60°C
  • Romeo BLE Mini MCU
  • Range: Open area within 60m
  • Arduino Bluetooth remote update program
  • Microprocessor: ATmega328P
  • Boot loader: Arduino UNO
  • 2-way 1.5A current H-bridge motor driver interface
  • Drive: two differential drive
  • Motor no-load speed: 230 ± 10% rpm
  • Max Speed: 1 m/s

Tutorial

Materials:

Hardware

  • Romeo Mini x 1
  • Motor x 2
  • 4 x AAA Battery Holder x 1
  • AAA batteries x 4
  • Laser Cut Wood Frame
  • Silicone Ring x 1
  • Screws
  • Small Phillips Screwdriver x 1

Software

Click to download Romeo BLE Mini Libraries

Frame Assembly

Refer to the installation instructions for frame assembly

  1. Route wires through assembly as pictured: File:Wire Routing1.png File:Wire Routing2.png
  2. After installing the frame, connect motor and power wires File:Connections.png Connect a USB cable and upload the following code to your Flamewheel using Arduino IDE. Please note you will need to install Romeo BLE Mini libraries to upload the code successfully:

How to install libraries?

/* -----Flamewheel Bluetooth Control Program
//------2016.6.29 by LL
//------Suitable for Romeo BLE Mini MCU
//http://www.dfrobot.com/index.php?route=product/product&product_id=1367&search=ble+mini&description=true#.V8AR1q11Zfc
*/
#include "GoBLE.h"
#include <Romeo_m.h>

#define LED 13

//GoBLE Goble(Serial);
int joystickX, joystickY;
int buttonState[7];
unsigned int led_count;
void setup() {
  Romeo_m.Initialise();
  Goble.begin();
  pinMode(LED, OUTPUT);
}
void loop() {
  if (Goble.available())
  {
    readGoBle();
    motorContrl();
  }
  delayLedBlink();//delay 10ms and led blink
}
//Read GoBLE values
void readGoBle()
{
  // read joystick value when there's valid command from bluetooth
  joystickX = Goble.readJoystickX();
  joystickY = Goble.readJoystickY();
  // read button state when there's valid command from bluetooth
  buttonState[SWITCH_UP]     = Goble.readSwitchUp();
  buttonState[SWITCH_DOWN]   = Goble.readSwitchDown();
  buttonState[SWITCH_LEFT]   = Goble.readSwitchLeft();
  buttonState[SWITCH_RIGHT]  = Goble.readSwitchRight();
  buttonState[SWITCH_SELECT] = Goble.readSwitchSelect();
  buttonState[SWITCH_START]  = Goble.readSwitchStart();
  /*Serial.println("========================");
   Serial.print("Joystick Value: ");
  Serial.print(joystickX);
  Serial.print("  ");
  Serial.println(joystickY);
  for (int i = 1; i <= 6; i++) {
    if (buttonState[i] == PRESSED) {
      Serial.print(" ID: ");
      Serial.print(i);
      Serial.print("\t ");
      Serial.println("Pressed!");
    }
    if (buttonState[i] == RELEASED){
      Serial.print("ID: ");
      Serial.print(i);
      Serial.print("\t ");
      Serial.println("Released!");
    }
  }*/
}
//Move according to GoBLE value
//Joystick left and right to turn bends, left and right buttons to spin on the spot
void motorContrl()
{
  if ((buttonState[SWITCH_UP] == PRESSED) || ((joystickX > 128) && (joystickY >= 64) && (joystickY <= 192)))
  {
    Romeo_m.motorControl(Forward, 200, Forward, 200); //go forward
    return;//end function
  }
  if ((buttonState[SWITCH_DOWN] == PRESSED) || ((joystickX < 128) && (joystickY >= 64) && (joystickY <= 192)))
  {
    Romeo_m.motorControl(Reverse, 150, Reverse, 150); //go backwards
    return;//end function
  }
  if (buttonState[SWITCH_LEFT] == PRESSED)
  {
    Romeo_m.motorControl(Reverse, 100, Forward, 100); //turn left
    return;//end function
  }
  if ((joystickY < 128 ) && (joystickX >= 64 ) && ( joystickX <= 192) )
  {
    Romeo_m.motorControl_M1(Forward, 80); //turn left big bend
    Romeo_m.motorControl_M2(Forward, 200);
    return;//end function
  }
  if ( buttonState[SWITCH_RIGHT] == PRESSED)
  {
    Romeo_m.motorControl(Forward, 100, Reverse, 100); //turn right
    return;//end function
  }
  if ((joystickY > 128) && (joystickX >= 64) && (joystickX <= 192))
  {
    Romeo_m.motorControl_M2(Forward, 80); //turn right big bend
    Romeo_m.motorControl_M1(Forward, 200);
    return;//big bend
  }
  Romeo_m.motorStop();//no stop button is pressed
}
//led blink funtion, each execution delay 10ms. every 100 times level inverted
void delayLedBlink()
{
  delay(10);
  led_count++;
  if (led_count > 100)
  {
    digitalWrite(LED, !digitalRead(LED));
    led_count = 0;
  }
}

GoBLE APP

File:QRGoBLE.png

  1. Scan the QR code or manually download and install GoBLE (currently supported by iOS only)
  2. After installing GoBLE, enable Bluetooth on your device and start the GoBLE app
  3. Scan for devices by clicking the magnifying glass at the top
  4. Select your device You will now be in control!

File:GoBLE instructions.png

FAQ and Troubleshooting

Q: My Flamewheel doesn't go forward or backwards - it just spins. What should I do?

A: Try swapping the + and - of one of the motor wires. This will reverse the direction of one motor.

center For any questions or comments on this product, please contact us on the forum

Shopping

[Link DFRobotxxxxxxxxxxxxx]

Clone this wiki locally