Comments (2)
I don't remember off the top of my head why this logic is there (i.e. 0
being considered the longest period), and it might as well be wrong, but I
don't think this would fix your problem.
Chances are that your input signal is noisy, causing you to get bogus
pulses.
The blocking behaviour is intentional. If you want to time out, you can use
a TimerTask to interrupt you. See the forum for more details - this is a
recurring question.
On Sat, Nov 2, 2013 at 1:40 PM, Thomas Hermansson
[email protected]:
Dear Ytai!
Many thanks for creating IOIO, Some 6 years ago I built a weatherstation
based on the Cinterion TV65 device, but it was horrible unstable so the
IOIO will now be used for my next revision of www.surfvind.se.However when experimenting with the pulseInput api it appears to me as if
the getFrequency returns bogus data when no pulses at all are received.I use:
pulseCounter = ioio.openPulseInput(spec, ClockRate.RATE_62KHz,
PulseMode.FREQ, true);
freq = pulseCounter.getFrequency();First of all, as getFrequency blocks while waiting for pulses, this means
that this call blocks a very long time if no pulses arrive. (I have an
anemometer connected to this pulsecounter, and if no wind = no pulses). At
some point getFrequency returns, and it then returns an incorrect freq.While looking in IncapImpl.java I see that dataReceived is called with all
data array =0. ByteArrayToLong is then called and at the end of this
function we see the following lines:if (result == 0) {
result = 1 << (size * 8);
}This results in lastDuration beeing set to 256, 65536 etc which ends up
giving a frequency that is incorrect.I have not yet figured out why ByteArrayToLong does this at the end, am I
missing any part?Kind Regards
Thomas Hermansson
TNA Software AB
Sweden—
Reply to this email directly or view it on GitHubhttps://github.com//issues/70
.
from ioio.
Hi Ytai!
There is unfortunately no noice on the input. I have measured it with my
Rigol 20MHz oscilloscope and the signal shows only small noice between
3.3-3.2Volt. I've run it for a long time with a trigger at around 1.5V
without any hit. So I think that part can be ruled out.
The blocking part is not an issue, just abit annoying. :-)
But it is abit strange that datareceived sometimes returns 1. I will debug
this abit more once I get the time, but I became a father yesterday, so
chances are that my spare time gets reduced. ;-)
//Thomas
Den 3 nov 2013 00:12 skrev "Ytai Ben-Tsvi" [email protected]:
I don't remember off the top of my head why this logic is there (i.e. 0
being considered the longest period), and it might as well be wrong, but I
don't think this would fix your problem.
Chances are that your input signal is noisy, causing you to get bogus
pulses.
The blocking behaviour is intentional. If you want to time out, you can
use
a TimerTask to interrupt you. See the forum for more details - this is a
recurring question.On Sat, Nov 2, 2013 at 1:40 PM, Thomas Hermansson
[email protected]:Dear Ytai!
Many thanks for creating IOIO, Some 6 years ago I built a weatherstation
based on the Cinterion TV65 device, but it was horrible unstable so the
IOIO will now be used for my next revision of www.surfvind.se.However when experimenting with the pulseInput api it appears to me as
if
the getFrequency returns bogus data when no pulses at all are received.I use:
pulseCounter = ioio.openPulseInput(spec, ClockRate.RATE_62KHz,
PulseMode.FREQ, true);
freq = pulseCounter.getFrequency();First of all, as getFrequency blocks while waiting for pulses, this
means
that this call blocks a very long time if no pulses arrive. (I have an
anemometer connected to this pulsecounter, and if no wind = no pulses).
At
some point getFrequency returns, and it then returns an incorrect freq.While looking in IncapImpl.java I see that dataReceived is called with
all
data array =0. ByteArrayToLong is then called and at the end of this
function we see the following lines:if (result == 0) {
result = 1 << (size * 8);
}This results in lastDuration beeing set to 256, 65536 etc which ends up
giving a frequency that is incorrect.I have not yet figured out why ByteArrayToLong does this at the end, am
I
missing any part?Kind Regards
Thomas Hermansson
TNA Software AB
Sweden—
Reply to this email directly or view it on GitHub<
https://github.com/ytai/ioio/issues/70>
.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-27634868
.
from ioio.
Related Issues (20)
- Using Android Phone as Host HOT 3
- IOIO for Android 7 HOT 3
- Android targetSdkVersion 13 doesn't connect to IOIO after display is rotated HOT 2
- how to change the key pair name HOT 1
- Unable to connect via bluetooth
- Bluetooth disconnecting
- Release Notes HOT 5
- Question HDMI HOT 1
- Create Personal Access Token to Run CI checks on Update Gradle Wrapper Action PRs HOT 1
- Licence? HOT 3
- Looking for the ioio led matrix apk HOT 1
- Android Compiling but no interaction with the board HOT 4
- High latency when using Uart over USB HOT 2
- Implement IOIO into an existing app HOT 4
- README unresolvable dependency com.github.ytai.ioio:IOIOLibAndroidBluetooth:$LATEST HOT 1
- Unknown maven repos in project build.gradle HOT 2
- Waiting for handshake HOT 2
- BLUETOOTH_CONNECT should be limited to SDK 30 HOT 4
- spiMaster.writeRead write buffer transaction limit HOT 6
- Implementation problem in android studio HOT 5
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 ioio.