Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

;*********************************************************** ;* ;* BasicBumpBot.asm - V2.0 ;* ;* This program contains the neccessary code to enable the ;* the TekBot to behave in the traditional

;*********************************************************** ;* ;* BasicBumpBot.asm - V2.0 ;* ;* This program contains the neccessary code to enable the ;* the TekBot to behave in the traditional BumpBot fashion. ;* It is written to work with the latest TekBots platform. ;* If you have an earlier version you may need to modify ;* your code appropriately. ;* ;* The behavior is very simple. Get the TekBot moving ;* forward and poll for whisker inputs. If the right ;* whisker is activated, the TekBot backs up for a second, ;* turns left for a second, and then moves forward again. ;* If the left whisker is activated, the TekBot backs up ;* for a second, turns right for a second, and then ;* continues forward. ;* ;*********************************************************** ;* ;* Author: David Zier and Mohammed Sinky (modification Jan 8, 2009) ;* Date: January 8, 2009 ;* Company: TekBots(TM), Oregon State University - EECS ;* Version: 2.0 ;* ;*********************************************************** ;* Rev Date Name Description ;*---------------------------------------------------------- ;* - 3/29/02 Zier Initial Creation of Version 1.0 ;* - 1/08/09 Sinky Version 2.0 modifictions ;* ;*********************************************************** .include "m128def.inc" ; Include definition file ;************************************************************ ;* Variable and Constant Declarations ;************************************************************ .def mpr = r16 ; Multi-Purpose Register .def waitcnt = r17 ; Wait Loop Counter .def ilcnt = r18 ; Inner Loop Counter .def olcnt = r19 ; Outer Loop Counter .equ WTime = 100 ; Time to wait in wait loop .equ WskrR = 0 ; Right Whisker Input Bit .equ WskrL = 1 ; Left Whisker Input Bit .equ EngEnR = 4 ; Right Engine Enable Bit .equ EngEnL = 7 ; Left Engine Enable Bit .equ EngDirR = 5 ; Right Engine Direction Bit .equ EngDirL = 6 ; Left Engine Direction Bit ;///////////////////////////////////////////////////////////// ;These macros are the values to make the TekBot Move. ;///////////////////////////////////////////////////////////// .equ MovFwd = (1< 

2. Take a look at the code you downloaded for todays lab. Notice the lines that begin with .def and .equ followed by some type of expression. These are known as pre-compiler directives. Define pre-compiler directive. What is the difference between the .def and .equ directives? (HINT: see Section 5.1 of the AVR Starter Guide).

3.Take another look at the code you downloaded for todays lab. Read the comment that describes the macro definitions. From that explanation, deter- mine the 8-bit binary value that each of the following expressions evaluates to. Note: the numbers below are decimal values.

(a) (1 << 3) (b) (2 << 2) (c) (8 >> 1) (d) (1 << 0)

(e) (6 >> 1|1 << 6)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions