olivierld / raspberry-coffee Goto Github PK
View Code? Open in Web Editor NEWJVM related (Java, Groovy, Scala, Kotlin, etc) samples for the Raspberry PI, relying on PI4J. IoT and friends.
Home Page: http://raspberrypi.lediouris.net/
JVM related (Java, Groovy, Scala, Kotlin, etc) samples for the Raspberry PI, relying on PI4J. IoT and friends.
Home Page: http://raspberrypi.lediouris.net/
Hi Olivier,
Firstly, thanks for sharing! I took a copy of your BMP180.java and adapted it for the BME280 by taking logic from Adafruit's bme280.py. This device includes a humidity sensor and appears to be little-endian.
When readS16() forms a little-endian result it reads the hi byte as unsigned and the lo byte as signed whereas it should be the other way around. This bug doesn't affect the BMP180 as that device is presumably big-endian.
BTW I also have a BMP180 and your code works as-is with this device.
ttfn,
Aidan.
Hi could you please share more details about how it's working the text console and how is hardware linke to raspberry?
Thanks
Paolo
Thanks for providing this. I also have a boat and solar panel. I'm also using a Witty Pi, USB router and modem to schedule and send back pictures and GPS details. Trying to implement the battery monitor too and seeing the following Exception after initial reading:
pi@raspberrypi:~/raspberry-pi4j-samples $ sudo ./gradlew [--daemon] build
FAILURE: Build failed with an exception.
What went wrong:
Task 'C' is ambiguous in root project 'raspberry-pi4j-samples'. Candidates are: 'check', 'chordFinder', 'classes', 'clean', 'clojureRepl', 'clojureTest', 'clojuredoc', 'combineJs', 'compileClojure', 'compileGroovy', 'compileJava', 'compileKotlin', 'compileScala', 'compileTestGroovy', 'compileTestJava', 'compileTestKotlin', 'compileTestScala', 'components', 'copyResources'.
Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 10s
pi@raspberrypi:~/raspberry-pi4j-samples $
pi@raspberrypi:~/raspberry-pi4j-samples/ADC $ ./battery.monitor -min=289:3.75 -max=872:11.75 -debug=y
Read an ADC
Parameters are:
-calibration or -cal
-debug=y|n|yes|no|true|false - example -debug=y (default is n)
-ch=[0-7] - example -ch=0 (default is 0)
-min=minADC:minVolt - example -min=280:3.75 (default is 0:0.0)
-max=maxADC:maxVolt - example -min=879:11.25 (default is 1023:15.0)
-tune=ADC:volt - example -tune=973:12.6 (default is 1023:15.0)
-scale=y|n - example -scale=y (default is n)
-log=[log-file-name] - example -log=[batt.csv] (default is battery.log)
-min & -max are required if -tune is not here, and vice versa.
Prms: ADC Channel:0, MinADC:289, MinVolt:3.75, MaxADC:872, maxVolt:11.75
Volt [3.75, 11.75]
ADC [289, 872]
a=0.013227414, b=0.21569468
Value range: ADC=0 => V=0.21569468, ADC=1023 => V=13.747339
readAdc:858 (0x35A, 0&1101011010) Volume:83% (858) Volt:11.56
Exception in thread "main" java.lang.NullPointerException
at adc.sample.BatteryMonitor$1.valueUpdated(BatteryMonitor.java:145)
at adc.ADCContext.fireValueChanged(ADCContext.java:39)
at adc.ADCObserver.start(ADCObserver.java:121)
at adc.ADCObserver.start(ADCObserver.java:85)
at adc.sample.BatteryMonitor.(BatteryMonitor.java:154)
at adc.sample.BatteryMonitor.(BatteryMonitor.java:89)
at adc.sample.BatteryMonitor.main(BatteryMonitor.java:264)
Shutting down
Closing log file
Not sure if you can advise?
Thanks, Doug
returning x10 smaller distance that it is
Can I use your code in an Open Source Project under the GPLv3 license? I couldn't find any licensing information in your repository.
In RESTTideServer
, in some cases I still need to identify (specially when switching between stations on different time zones), you need to hit Draw Curve
twice to get to the right data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.