Java Reference
In-Depth Information
* return the temperature value in an int value.
**/
class TempDataGenJavelin extends DataGenerator
{
DS1620 fThermometer;
/** Constructor creates an instance of DS1620. **/
TempDataGenJavelin () {
fThermometer = new DS1620 (CPU.pin4, CPU.pin5, CPU.pin6);
}
/** Return temperature in units of 0.5 degrees Celsius. **/
int getData () {
return fThermometer.getTempRaw ();
}
} // class TempDataGenJavelin
/**
* Javelin does not allow for interfaces so use an abstract class to represent
* types of data generators.
*/
public abstract class DataGenerator
{
abstract int getData ();
}
24.9.2 A Javelin Stamp for an unmanned aerial vehicle
Another demonstration project [32], discussed in more detail in the Web Course,
involved the development of a system with the Javelin Stamp to provide loca-
tion measurement and sensor data recording in a small unmanned aerial vehicle
(UAV). The goal was for the plane to fly autonomously and measure ambient
radioactivity. The entire payload, including batteries and the UAV, is less than
7 kg.
The position of the UAV in the horizontal plane comes from a GPS-module
read via a serial line. The GPS module provides data in a standard protocol
and code was written for the Javelin to translate the readings to longitude/latitude
values. For the altitude coordinate the Javelin measured the analog voltage output
from a pressure gauge. A virtual peripheral object provides for 8-bit analog-to-
digital conversion (ADC) for voltages between 0 and 5 V on any of the I/O
pins using just a few passive components (two resistors and a capacitor). For
the radiation measurements, a standard Geiger counter with passive components
and an operational amplifier gave an output proportional to the count rate, and
this output was measured with another ADC on the Javelin Stamp. Garari and
 
Search WWH ::




Custom Search