Homework 7 Solution

For example if the sensor detect event happens right

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: this using the bit_count //variable recv_ch = recv_ch |(bit<<bit_count); bit_count++; } //If all data bits have been received then set the recv flag if(bit_count ==7) { recv_flag = 1; } } Question 2: Timer Accuracy (10 pts) A laser that works similar to your Lab 7 Ping sensor is used to measure the distance to the Moon from Earth. The laser is fired at a mirror placed on the Moon, and a sensor attached to the laser detects when the reflection arrives back to the laser. As shown below. This is similar to an actual method used for measuring the Earth- Moon distance, see: http://en.wikipedia.org/wiki/Lunar_Laser_Ranging_experiment Name: Lab Section: When the laser is activated, TIMER1’s Input Capture pin is set to a 1. When the sensor detects the reflection, this pin is set to 0. A program has been written that uses Input Capture to compute the distance...
View Full Document

Ask a homework question - tutors are online