Monday, November 13, 2017

19 October '17- Day 16- H-Bridge and and Motor Driver

The class began with Mason introducing our lab for the day.  The lab was to be able to control a motor using an H-bridge controller.  Named so because the diagram of the switches looks similar to the letter H.  The h-bridge controller allows you to control a dc motor and be able to reverse its direction with a command to close 2 diagonally located switches and vice versa for forward movement.  The L9110s is another type of motor controller but allows to connect two dc motors on the same shield as opposed to the single motor controller.  L9110s also is more affordable and convenient with the terminal blocks on the board instead of having to solder directly to the board.  


(diagram of L9110s, the power and ground are connected where the motor inputs should go)
(wired up one motor with the single motor controller and a potentiometer to control the spinning direction of the motor)
(An L9110s installed on robocar with two dc motors and joystick to control movement in every direction)

After Lab we began discussion about pointers and how they're used in C.  A pointer is a variable containing the address of another variable.  Plain and simple, these pointers are used to run programs faster and use less memory.  Pointers are also utilized to allocate memory for an array at future usage.  

(examples on how pointers and arrays work together)
(more examples of pointers)

(more pointer examples)

No comments:

Post a Comment