Difference between revisions of "Create SD Image Version 0.8.4"
(Created page with " === Install gnuplot=== sudo apt-get install gnuplot === -r Retries option ===") |
(→-r Retries option) |
||
Line 6: | Line 6: | ||
=== -r Retries option === | === -r Retries option === | ||
+ | |||
+ | # | ||
+ | # Get the command line options (which device/GPIO pin to read) | ||
+ | # | ||
+ | while getopts "d:'''r:'''" option | ||
+ | do | ||
+ | case "${option}" | ||
+ | in | ||
+ | d) DEVICE=${OPTARG};; | ||
+ | '''r) MAXRETRIES=${OPTARG};;''' | ||
+ | esac | ||
+ | done | ||
+ | |||
+ | # | ||
+ | # If max number of retires not specified, default to 10 | ||
+ | # | ||
+ | '''if [[ -z $MAXRETRIES ]] | ||
+ | then | ||
+ | MAXRETRIES=10 | ||
+ | fi | ||
+ | ''' | ||
+ | #echo "DEVICE = $DEVICE" | ||
+ | #echo "MAXRETRIES = $MAXRETRIES" | ||
+ | # | ||
+ | # Loop up to MAXRETRIES times trying to read the sensor | ||
+ | # | ||
+ | |||
+ | DATA_GOOD=0 | ||
+ | COUNTER=0 | ||
+ | while [ $COUNTER -lt '''$MAXRETRIES''' ] && [ $DATA_GOOD -eq 0 ] | ||
+ | do | ||
+ | .... |
Revision as of 14:27, 18 September 2018
Install gnuplot
sudo apt-get install gnuplot
-r Retries option
# # Get the command line options (which device/GPIO pin to read) # while getopts "d:r:" option do case "${option}" in d) DEVICE=${OPTARG};; r) MAXRETRIES=${OPTARG};; esac done # # If max number of retires not specified, default to 10 # if -z $MAXRETRIES then MAXRETRIES=10 fi
#echo "DEVICE = $DEVICE" #echo "MAXRETRIES = $MAXRETRIES" # # Loop up to MAXRETRIES times trying to read the sensor # DATA_GOOD=0 COUNTER=0 while [ $COUNTER -lt $MAXRETRIES ] && [ $DATA_GOOD -eq 0 ] do ....