UNV

pretty much done just trying to find some help on the BT for wireless, i wrote the code in arduino bt i dont know how to setup up the hc05 to tx values over serial plus im working on like 5 other prototypes


This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/unv

help

U need to first connect the HC-05 module to your arduino. Connect TX to RX of arduino and RX to TX. Then, the negative terminal to ground and the power supply of HC-05 to 3.3v outlet on arduino(Connecting to 5 v may damage the module). Do remove the bluetooth module whenever you are uploading codes to the arduino.

Now it’d have been better had you posted details of your project and how exactly you want to control. I will assume you want to send serial data using your android phone.

Download a bluetooth terminal app from Play Store. Like: https://play.google.com/store/apps/details?id=main.terminalBT

Once your arduino has the code and everything is connected and powered, Turn ON bluetooth on your android device and pair it to your HC-05 module (pairing code is asked which is generally 1234). Open Bluetooth Terminal. Then go to connect to device insecured, and select HC-05. Now once your android device is connected to your HC-05, you can send data over  bluetoothjust the way you would send through wires using serial monitor. Enjoy…

I hope it helped. Any problem, do ask :slight_smile:

You seem to have done a good job. Do post details so that the world knows what u are making.

Cheers :slight_smile:

this here is my setup on

this here is my setup on both mcu with the same bt module, is this setup correct? by the way no im not using a phone im i built my own control system, yes i plan on sharing but only after is done, 

//Master 

void setup()

{

  Serial.begin(38400);

  mySerial.begin(38400);

}

//Slave side

void setup() {

  myservo.attach(9);  // attaches the servo on pin 9 to the servo object

  Serial.begin(38400);

  mySerial.begin(38400);

}

Seems correct

Seems correct. Complete codes would be better to check. Hope you complete the project successfully :slight_smile:

full code

changed somethings around, thanks for the help btw.

 




#include <Servo.h>

#include <Streaming.h>

#include <SPI.h>

#include <nRF24L01.h>

#include <RF24.h>

const uint64_t LA = 0xF0F0F0F0A2LL;


RF24 radio(9, 10);

const int pinCE = 9;

const int pinCSN = 10;


byte val[3];

Servo LsMot;


void setup()

{

  LsMot.attach(4);

  Serial.begin(115200);  

  radio.begin();

  radio.setAutoAck(false);

  radio.setDataRate(RF24_2MBPS);

  radio.startListening();

  const uint64_t Readingpipe = LA;

}

Capture.jpg


void loop()

{

  if

  (radio.available())

  {

    radio.read(val, sizeof(val));

    LsMot.write(val[0]);

    //Serial.print("val[3] received: ");

    //Serial.println(val[3]);

    Serial << "value received: " << val[0] <<endl;// im looking for now just for the first gyro value to control the first servo

//val[0] = map(gz, -17000, 17000, 0, 180);//servo 1

  }

}

/
this is masters sending imu gyro values
void loop()
{
  for
  (int i = 0; i < 6; i++) // initialization, loop continuation condition and incremental condition
  {
    mpu.getMotion3(&gx, &gy, &gz);
    val[0] = map(gz, -17000, 17000, 0, 180);//servo 1
    val[1] = map(gy, -17000, 17000, 0, 180);//servo 2
    val[2] = map(gx, -17000, 17000, 0, 180);//servo 3
  }
  radio.write(&val[3], sizeof(val));
}
/

description?

Hi just curious about your robot do you have more of a description somewhere?

excorp.weebly.com my

excorp.weebly.com my facebook page is also on there as wel as contact details