Comments (12)
@caternuson stemma sorta relies on delays to manage timing, and the Pi is much faster. since you have it set up can you try inserting delays into seesaw? like in between the i2c send and receive command
from adafruit_blinka.
Looks like there's already a delay mechanism in place?
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/master/adafruit_seesaw/seesaw.py#L380
moisture_read
calls that with a delay value of 0.005:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/master/adafruit_seesaw/seesaw.py#L236
So just try bumping that 0.005 up?
from adafruit_blinka.
yep try 20ms or more time thx
from adafruit_blinka.
Tried several, all the way up 1/2 a sec. Still gets spurious reads.
0.010
02-07-19 20:35:28 745.0 20.026262214882003
02-07-19 20:35:49 764.2 19.896068200410003
02-07-19 20:36:09 4043.7 19.864850262408005
02-07-19 20:36:29 741.1 19.929281986836003
02-07-19 20:36:49 780.3 19.94920690176
0.020
02-07-19 20:35:28 745.0 20.026262214882003
02-07-19 20:35:49 764.2 19.896068200410003
02-07-19 20:36:09 4043.7 19.864850262408005
02-07-19 20:36:29 741.1 19.929281986836003
02-07-19 20:36:49 780.3 19.94920690176
0.050
02-07-19 20:44:12 758.2 19.939909727106006
02-07-19 20:44:32 712.9 19.886105742948
02-07-19 20:44:53 4094.9 19.853557239330005
02-07-19 20:45:14 723.4 19.886771025756
02-07-19 20:45:34 812.7 19.842929499060002
0.500
02-07-19 20:17:01 781.2 19.843594781868
02-07-19 20:17:26 748.0 19.961165207646
02-07-19 20:17:51 4020.2 19.841598933444
02-07-19 20:18:16 773.7 19.929947269644
02-07-19 20:18:41 752.9 19.85355723933
from adafruit_blinka.
weird, can you see what the raw value, pre floatification, is?
from adafruit_blinka.
OK, floatification was coming from the averaging math. This seems to be something else, so don't need to worrying about averaging. Getting rid of that and now just doing this with LOG_RATE=1
:
while True:
moisture = ss.moisture_read()
temperature = ss.get_temp()
time_stamp = datetime.datetime.now().strftime("%m-%d-%y %H:%M:%S")
print(time_stamp, moisture, temperature)
log_data(time_stamp, moisture, temperature)
time.sleep(LOG_RATE)
Then only test original 0.005 and 0.020, the spurious read is:
0.005
02-07-19 21:36:42 708 19.79709212394
02-07-19 21:36:43 767 19.79709212394
02-07-19 21:36:44 33600 19.910022354720002
02-07-19 21:36:45 881 20.22885456282
02-07-19 21:36:46 784 20.122577160120002
0.020
02-07-19 21:38:21 820 19.79709212394
02-07-19 21:38:22 889 20.01629975742
02-07-19 21:38:23 33654 19.910022354720002
02-07-19 21:38:25 867 19.910022354720002
02-07-19 21:38:26 945 20.01629975742
from adafruit_blinka.
man who knows - it shouldn't be that high, i think max value is 4096 - i think we should re-try in the lirbary if the touch reading is above 4096 (try pressing your palm against it to see the max value
from adafruit_blinka.
hey just checking back, did you find any solution or workaround?
from adafruit_blinka.
Sorry, not yet. Broke down the actual plant setup to bring back to bench and got buried.
Getting rid of file logging and averaging and just doing a simple readout loop:
import time, datetime
import board, busio
from adafruit_seesaw.seesaw import Seesaw
i2c = busio.I2C(board.SCL, board.SDA)
ss = Seesaw(i2c, addr=0x36)
while True:
moisture = ss.moisture_read()
temperature = ss.get_temp()
time_stamp = datetime.datetime.now().strftime("%m-%d-%y %H:%M:%S")
print(time_stamp, moisture, temperature)
time.sleep(1)
Holding thumb over entire sense area, looks like 1015 is max, but can still get the odd ball reading. This is with a delay of 0.020 in the seesaw lib.
02-15-19 20:53:53 1015 27.4226979465
02-15-19 20:53:54 1015 27.3164205438
02-15-19 20:53:55 33783 27.5356129185
02-15-19 20:53:56 1015 27.74818298268
02-15-19 20:53:57 1015 27.4226979465
Given how different the odd reading is, an out of bounds check would be pretty easy to add. But would be nice to know where it's coming from.
from adafruit_blinka.
unfortunately its probably in the seesaw lib in a way i cant easily fix...so out of bounds check is the best option, check for a max of 4095
from adafruit_blinka.
OK. I can PR that. Want to close this issue and open a new one in https://github.com/adafruit/Adafruit_CircuitPython_seesaw ?
from adafruit_blinka.
issue cant be moved there for some reason, so opened there, closin' here!
from adafruit_blinka.
Related Issues (20)
- Add board: BOARD=orangepi3-lts HOT 1
- ADD BANANAPI CM4 BOARD
- ADD BANANAPI CM4 BOARD SUPPORT
- DietPi - Error installing Adafruit-Blinka HOT 1
- any check scripts that should be performed before issuing a PR for adding a new board
- Adafruit-PlatformDetect version 3.66.0 was unable to identify the board HOT 3
- Cant find the board HOT 6
- Some microcontroller definitions may be incorrect.
- libgpiod_pin_1_x.py does not detect internal pulldowns HOT 1
- GT911 touch sensor support for Adafruit Blinka HOT 7
- adafruit-circuitpython-motor fails with "RuntimeError: Cannot determine SOC peripheral base address" on Raspberry Pi 5 HOT 12
- Adafruit-Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 13
- Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 2
- support for NXP i.MX 8M PLUS HOT 3
- pip try to install sysv-ipc on Windows HOT 26
- It is no longer possible to install from 8.44.0. HOT 4
- Getting error in WCMCU-200 I2c to USB Adapter
- Add New Board adafruit FT232H Breakout for adafruit-blinka HOT 3
- Add Orange Pi AIPro
- Remove dependency to numpy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_blinka.