Download Arduino SERWO BLUETOOTH APK latest version Free for Android
Version | 1.0 |
Update | 6 years ago |
Size | 1.34 MB (1,403,148 bytes) |
Developer | Neqero |
Category | Apps, Education |
Package Name | appinventor.ai_neqero1.bluetoth |
OS | 1.6 and up |
Arduino SERWO BLUETOOTH APPLICATION description
Kod do arduino:
#include
#include
Servo myservo1, myservo2, myservo3;
int bluetoothTx = 11;
int bluetoothRx = 10;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo1.attach(9);
myservo2.attach(5);
myservo3.attach(3);
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop()
{
if(bluetooth.available()>= 2 )
{
unsigned int servopos = bluetooth.read();
unsigned int servopos1 = bluetooth.read();
unsigned int realservo = (servopos1 *256) + servopos;
Serial.println(realservo);
if (realservo >= 1000 && realservo <1180){
int servo1 = realservo;
servo1 = map(servo1, 1000,1180,0,180);
myservo1.write(servo1);
Serial.println("servo 1 ON");
delay(200);
}
if (realservo >=2000 && realservo <2180){
int servo2 = realservo;
servo2 = map(servo2,2000,2180,0,180);
myservo2.write(servo2);
Serial.println("servo 2 On");
delay(200);
}
if (realservo >=3000 && realservo < 3180){
int servo3 = realservo;
servo3 = map(servo3, 3000, 3180,0,180);
myservo3.write(servo3);
Serial.println("servo 3 On");
delay(200);
}
}
}
#include
#include
Servo myservo1, myservo2, myservo3;
int bluetoothTx = 11;
int bluetoothRx = 10;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
myservo1.attach(9);
myservo2.attach(5);
myservo3.attach(3);
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop()
{
if(bluetooth.available()>= 2 )
{
unsigned int servopos = bluetooth.read();
unsigned int servopos1 = bluetooth.read();
unsigned int realservo = (servopos1 *256) + servopos;
Serial.println(realservo);
if (realservo >= 1000 && realservo <1180){
int servo1 = realservo;
servo1 = map(servo1, 1000,1180,0,180);
myservo1.write(servo1);
Serial.println("servo 1 ON");
delay(200);
}
if (realservo >=2000 && realservo <2180){
int servo2 = realservo;
servo2 = map(servo2,2000,2180,0,180);
myservo2.write(servo2);
Serial.println("servo 2 On");
delay(200);
}
if (realservo >=3000 && realservo < 3180){
int servo3 = realservo;
servo3 = map(servo3, 3000, 3180,0,180);
myservo3.write(servo3);
Serial.println("servo 3 On");
delay(200);
}
}
}
↓ Read more
![Arduino SERWO BLUETOOTH screen 1](/img/1.gif)
![Arduino SERWO BLUETOOTH screen 2](/img/1.gif)