Beispiel #1
0
 public void loadEnable(boolean en) {
   if (en) {
     loadenable = true;
     ibd.setValue(ibd.GPIO, 0);
   } else {
     loadenable = false;
     ibd.setValue(ibd.GPIO, 1);
   }
 }
Beispiel #2
0
 public double getCurrent() {
   if (!ibd.isLocked()) current = afilter.getValue(ibd.getValue(ibd.ADC1) * I_CONST);
   return current;
 }
Beispiel #3
0
 public double getVoltage() {
   if (!ibd.isLocked()) voltage = vfilter.getValue(ibd.getValue(ibd.ADC0) * V_CONST);
   return voltage;
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 public void stop() {
   pwm_c = 0;
   pwm_v = 0;
   ibd.setValue(ibd.PWM0, pwm_v);
   ibd.setValue(ibd.PWM1, pwm_c);
 }