«

»

Skriv ut detta Inlägg

Arduino and bluetooth servo Magloop




ska%cc%88rmavbild-2016-12-15-kl-22-10-36

Now a video over the Arduino servo motor for my homebuild magloop is up on youtube. And here are some info about the android app and code for arduino. Don’t forget to SUBSCRIBE my youtube channel if u like it and want more video.

youtube-subscribe-button-2

1. Arduino uno

2. HC-05 Bluetooth Module

3. Servo motor

fz626ydi3thb8pw-large

Picture from instructables.com

 

The app i use:

Arduino Servo Motor Control



The Code i use:

#include <SoftwareSerial.h>

#include <Servo.h>

Servo myservo;

int bluetoothTx = 10;

int bluetoothRx = 11;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()

{

myservo.attach(9);

//Setup usb serial connection to computer

Serial.begin(9600);

//Setup Bluetooth serial connection to android

bluetooth.begin(9600);

}

void loop()

{

//Read from bluetooth and write to usb serial

if(bluetooth.available()> 0 )

{

int servopos = bluetooth.read();

Serial.println(servopos);

myservo.write(servopos);

}

}

 

Permalänk till denna artikel: http://www.sa5lkc.se/arduino-bluetooth-servo-magloop/

Kommentera

E-postadressen publiceras inte. Obligatoriska fält är märkta *

Följande HTML-taggar och attribut är tillåtna: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

elva + 13 =

Translate »