public class SyringePump
extends java.lang.Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
SyringePump.Direction  | 
| Constructor and Description | 
|---|
SyringePump(com.pi4j.io.gpio.GpioProvider provider,
           com.pi4j.io.gpio.Pin step,
           com.pi4j.io.gpio.Pin direction,
           com.pi4j.io.gpio.Pin enable,
           com.pi4j.io.gpio.Pin max,
           com.pi4j.io.gpio.Pin min)
Create a new syringe pump controller with specified I/O pins 
 | 
SyringePump(com.pi4j.io.gpio.Pin step,
           com.pi4j.io.gpio.Pin direction,
           com.pi4j.io.gpio.Pin enable,
           com.pi4j.io.gpio.Pin max,
           com.pi4j.io.gpio.Pin min)
Create a new syringe pump controller with specified I/O pins using only
 standard Raspberry Pi GPIO pins 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
calibratePosition()
Uses the end-stop switches to find the minimum and maximum positions of
 the stepper motor, and also determines which direction is fill and which
 direction is dispense. 
 | 
boolean | 
canStep(SyringePump.Direction direction)
Checks to see if the pump can take a step in the specified direction 
 | 
void | 
dispenseVolume(double mL)
Dispenses the specified volume in mL from the pump. 
 | 
void | 
setMaxVolume()
Stores the syringe volume measurement when pump is in max (full)
 position. 
 | 
void | 
setMinVolume()
Stores the syringe volume measurement when pump is in min (empty)
 position. 
 | 
void | 
setStepDelay(int delay)
Sets speed of pump by changing delay between steps 
 | 
int | 
takeSteps(int numSteps,
         SyringePump.Direction direction)
Takes a number of steps in the specified direction 
 | 
public SyringePump(com.pi4j.io.gpio.GpioProvider provider,
                   com.pi4j.io.gpio.Pin step,
                   com.pi4j.io.gpio.Pin direction,
                   com.pi4j.io.gpio.Pin enable,
                   com.pi4j.io.gpio.Pin max,
                   com.pi4j.io.gpio.Pin min)
provider - Pin provider, if the pin isn't a standard RPi GPIO pinstep - Pin used to instruct pump's motor to take one stepdirection - Pin used to choose the pump's directionenable - Pin used to enable or disable the pump motormax - Pin which indicates when the pump is at its max positionmin - Pin which indicates when the pump is at its min positionpublic SyringePump(com.pi4j.io.gpio.Pin step,
                   com.pi4j.io.gpio.Pin direction,
                   com.pi4j.io.gpio.Pin enable,
                   com.pi4j.io.gpio.Pin max,
                   com.pi4j.io.gpio.Pin min)
step - Pin used to instruct pump's motor to take one stepdirection - Pin used to choose the pump's directionenable - Pin used to enable or disable the pump motormax - Pin which indicates when the pump is at its max positionmin - Pin which indicates when the pump is at its min positionpublic void calibratePosition()
public void setMaxVolume()
public void setMinVolume()
public void setStepDelay(int delay)
delay - Time in ms between stepspublic int takeSteps(int numSteps,
                     SyringePump.Direction direction)
              throws java.lang.InterruptedException
numSteps - Number of steps to takedirection - Which direction to move the pumpjava.lang.InterruptedException - If there is a problem when thread sleeps.public boolean canStep(SyringePump.Direction direction)
direction - Which direction to checkpublic void dispenseVolume(double mL)
mL - Volume in milliliters to dispense