This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:examples:sensor:ir [2009/03/30 09:36] – silver | en:examples:sensor:ir [2010/03/29 11:05] (current) – removed raivo.sell | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Infrared distance sensor ====== | ||
| - | This sensor from Sharp is a long-distance IR module; for IR this description is | ||
| - | accurate, though at other wavelengths it could act as a mid-distance module. The | ||
| - | distance that is easily sensed is 0.2–1.5 m. | ||
| - | The output of the sensor is an analogue signal of 2.7–0.5 V (corresponding to the | ||
| - | distance). The connection of the sensor is seen in Figures 1 and 2. One interesting | ||
| - | feature is the output of the module (see figure). The output of the sensor module | ||
| - | will be the same for 9 and 30 cm. This means that it is necessary to consider both the | ||
| - | slope of the signal and the direction of motion, to be sure of which side of the peak | ||
| - | you are on. | ||
| - | |||
| - | |||
| - | |||
| - | {{: | ||
| - | |||
| - | <code c> | ||
| - | /* Labor 2 näide 1 AD muunduri kasutamine | ||
| - | Mikael Hellgren/ | ||
| - | */ | ||
| - | #include < | ||
| - | int main(void) { | ||
| - | unsigned int adc10; | ||
| - | ADMUX = 0xC0; | ||
| - | while(1) { | ||
| - | ADCSRA = 0xC3; | ||
| - | adc10 = ADC; | ||
| - | } | ||
| - | } | ||
| - | |||
| - | </ | ||
| - | |||
| - | {{: | ||