NGEngineControl is an Arduino library for eNGine Shield. The code only works with eNGine Shield.
The NGEngineControl class can controls 4 engines in cooperation with eNGine Shield.
- NGEngineControl(int engine)
The parameter engine indicates the respective engine, possible values are ENGINE_0, ENGINE_1, ENGINE_2 and ENGINE_3. The default serialRate is DEFAULTSERIALRATE.
- NGEngineControl(int engine, int serialRate)
The parameter engine indicates the respective engine, possible values are ENGINE_0, ENGINE_1, ENGINE_2 and ENGINE_3. ENGINE_3 controlled only speed 0(stop) or 255(fullspeed).
- initialize()
This method initialize the engine control. The default speed is NULLSPEED.
- initialize(int speed)
This method initialize the engine control with speed.
- setLogging(bool logging)
This method activate or deactivate the logging.
- setSpeed(int speed)
This method set the speed instantly with interval NULLINTERVAL.
- setSpeed(int speed, int interval)
This method set the speed and the interval in ms.
- run(engineDirection direction)
This method run then engine in direction edNone, edForward and edBackward.
- stop()
This mehod stop the engine with interval NULLINTERVAL.
- stop(int interval)
This mehod stop the engine with interval in ms.
The NGJointControl class can controls 3 joints in cooperation with eNGine Shield. A joint consists as an engine and a transducer for giving the radiant.
- NGJointControl(int joint)
The parameter joint indicates the respective joint, possible values are JOINT_0, JOINT_1 and JOINT_2. The corresponding engine ist ENGINE_0, ENGINE_1 and ENGINE_2. The default serialRate is DEFAULTSERIALRATE.
- NGJointControl(int joint, int engine)
The parameter joint indicates the respective joint, possible values are JOINT_0, JOINT_1 and JOINT_2 and the corresponding engine. The default serialRate is DEFAULTSERIALRATE.
- NGJointControl(int joint, int engine, int serialRate)
The parameter joint indicates the respective jointe, possible values are JOINT_0, JOINT_1 and JOINT_2 and the corresponding engine.
- initialize(int minRad, int maxRad, int maxSpeed)
This method initialize the joint control. The default name is NONAME.
- initialize(char* name, int minRad, int maxRad, int maxSpeed)
This method initialize the joint control with a name.
- setMinJointRad(int value)
This method set the minimum joint radiant. This value is given 0 between 1024.
- getMinJointRad()
This method get back the minimum joint radiant.
- setMaxJointRad(int value)
This method set the maximum joint radiant. This value is given 0 between 1024.
- getMaxJointRad()
This method get back the maximum joint radiant.
- setMaxSpeed(int value)
This method set the maximum speed of joint. This value is given 0 between 255.
- getMaxSpeed
This method get back the maximum joint speed.
- setLogging(bool logging)
This method activate or deactivate the logging.
- getName()
This method give back the name of joint.
- read()
This method give back the current radiant of joint.
- move(int targetRad)
This method move the joint to given radiant.
- simulate()
This method move the joint to the minimum or maximum.
The NGGripperControl class can controls a gripper in cooperation with eNGine Shield. A gripper required an engine.
- NGGripperControl(int engine)
The parameter engine indicates the respective engine, possible values are ENGINE_0, ENGINE_1 and ENGINE_3. The default serialRate is DEFAULTSERIALRATE.
- NGGripperControl(int engine, int serialRate)
The parameter engine indicates the respective engine, possible values are ENGINE_0, ENGINE_1 and ENGINE_3.
- initialize(int minSpeed, int maxSpeed)
This method initialize the gripper control with min and max speed.
- grip
This method grip the gripper. The default delay is DEFAULTGRIPDELAYONE and DEFAULTGRIPDELAYTWO.
- grip(unsigned long delayOne, unsigned long delayTwo)
This method grip the gripper.
- release
This method release the gripper. The default delay is DEFAULTRELEASEDELAYONE and DEFAULTRELEASEDELAYTWO.
- release(unsigned long delayOne, unsigned long delayTwo)
This method release the gripper.