-
Notifications
You must be signed in to change notification settings - Fork 1
Protocol Rpi Arduino
This page will describe the messages sent and received by the arduino module.
All message ends with a \n
(new line).
Each command must be acknowledged by sending the same command back on the serial line.
This indicate the arduino that it has to do the homing procedure. After that the position of the carier should be 0mm.
h
This command is used by the backend to tare the scale. After a tare, the weight status should be 0 grame.
t
This command set the position of the carier relative to the home position, the servo to use and the quantity of the liquid in grams
f:{distanceInMm}:{servoId}:{gr}
Examples
f:0:0:0
carrier goes back home. Servo is ignored
f:100:2:50
carrier goes to 100mm from home and fill 50gr of the liquid using the servo 2
Move the carrier to the given position
m:{distanceInMm}
Set the servo aperture in percent. 0
% means closed, 100
% means full open.
a:{servoId}:{percentage}
Queue a liquid to fill (do this only when everything is ready). The queue size is limited. If you queue too much element they will be ignored.
q:{servoId}:{gramme}
Clear the queue
c
Stop everything and close the servo
e
Release the stepper motor.
r
Each 50ms (configurable) a status message is sent to the serial line. The message should contain the distance of the carrier relative to the home position, the current weight of the load on the carrier and the pression inside the chamber in milli bar.
a:{distanceInMm}:{weightInGr}:{pressionMilliBar}:{queuesize}:{fps}
Examples
s:0:0
home position, no load (maybe we just tare the scale)
s:150:200
carier at position 15cm and 200gr on scale