How not to build a robot

Yn diweddar, darganfodais nid wyf yn dda iawn am dylinio 3d, a hefyd fod hi'n anodd iawn i cael tyllau sgriw yn yr lle cywir

Rydym wedi bod yn defnyddio yr meddalwedd Tinkercad ar gyfer dylinio ein robotiaid, ond mae'r gwefan hefyd ym defnyddiol am creu cylchedau electronig sy'n gallu fod yn cymleth iawn. Mae o hefyd yn possib i rhaglenni dyfeisiau ar yr platfform, fel Arduino a Microbit

An absolutely awful robot with terrible colour schemes and dumb design choices
An absolutely awful robot with terrible colour schemes and dumb design choices
An absolutely awful robot with terrible colour schemes and dumb design choices
The Image to the right shows the necessary wiring to connect all the components together. Always make sure to securely attatch the wires, and ensure that the correct type are used for each connection(Male-Male, Male-Female and Female-Female).
A diagram showing the wiring needed to make the robot actually work
The following code assumes that you are using the same pins and wiring as shown in the wiring section, and defines four functions for driving, reversing, and turning, all documented
// Define pin numbers for motor control
const int leftForwardPin = 10;
const int leftBackwardPin = 11;
const int rightForwardPin = 6;
const int rightBackwardPin = 9;

void setup(){
  // Set the pins as outputs
  pinMode(leftForwardPin ,OUTPUT);
  pinMode(leftBackwardPin ,OUTPUT);
  pinMode(rightForwardPin ,OUTPUT);
  pinMode(rightBackwardPin ,OUTPUT);
  
  // Initialize serial communication
  Serial.begin(9600);
}

// Stop all motors
void stopDrive(){
  digitalWrite(leftForwardPin ,LOW);
  digitalWrite(leftBackwardPin ,LOW);
  digitalWrite(rightForwardPin ,LOW);
  digitalWrite(rightBackwardPin ,LOW);
  Serial.println("Stopped All Motors");
}


// Move the robot forward
void forwardDrive(){
  stopDrive(); // Stop any previous motion
  digitalWrite(leftForwardPin, HIGH);
  digitalWrite(rightForwardPin, HIGH);
  digitalWrite(leftBackwardPin, LOW);
  digitalWrite(rightBackwardPin, LOW);
  Serial.println("Driving Forward");
}

// Move the robot backward
void reverseDrive(){
  stopDrive(); // Stop any previous motion
  digitalWrite(leftForwardPin, LOW);
  digitalWrite(rightForwardPin, LOW);
  digitalWrite(leftBackwardPin, HIGH);
  digitalWrite(rightBackwardPin, HIGH);
  Serial.println("Reversing");
}

// Turn the robot left
void turnLeft(){
  stopDrive(); // Stop any previous motion
  digitalWrite(leftForwardPin, LOW);
  digitalWrite(rightForwardPin, HIGH);
  digitalWrite(leftBackwardPin, HIGH);
  digitalWrite(rightBackwardPin, LOW);
  Serial.println("Turning Left");
}

// Turn the robot right
void turnRight(){
  stopDrive(); // Stop any previous motion
  digitalWrite(leftForwardPin, HIGH);
  digitalWrite(rightForwardPin, LOW);
  digitalWrite(leftBackwardPin, LOW);
  digitalWrite(rightBackwardPin, HIGH);
  Serial.println("Turning Right");
}

              

The Aber Robotics Club(ARC) is a weekly online session covering various aspects of robotics and programming. It's a great oppertunity to learn and explore robotics, but most importantly have fun, especially with challenge days every half term!

I joined in September of 2021 after I got into programming but needed a bit of direction to better my skills. I have loads of fun and so will you!