All posts by graceliana@gmail.com

Teensy: Square Pattern

Make your robot walk around a square pattern.

// Square Pattern 
// 6/6/19 
// Arduino 1.8.5 

// Set up pins 
const int OnBoardLED = 13; 
int Dlay = 500; 

void setup() 
{ 
  pinMode(9,OUTPUT); // set the pin modes to output 
  pinMode(10, OUTPUT); 
  pinMode(11,OUTPUT); 
  pinMode(12,OUTPUT); 
  pinMode(OnBoardLED,OUTPUT); 
} 

void loop() 
{ 
  blinky(); // blink the light 
  forward(1000); // move forward 
  stopBot(1000); // briefly pause 
  turnRight(1);  // turn at a right angle 
} 

void blinky() 
{ 
  digitalWrite(OnBoardLED, LOW); // flash on board LED 
  delay(Dlay); 
  digitalWrite(OnBoardLED, HIGH); 
  delay(Dlay); 
} 

void forward(int amt) 
{ 
  digitalWrite(9,HIGH); // make left motor move forward 
  digitalWrite(10,LOW); 
  digitalWrite(11,HIGH); // make right motor move forward 
  digitalWrite(12,LOW); 
  delay(amt); 
} 

void stopBot(int pause) 
{ 
  digitalWrite(9,LOW); // stop both motors 
  digitalWrite(10,LOW); 
  digitalWrite(11,LOW); 
  digitalWrite(12,LOW); 
} 

void turnRight(double dlay) 
{ 
  digitalWrite(9,HIGH); // make the left motor move forward 
  digitalWrite(10,LOW); 
  digitalWrite(11,LOW); // stop the right motor 
  digitalWrite(12,LOW); 
  delay(dlay); 
}

Teensy: Two Motors – forward

// Motor Driver 
// Darcy Chang 
// 6/6/19 
// Arduino 1.8.5 
const int 
OnBoardPin = 13; 
const int Dlay = 20; 

void setup() 
{ 
  // put your setup code here, to run once: 
  pinMode(9,OUTPUT); // set the pin modes to output 
  pinMode(10, OUTPUT); 
  pinMode(11,OUTPUT); 
  pinMode(12,OUTPUT); 
  pinMode(OnBoardPin,OUTPUT); 
} 

void loop() 
{ 
  // put your main code here to run repeatedly: 
  blinky(); 
  forward(); 
}
 
void blinky() 
{ 
  digitalWrite(OnBoardPin, LOW); // flash on board LED 
  delay(Dlay); 
  digitalWrite(OnBoardPin, HIGH); 
  delay(Dlay); 
} 

void forward() 
{ 
  digitalWrite(9, HIGH); // make left motor move forward 
  digitalWrite(10,LOW);
  digitalWrite(11,HIGH); // make right motor move forward 
  digitalWrite(12,LOW); 
} 
void stopBot() 
{ 
  digitalWrite(9,LOW); // stop both motors 
  digitalWrite(10,LOW); 
  digitalWrite(11,LOW); 
  digitalWrite(12,LOW); 
}

Teensy: Ultrasonic Sensor

This video will show you both how to install it (if it is not installed in yours or you want to add a 2nd one) and how to program it. Mr. Patton will also talk about how ultrasonic sensors work to detect objects.

Use pin # 14 for “trig” Use pin #15 for “echo” Once you get your ultrasonic sensor working, have it moving forward and when the robot detects an object at about 15 cm, it should avoid it by changing direction.

Ultrasonic Sensor – distance

https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/

 

/*
* Ultrasonic Sensor HC-SR04 and Arduino Tutorial
*
* by Dejan Nedelkovski,
* www.HowToMechatronics.com
*
*/
// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
// defines variables
long duration;
int distance;
void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}

Teensy: One Motor

// 1213MotorDriver

// L293D Motor Driver by Brian Patton

const int LeftA = 9;  // Left motor control pin A
const int LeftB = 10;  // Left motor control pin B

int Dlay = 1000;


void setup() {
  pinMode(LeftA, OUTPUT); // Set direction of the motor control pin
  pinMode(LeftB, OUTPUT); // Set direction of the motor control pin
}

void loop() {
  digitalWrite(LeftA, LOW);
  digitalWrite(LeftB, HIGH);

}

Digi Key Tutorials

3:38NOW PLAYING

Today on Another Teaching Moment you will learn about electrically operated switches more commonly known as relays and their …

5:47NOW PLAYING

The Resident Geeks from Digi-Key Electronics demonstrate how to solder using the Hakko FX888D soldering iron station.

CC

3:21NOW PLAYING

Light Emitting Diodes (LEDs) convert electrical energy into light energy and are the most popular devices used for status …

New

1:47NOW PLAYING

The Resident Geeks from Digi-Key Electronics walkthrough how to wire splice and how to tap a wire (also called a T-splice) using …

CC

3:57NOW PLAYING

Relays are used to isolate control voltages from working voltages in an industrial, automotive or telecom system. Today on …

2:45NOW PLAYING

Today on Another Teaching Moment we will walk you through finding a replacement electrolytic capacitor on the Digi-Key website …

1:35NOW PLAYING

Today on Another Teaching Moment we will walk you through updating your Raspberry Pi to the latest version of Raspbian.

4:04NOW PLAYING

Without the protection of an overcurrent circuit breaker, downline components, wires and PCB (printed circuit board) traces may …

1:50NOW PLAYING

Just because a trace on your PCB has lifted off doesn’t mean the board is ready for the recycling center. In this short video you will …

2:27NOW PLAYING

Today on Another Teaching Moment you will learn about the wide variety of mechanically actuated switches including: Tactile, …

3:35NOW PLAYING

Capacitors can carry a dangerous amount of power. This time on Another Teaching Moment we will walk you through how to …

2:21NOW PLAYING

The Hall Effect is a term that refers to the production of voltage across a conductor when a magnetic field is applied in a direction …

Resources

EverCircuit

 

 

TCA9548A I2C Multiplexer

Time of Flight 
 
 
 
 
 
 
 
 
Raspberry Pi Linux LESSON 17: Find Your Raspberry Pi IP Address | Technology Tutorials
http://www.toptechboy.com/raspberry-pi/raspberry-pi-linux-lesson-17-find-your-raspberry-pi-ip-address/
 
I2C
 
How to Connect and Interface a Raspberry Pi With an Arduino  | Raspberry Pi | Maker Pro
https://maker.pro/raspberry-pi/tutorial/how-to-connect-and-interface-raspberry-pi-with-arduino
 
How To Make Arduino Human Following Robot
 
 
 
 
 
 
 
Autonomous Lane-Keeping Car Using Raspberry Pi and OpenCV

 

Screen Shot 2020-02-27 at 7.16.28 PM.png
Screen Shot 2020-02-27 at 9.25.10 PM.png
 
Interface a Raspberry Pi with an Arduino so the two boards can communicate with one another.
Screen Shot 2020-02-27 at 9.18.55 PM.png
 
 
 
Using Rotary Encoders with Arduino
Screen Shot 2020-02-27 at 9.23.38 PM.png
 
Arduino DC Motor Control Tutorial – L298N | PWM | H-Bridge
 

attachInterrupt()

Screen Shot 2020-02-27 at 9.32.16 PM.png
 
 
 
 
 
Raspberry Pi SPI and I2C Tutorial
 
Connecting To The Ports
Screen Shot 2020-02-27 at 9.29.03 PM.png
Screen Shot 2020-02-27 at 9.30.44 PM.png

This tutorial will walk you through getting the I2C and SPI interfaces of your Raspberry Pi working. These interfaces aren’t enabled by default, and need some extra configuration before you can use them.

Recommended Reading

Before we get started, you might want to review some related background material.

  • I2C is a useful bus that allows data exchange between microcontrollers and peripherals with a minimum of wiring.
  • SPI is a cousin of I2C with similar applications.
  • For the C/C++ examples, we’ll be using the wiringPi library to interface with these buses
  • For the Python examples, we’ll be using spidev for SPI and smbus for I2C.

TCA9548A I2C Multiplexer

 
 
 
 
 
EveryCircuit
 
 
TechTogether Boston 2020
 

How to Check your Ubuntu Version

Updated Aug 28, 2019

3 min read

 
Lab Resource Page
 
Prarctice-it
 
Paul McWhorter
 

3 Awesome Inventions and Creative Ideas

 
 
 

Using EEPROM with Arduino – Internal & External

 
 

TUTORIAL: ODrive Brushless Motor with Raspberry Pi and Arduino

 

Holographic FlexLED

 

Top 10 Amazing Projects Build on Raspberry-pi 2020

 
World tiniest Time-of-Flight (ToF) laser ranging sensor
 

Things you can make from old, dead laptops

How To Make Arduino Human Following Robot

 
encoders in arduino
 
 

I found Best Robot Actuator (GYEMS: RMD x8)

 

Raspberry Pi SPI and I2C Tutorial

 

Arduino

Encoders

Using Rotary Encoders with Arduino

ARDUINO DC MOTOR CONTROL TUTORIAL – L298N | PWM | H-BRIDGE
Arduino Self-driving Car

Arduino Self-Driving Car

Arduino PID Motor Controller

How to control DC motor with L298N driver and Arduino

Arduino Lessons

Medium Logo
 
Stories for graciela elia
Today’s highlights
 
 
This is Part 1/2 of Understanding BERT written jointly by Miguel Romero and Francisco Ingham. If you already…
Meet ‘Robby’. Robby is a robot. Well technically he is a simplistic virtual model of a robot, but that should…
Jannik Zürn6 min read
Well, it is every newbie ROS developer’s desire to have the tools of everyday software developers. I remember…
Tahsincan Kose9 min read

encoders in arduino

https://www.google.com/search?q=encoders+in+arduino&ie=UTF-8&oe=UTF-8&hl=en-us&client=safari

Rotary encoder increment prograppr by digi-key

https://www.digikey.com/products/en?keywords=cui%20inc%20amt102-v

Motor and encoder test program

https://forum.arduino.cc/index.php?topic=18274.0