Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Documentation and Refined Variable Declarations #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DHT.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define DHT_ERROR_TIMEOUT 2

// GLOBAL VARIABLES
uint8_t dht_pin = 3; // default GPIO 22 (wiringPi 3)
uint8_t dht_pin = 3; // default GPIO 22 (wiringPi 3) - https://pinout.xyz/pinout/wiringpi
char mode = 'c'; // valid modes are c, f, k, h, j
int data[5] = { 0, 0, 0, 0, 0 };
int debug = 0;
Expand Down
2 changes: 1 addition & 1 deletion MMM-LocalTemperature.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* MIT Licensed.
*/

var axis, Log, config;
var axis, Log; // removed config

/**
* Register the module with the MagicMirror program
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ This module reads and displays temperature and humidity information from a senso
To install the module, use your terminal to:
1. Navigate to your MagicMirror's modules folder. If you are using the default installation directory, use the command:<br />`cd ~/MagicMirror/modules`
2. Copy the module to your computer by executing the following command:<br />`git clone https://github.com/glitch452/MMM-LocalTemperature.git`
3. Install the WiringPi library by executing the following command:<br />`sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y install build-essential wiringpi`
**Note:** If running on Raspberry Pi 4, use the following process to update wiringpi
[http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b](http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b)
4. Make sure the `DHT` program that reads the sensor data is executable by executing the following command:<br />`cd MMM-LocalTemperature && chmod +x DHT`
3. Install the WiringPi library from [GitHub](https://github.com/WiringPi/WiringPi). Simply clone the repository and run ´./build´.
4. Make sure the [DHT](Customizing the DHT Program) program that reads the sensor data is executable by executing the following command:<br />`cd MMM-LocalTemperature && chmod +x DHT`

## Using the module

Expand Down Expand Up @@ -99,6 +97,8 @@ The `DHT` program is a `c` coded program used to read the sensor data. A `c` pro

The included `DHT` program is something I pieced together based on code from [dht22 by nebulx29](https://github.com/nebulx29/dht22) and the [Python DHT Sensor Library by Adafruit](https://github.com/adafruit/Adafruit_Python_DHT).

Verify that the correct pin is defined in `DHT.c`. Make sure the WiringPi pin number is set (you can find the WiringPi pin number for the GPIO pin [here](https://pinout.xyz/pinout/wiringpi)).

If you would like to customize the `DHT` program, you can edit the file `DHT.c` with your favorite editor, then re-compile it using the following command: `cc -Wall DHT.c -o DHT -lwiringPi`

## Updates
Expand Down Expand Up @@ -143,4 +143,4 @@ conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.**
**The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.**