Beruflich Dokumente
Kultur Dokumente
Proyect.
sumobot
SW11
proyecto sumobot.
UPSRJ
09/10/2017
Materiales.
Arduino Uno.
Bluetooth HC05.
Jumper wire.
wire USB.
Led.
The objetives that we wait is learn more about the diferents coneccions and we can learn more
about programing in id arduino.
Sumobots name;
The signifc of this names is because we area going to have a log about the animal of the school tha is
a coyote.
Code;
byte speed = 255; // change this (0-255) to control the speed of the motors
char command;
void setup() {
Serial.begin(9600);
pinMode(AIB, OUTPUT);
pinMode(BIA, OUTPUT);
pinMode(BIB, OUTPUT);
pinMode(lampudepan, OUTPUT);
pinMode(lampubelakang, OUTPUT);
}
void loop() {
command = Serial.read();
//Serial.println(command);
switch(command){
case 'F':
Forward();
break;
case 'B':
Back();
break;
case 'L':
Left();
break;
case 'R':
Right();
break;
if(command=='W'){
digitalWrite(lampudepan,HIGH);
if (command=='w'){
digitalWrite(lampudepan,LOW);
}
if(command=='U'){
digitalWrite(lampubelakang,HIGH);
if (command=='u'){
digitalWrite(lampubelakang,LOW);
void Forward()
analogWrite(AIA, 0);
analogWrite(AIB, speed);
analogWrite(BIA, 0);
analogWrite(BIB, speed);
void Back()
analogWrite(AIA, speed);
analogWrite(AIB, 0);
analogWrite(BIA, speed);
analogWrite(BIB, 0);
void Left()
{
analogWrite(AIA, speed);
analogWrite(AIB, 0);
analogWrite(BIA, 0);
analogWrite(BIB, 0);
void Right()
analogWrite(AIA, 0);
analogWrite(AIB, 0);
analogWrite(BIA, speed);
analogWrite(BIB, 0);
void Stop()
analogWrite(AIA, 0);
analogWrite(AIB, 0);
analogWrite(BIA, 0);
analogWrite(BIB, 0);
}
.
Conclucion:
Whit this we can learn more about the circuits end conexions and we can use the diferents artefacts
for do the sumobot.
Thank you.