Robotics 9°

 

Ninth Grade Space

🌈 Neurolinguistic Phrase:  

🏆 Date:

🏆 TMA: Doing the opposite action to the one the teacher commands.
👩‍🏫 Topic: 


📕 

 

💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟

 

🌈 Neurolinguistic Phrase:  

🏆 Date: May 24th - 24

🏆 TMA: Opposite Actions
👩‍🏫 Topic: Functions in aarduino.


📕 We are gonna learn about arduino functions.

📕Homework: Create 10 Functions with Tinkercad and to use with URFI and ALONE, only you.

Then, write the functions in the workbook, page 22. Session 8.

ROBOTICS - MEET CLASS 👈👈👈👈👈👈👈👈👈👈

THE HELP FOR YOU :D


// It's a comment
// This code was made by Omar Muñoz 9th

//Right Motor
int RM_BLACK = 3;
int RM_RED = 11;

//LEFT Motor
int LM_BLACK = 5;
int LM_RED = 6;

// Buzzer - CLAXON
int CLAXON = 12;

// led light :D
int ledsito = 2;

void setup()// it's the head
{
  pinMode(RM_BLACK,OUTPUT);// I Will to control this pin
  pinMode(RM_RED,OUTPUT);
  pinMode(CLAXON, OUTPUT);
}

void loop()//it's the body
{
  forward();
  activate_claxon();
  disable_claxon();
  forward();
  stop();
}

int stop(){ // FUNCTIONS IT'S FIRST FUCTION
  // Stop 1 seconds
  digitalWrite(RM_BLACK,LOW);
  digitalWrite(RM_RED,LOW);
  digitalWrite(LM_BLACK,LOW);
  digitalWrite(LM_RED,LOW);
  delay(1000);// 1000 is the same that 1s
}

int forward(){// FUNCTIONS IT'S SECOND FUCTION
  // Forward 5 seconds
  digitalWrite(RM_BLACK,LOW);
  digitalWrite(RM_RED,HIGH);
  digitalWrite(LM_BLACK,LOW);
  digitalWrite(LM_RED,HIGH);
  delay(5000);// 5000 is the same that 5s
}

int activate_claxon(){
  tone(CLAXON,1000);
  delay(500);
}

int disable_claxon(){
  noTone(CLAXON);
}


💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟

 

🌈 Neurolinguistic Phrase:  

🏆 Date: May 24th - 24

🏆 TMA: Opposite Actions
👩‍🏫 Topic: Functions in aarduino.


📕 We are gonna learn about arduino functions.

 📕 We are going to make a code with URFI (Lab practice)


 

WEEK & CLASS 9° 

URFI LINE FOLLOWER 


💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟

3D PRINTING



EX 1: ROBOT EXPLORER

 EX 2 : ROBOTICS GRIPPERS

EX 3: SG90 GRIPPER 

💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟💟

STEM PROJECT

🌈 Neurolinguistic Phrase:  

🏆 Date: October 18th - 24

🏆 TMA: Colors and words
👩‍🏫 Topic: STEM PROJECT - Program robot line follower and box picker


📕 We are gonna learn about arduino functions.

 📕 We are going to make a code with URFI (Lab practice)

#include <Servo.h> // IT'S A LIBRARY FOR SERVO MOTOR WORKS PROPERLY

// VARIABLES SECTION -------------------------------
bool SENiz;// VARIABLES SECTION
bool SENde;
int Left_velocity = 70; // MAX 255 value
int Right_velocity = 105; // MAX 255 value
int sensibility_time = 30; // SENSIBILITY TIME BEFORE EACH ACTION; IT'S THE TIME TO MAKE EACH ACTION
int time_box = 6000; // time to pick up or put the box with garbage
int repetitions = 0;

Servo servo_arm; // IT'S HE NAME OF THE MICROSERVO

//VARIABLES SECTION -------------------------------

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(7,INPUT); // LINE SENSOR
  pinMode(2,INPUT); // LINE SENSOR

  pinMode(6,OUTPUT);// RIGHT MOTOR; RED CABLE
  pinMode(5,OUTPUT);
  pinMode(11,OUTPUT);// LEFT MOTOR; RED CABLE
  pinMode(3,OUTPUT);

  servo_arm.attach(9);

  delay(5000);// time to start; the begining

  collect();// pick up box
  rise();// rise the arm

}

void loop() {
  // put your main code here, to run repeatedly:
  SENiz = digitalRead(7);
  SENde = digitalRead(2);
  Serial.print("Left Sensor:");
  Serial.println(SENiz);

  Serial.print("Right Sensor:");
  Serial.println(SENde);

  delay(sensibility_time);// wait while URFI makes the actions

  if(SENiz == 1 && SENde == 1){
   
    analogWrite(6,Right_velocity); //RIGHT WHEEL GO FORWARD
    analogWrite(5,0);

    analogWrite(11,0);//LEFT WHEEL GO FORWARD
    analogWrite(3,Left_velocity);// MAX VALUE 255
    delay(sensibility_time);// wait while URFI makes the actions
    }

    else if(SENiz == 1 && SENde == 0){
 
    analogWrite(6,Right_velocity); //RIGHT WHEEL GO FORWARD
    analogWrite(5,0);

    analogWrite(11,0);//LEFT WHEEL GO FORWARD
    analogWrite(3,0);
    delay(sensibility_time);// wait while URFI makes the actions
    }

    else if(SENiz == 0 && SENde == 1){

    analogWrite(6,0); //RIGHT WHEEL GO FORWARD
    analogWrite(5,0);

    analogWrite(11,0);//LEFT WHEEL GO FORWARD
    analogWrite(3,Left_velocity);
    delay(sensibility_time); // wait while URFI makes the actions
    }

    else{
      analogWrite(6,0); //RIGHT WHEEL GO FORWARD
      analogWrite(5,0);

      analogWrite(11,0);//LEFT WHEEL GO FORWARD
      analogWrite(3,Left_velocity);
      delay(sensibility_time);// wait while URFI makes the actions
      }

      repetitions = repetitions + 1;// increase the repetition in the loop
      if(repetitions == 550){
        collect();
        rise();
        delay(10000);// wait because the robot finish his job
      }

}

int collect(){
  //this is a function that lowers the servo to pick up box
  servo_arm.write(90); // instruction to move the arm up
  delay(100);
  servo_arm.write(80); // instruction to move the arm up
  delay(100);
  servo_arm.write(60); // instruction to move the arm up
  delay(100);
  servo_arm.write(40); // instruction to move the arm up
  delay(100);
  servo_arm.write(20); // instruction to move the arm up
  delay(100);
  servo_arm.write(0); // instruction to move the arm down
  delay(time_box);
}

int rise(){
  // This is a function that activates the servo motor to rise the arm. but with stages 20 by 20 degrees
  servo_arm.write(20); // instruction to move the arm up
  delay(100);
  servo_arm.write(40); // instruction to move the arm up
  delay(100);
}

int activate_claxon(){
  // here we have the code to make a super mario's song
}