All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.hardware.sensor.CodeTemplate Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.hardware.sensor;

import lejos.hardware.port.Port;
import lejos.hardware.port.UARTPort;
import lejos.robotics.SampleProvider;

/**
 * Sensor name
* Description * *

* The code for this sensor has not been tested. Please report test results to * the leJOS forum. *

* *

*

* * * * * * * * * * * * * * * *
Supported modes
Mode nameDescriptionunit(s)Getter
Some {@link #getSomeMode() }
* * *

* Sensor configuration
* Description of default sensor configuration (when that matters). Description * of available methods for configuration. * *

* * See Sensor datasheet * See Sensor Product page * See The * leJOS sensor framework * See {@link lejos.robotics.SampleProvider leJOS conventions for * SampleProviders} * *

* * * @author Your name * */ public class CodeTemplate extends UARTSensor { /** * Constructor using a unopened port * * @param port */ public CodeTemplate(Port port) { super(port); init(); } /** * Constructor using a opened and configured port * * @param port */ public CodeTemplate(UARTPort port) { super(port); init(); } /** * Configures the sensor for first use and registers the supported modes * */ protected void init() { setModes(new SensorMode[] { new SomeMode() }); } /** * Sensor name, mode
* Mode description * *

* Size and content of the sample
* The sample contains # elements. Each element gives Something (in some * unit). * *

* Configuration
* The sensor is configured for.... . Currently there are no configurable * settings. * * @return A sampleProvider * See {@link lejos.robotics.SampleProvider leJOS conventions for * SampleProviders} * See Sensor datasheet */ public SampleProvider getSomeMode() { return getMode(0); } private class SomeMode implements SensorMode { @Override public int sampleSize() { // TODO Auto-generated method stub return 0; } @Override public void fetchSample(float[] sample, int offset) { // TODO Auto-generated method stub } @Override public String getName() { // TODO Auto-generated method stub return "Some"; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy