Write a function that does all the setup of timer

Assignment Help Computer Engineering
Reference no: EM132168446

Using Eclipse

Your aim is to output two PWM signals on the OC0A and OC0B pins of the microcontroller.

We will then use these to drive the "faster" motor to slow it down to match the "slow" motor in both forward and reverse.

Experiment with setting up and configuring the Timer 0 to generate PWM signals. Use an oscilloscope and a multimeter to view the signal and measure the effective voltage on the OC0A and OC0B pins.

Write a function that does all the setup of Timer 0 instead of doing it in main. Set it up to output the correct PWM signals but disable the outputs until needed later - use the COM0xx bits to do this.

Write a function called "drive". Pass it a parameter that controls whether the bot drives forward, backward, left, right or stops.

To begin with only implement the drive forward functionality.

In this function use timer 0 to drive the "fast" motor. You can simply enable the PWM output you set up in the previous function again using the COM0xx bits.

Integrate this code with your code from either your Lab Assignment 4 or the USART library I provided while working on the ultrasonic sensor to remote control your "bot".

Simulate the motors by using LEDs - e.g. one LED each for right-forward, left-forward, right-reverse, left-reverse.

Use keys of your choice to trigger forward, backward, left, right and stop.

Use #defines to set the PWM pulse width etc and not "magic numbers"!

Reference no: EM132168446

Questions Cloud

Calculates the wind chill temperature : Write a script file that does the following operations. Using the MATLAB built-in function plot function, plot Twc (in red colour) for o 32 F Ta ?
Write a query to output the names of all captains : Write a query to output the names of all captains who have captained a boat with a home harbor of Gloucester.
Renovation of a facility : Explain budget planning and cost estimates that will need to be considered for Disaster management to incorporate in the renovation of a facility.
Immediate competitors are adding efficiency to our society : The market has decided that Uber and its immediate competitors are adding efficiency to our society. How is Uber providing the added efficiency?
Write a function that does all the setup of timer : Write a function called "drive". Pass it a parameter that controls whether the bot drives forward, backward, left, right or stops.
Food delivery service such as a pizza business : What can be one of the different types of information technologies that could be used in a food delivery service such as a pizza business?
Display the number of entries read : Write a proper C program that will read numbers from a text file and display the Number of entries read.
Transformational leaders for inspiring employees : How do you assess the four key behaviors of transformational leaders for inspiring employees?
Determine a course of action for the manager : Determine a course of action for the manager, using a decision tree and the expected value criterion.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd