forked from machinekit/machinekit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathM109
executable file
·27 lines (23 loc) · 847 Bytes
/
M109
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# M109: Set Extruder Temperature and Wait
# M109 in Marlin, Sprinter (ATmega port)
# Set extruder heater temperature in degrees celsius and wait for this
# temperature to be achieved.
# Example: M109 S185
temp_required=$1
temp_actual=$(halcmd getp Therm.temp0)
halcmd sets e0.temp.set $temp_required
#bash cannot do floating point comparison
T_extruder_smaller_than_T_required=`echo "scale=3; ($temp_actual < $temp_required)"| bc -l`
#echo "Ta<Tr? $T_extruder_smaller_than_T_required"
while [ "$T_extruder_smaller_than_T_required" != "0" ]
do
# echo enter while loop
temp_actual=$(halcmd getp Therm.temp0)
# echo temp_actual= $temp_actual
sleep 1
T_extruder_smaller_than_T_required=`echo "scale=3; ($temp_actual < $temp_required)"| bc -l`
# echo "Ta<Tr? $T_extruder_smaller_than_T_required"
done
#echo temp reached
exit 0