Demo entry 6781261

Bash

   

Submitted by anonymous on Jan 02, 2019 at 14:36
Language: Bash. Code size: 394 Bytes.

#!/bin/bash
# Get information from DHT11 Temperature and Humidity Sensor
# /sys/bus/iio/devices/iio:device0
while true
do
TEMP=`cat /sys/bus/iio/devices/iio\:device0/in_temp_input`
echo "Current TEMP is: `expr $TEMP / 1000` C"
HUMIDITY=`cat /sys/bus/iio/devices/iio\:device0/in_humidityrelative_input`
echo "Current Humidityrelative is: `expr $HUMIDITY / 1000` %"
sleep 10
clear
done

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).