NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Write a note in this area. It's really easy to share with other*/
#include <SoftwareSerial.h>
#include <Servo.h>
SoftwareSerial xbee(10, 11); // RX, TX
Servo LF;
Servo RF;
Servo LB;
Servo RB;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
xbee.begin(9600);


pinMode(13, OUTPUT);
LF.attach(2);
RF.attach(5);
LB.attach(4);
RB.attach(3);
}
void loop() { // run over and over

while (xbee.available() > 0) {
char c = xbee.read();
if (c == 'f') {
Serial.println("f");
LF.write(15);
RF.write(15);
LB.write(165);
RB.write(165);
}
if (c == 'l') {
Serial.println("l");
LF.write(90);
RF.write(90);
LB.write(15);
RB.write(15);
}
if (c == 'r') {
Serial.println("r");
LF.write(165);
RF.write(165);
LB.write(90);
RB.write(90);
}
if (c == 'b') {
Serial.println("b");
LF.write(165);
RF.write(165);
LB.write(15);
RB.write(15);
}
if(c == 's'){
Serial.println("s");
LF.write(90);
RF.write(90);
LB.write(90);
RB.write(90);
}
}

delay(10);
}s. Click here ...


/*
The circuit:
RX is digital pin 10 (connect to TX of Xbee)
TX is digital pin 11 (connect to RX of Xbee)
Note:
Not all pins on the Leonardo support change interrupts,
so only the following can be used for RX:
8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
*/
#include <SoftwareSerial.h>
#include <Servo.h>
SoftwareSerial xbee(10, 11); // RX, TX
const int buttonF = 4;
const int buttonL = 2;
const int buttonR = 3;
const int buttonB = 5;
int buttonStateF;
int buttonStateL;
int buttonStateR;
int buttonStateB;

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
xbee.begin(9600);
pinMode(buttonF, INPUT_PULLUP);
pinMode(buttonL, INPUT_PULLUP);
pinMode(buttonR, INPUT_PULLUP);
pinMode(buttonB, INPUT_PULLUP);
//digitalWrite(button, HIGH); //internal pullup
}
void loop() {
buttonStateF = digitalRead(buttonF);
buttonStateL = digitalRead(buttonL);
buttonStateR = digitalRead(buttonR);
buttonStateB = digitalRead(buttonB);
//Serial.println(buttonState);
delay(10);
if (buttonStateF == LOW) {
xbee.write('f');
}
else if (buttonStateL == LOW) {
xbee.write('l');
}
else if (buttonStateR == LOW) {
xbee.write('r');
}
else if (buttonStateB == LOW) {
xbee.write('b');
}
else{
xbee.write('s');
}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.