public void setupNodePorts() {
super.setupNodePorts();
leds = new Leds(cpu, LEDS);
accelerometer = new MMA7260QT(cpu);
ADC12 adc = cpu.getIOUnit(ADC12.class, "ADC12");
adc.setADCInput(4, new ADCInput() {
public int nextData() {
return accelerometer.getADCX();
}
});
adc.setADCInput(5, new ADCInput() {
public int nextData() {
return accelerometer.getADCY();
}
});
adc.setADCInput(6, new ADCInput() {
public int nextData() {
return accelerometer.getADCZ();
}
});