Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andriadze/ds18b20wiringpi
Bitbanging DS18B20 sensor through WiringPi
https://github.com/andriadze/ds18b20wiringpi
Last synced: about 21 hours ago
JSON representation
Bitbanging DS18B20 sensor through WiringPi
- Host: GitHub
- URL: https://github.com/andriadze/ds18b20wiringpi
- Owner: andriadze
- License: mit
- Created: 2018-05-29T10:57:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-29T11:54:33.000Z (over 6 years ago)
- Last Synced: 2024-11-08T22:42:49.843Z (about 2 months ago)
- Language: C
- Size: 18.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DS18B20WiringPi
Bitbanging DS18B20 sensor through WiringPi# Built on top of @danjperron-s:
https://github.com/danjperron/BitBangingDS18B20I simplified it to a bare minimum. Changed it over to WiringPi and added Java Binding. Tested and working on Raspberry Pi3 and NanoPi Neo.
# Use case:
This code enables you to place DS18B20 sensor on any pin on all devices that support WiringPi.
Please notify me if you test this code on any new devices.
# Pick a Pin:
Change this value in **c_test.c** and **TempCReader.c**:
```c
#define DS18B20_PIN_NUMBER 7
```# Compiling:
### NOTE: These instructions are originally for NanoPi Neo. With Oracle JDK installed.
### Just C version:
Copy test_c.c to your device and run:
`gcc -Wall -o test test_c.c -lwiringPi -lpthread`
To run use:
`./test`
### Java Version:
Copy files from java folder to your device.
To compile run:
`gcc -fPIC -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -shared -o libds18temp.so TempCReader.c -lwiringPi -lpthread`
This will give you libds18temp.so. You can place this file in java library path or any folder just make sure to change to correct path in **TempSensorJNI.java**
After changing the path compile java file and run it.