3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

how-to build MACKRA a serb variant.

Step 7The software: arduino

the software: arduino

the software consists of two parts : the arduino side, and the computer side. the arduino side is fairly simple, the code for it is as follows:

#include ;
Servo lefttop;
Servo leftbottom;
Servo righttop;
Servo rightbottom;
int incomingByte;
void setup()
{
lefttop.attach(8);
leftbottom.attach(9);
righttop.attach(10);
rightbottom.attach(11);
lefttop.write(90);
leftbottom.write(90);
righttop.write(90);
rightbottom.write(90);
Serial.begin(9600);

}
void loop() // this is were the actual program is finally ran in an infinite loop;
{
if (Serial.available() > 0) { //check for connection
incomingByte = Serial.read(); // if their is data available read it to the incomingByte variable

if(incomingByte=='f')
{
lefttop.write(0);
leftbottom.write(0);
righttop.write(180);
rightbottom.write(180);
}
if(incomingByte=='r')
{
lefttop.write(180);
leftbottom.write(180);
righttop.write(0);
rightbottom.write(0);
}
if(incomingByte=='R')
{
lefttop.write(180);
leftbottom.write(180);
righttop.write(180);
rightbottom.write(180);

}
if(incomingByte=='o')
{
lefttop.write(180);
leftbottom.write(180);
righttop.write(180);
rightbottom.write(180);
delay(250);
lefttop.write(90);
leftbottom.write(90);
righttop.write(90);
rightbottom.write(90);
}
if(incomingByte=='L')
{
lefttop.write(0);
leftbottom.write(0);
righttop.write(0);
rightbottom.write(0);
}
if(incomingByte=='u')
{
lefttop.write(0);
leftbottom.write(0);
righttop.write(0);
rightbottom.write(0);
delay(250);
lefttop.write(90);
leftbottom.write(90);
righttop.write(90);
rightbottom.write(90);
}
if(incomingByte=='s')
{
lefttop.write(90);
leftbottom.write(90);
righttop.write(90);
rightbottom.write(90);
}

}}





 

« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
54
Followers
11
Author:kyle brinkerhoff(mormon.org)
hi i enjoy making ludicrisly over the top and complex devices.... only thing that helps with the ADD..... Being an ameture engineer, I refuse pick the easy option, but rather the one that seems best, ...
more »