Question: 4 . 1 Understanding Code All code should be pseudo code and submitted before the lab. Code should be written and submitted as a .
Understanding Code
All code should be pseudo code and submitted before the lab. Code should be written and
submitted as a txt file. Grades will be given to the structure of code, rather than if it is
functioning. In other words, it is more important that you figure out how the code should be
written, rather than the position of every colon or bracket.
Prepare the code that will determine if the limit switch is pressed or not. The switch
is normally open and connected to pin
The code provided for this lab introduces the use of objectoriented programming
with Python. This essentially means that when you run the code, it creates objects in
Python they are called classes and calls methods from those classes to perform the
desired actions. Using the provided code as your guide, go back and create a Motor
object that uses the code you wrote in the first lab. More information about the OOP
can be found in the lectures or here.
The DistanceSensor.py library provides a simple implementation of the ultrasonic
sensor Rather than use that library, look online and see if you can find a way to
calculate the distance without using the DistanceSensor.py library. Hint: you will
need to use both the ECHO and TRIGGER pin, as well as know the speed of sound.
Understanding Circuitry
The LCD is controlled by IC but does not need to be Using the component data
sheet, create a circuit diagram that uses GPIO pins rather than IC
Understanding Mechanical Systems
If your ultrasonic sensor measures a time of microseconds, how far away is the
object?
The rotary encoder has an output shaft that is mm in diameter and is directly
connected to the wheel which has a diameter of cm If the rotary encoder has
positions per revolution, how far does the robot travel per increment?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
