public void loadEnable(boolean en) { if (en) { loadenable = true; ibd.setValue(ibd.GPIO, 0); } else { loadenable = false; ibd.setValue(ibd.GPIO, 1); } }
public double getCurrent() { if (!ibd.isLocked()) current = afilter.getValue(ibd.getValue(ibd.ADC1) * I_CONST); return current; }
public double getVoltage() { if (!ibd.isLocked()) voltage = vfilter.getValue(ibd.getValue(ibd.ADC0) * V_CONST); return voltage; }
public void changeCurrent(int r) { if ((pwm_c + r) < 0 || (pwm_c + r) > Iboard.MAX_PWM_VALUE || ibd.isLocked()) return; pwm_c += r; ibd.setValue(ibd.PWM1, pwm_c); }
public void changeVoltage(int r) { if ((pwm_v + r) < 0 || (pwm_v + r) > Iboard.MAX_PWM_VALUE || ibd.isLocked()) return; pwm_v += r; ibd.setValue(ibd.PWM0, pwm_v); }
public void stop() { pwm_c = 0; pwm_v = 0; ibd.setValue(ibd.PWM0, pwm_v); ibd.setValue(ibd.PWM1, pwm_c); }