Lenguaje de maquina
Enviado por Elmervsquez • 13 de Octubre de 2022 • Trabajo • 6.368 Palabras (26 Páginas) • 51 Visitas
MONITOREO
#!/bin/bash
while true
do
valgpio17=`cat /sys/class/gpio/gpio17/value`
valgpio27=`cat /sys/class/gpio/gpio27/value`
valgpio21=`cat /sys/class/gpio/gpio21/value`
valgpio10=`cat /sys/class/gpio/gpio10/value`
valgpio11=`cat /sys/class/gpio/gpio11/value`
tput clear
tput cup 5 8; echo -e '\e[1;32m GPIO ESTADO VALOR \e[0m'
if [ $valgpio17 == '1' ]
then
tput cup 7 6; echo -e '\e[1;34m Gpio17on \e[0m'
tput cup 7 22; echo -e '\e[1;33m -ON- \e[0m'
tput cup 7 36; echo $valgpio17
else
if [ $valgpio17 == '0' ]
then
tput cup 7 6; echo -e '\e[1;34m Gpio17on \e[0m'
tput cup 7 22; echo -e '\e[1;31m -OFF- \e[0m'
tput cup 7 36; echo $valgpio17
fi
fi #Fin de gpio17
if [ $valgpio27 == '1' ]
then
tput cup 9 6; echo -e '\e[1;34m Gpio27on \e[0m'
tput cup 9 22; echo -e '\e[1;33m -ON- \e[0m'
tput cup 9 36; echo $valgpio27
else
if [ $valgpio27 == '0' ]
then
tput cup 9 6; echo -e '\e[1;34m Gpio27on \e[0m'
tput cup 9 22; echo -e '\e[1;31m -OFF- \e[0m'
tput cup 9 36; echo $valgpio27
fi
fi
#Fin de gpio27
if [ $valgpio21 == '1' ]
then
tput cup 11 6; echo -e '\e[1;34m Gpio21on \e[0m'
tput cup 11 22; echo -e '\e[1;33m -ON- \e[0m'
tput cup 11 36; echo $valgpio21
else
if [ $valgpio21 == '0' ]
then
tput cup 11 6; echo -e '\e[1;34m Gpio21on \e[0m'
tput cup 11 22; echo -e '\e[1;31m -OFF- \e[0m'
tput cup 11 36; echo $valgpio21
fi
fi
#Fin de gpio21
if [ $valgpio10 == '1' ]
then
tput cup 13 6; echo -e '\e[1;34m Gpio10on \e[0m'
tput cup 13 22; echo -e '\e[1;33m -ON- \e[0m'
tput cup 13 36; echo $valgpio10
else
if [ $valgpio10 == '0' ]
then
tput cup 13 6; echo -e '\e[1;34m Gpio10on \e[0m'
tput cup 13 22; echo -e '\e[1;31m -OFF- \e[0m'
tput cup 13 36; echo $valgpio10
fi
fi
#Fin de gpio10
if [ $valgpio11 == '1' ]
then
tput cup 15 6; echo -e '\e[1;34m Gpio11on \e[0m'
tput cup 15 22; echo -e '\e[1;33m -ON- \e[0m'
tput cup 15 36; echo $valgpio11
else
if [ $valgpio11 == '0' ]
then
tput cup 15 6; echo -e '\e[1;34m Gpio11on \e[0m'
tput cup 15 22; echo -e '\e[1;31m -OFF- \e[0m'
tput cup 15 36; echo $valgpio11
fi
fi
#Fin de gpio11
sleep 0.5
done
CONTROL DE GPIO
#!/bin/bash
tput clear
tput cup 5 15; echo -e '\e[1;34m---MONITOR---\e[0m'
...