I'm currently playing around with a Chirp! unit and I'm running into some strange issues with the module. I'm using this code from the developer and I keep getting strange results where the light reading will be the same as the capacitance reading and the temperature reading seems off as well.
Capacitance: 69835 Temp: -1.0 Light 69835 (or sometimes blank)
Has anyone used this module before or see something obvious that I'm doing/something in the code? It was working fine a few days ago so I'm not sure what has changed as I've been playing with the code but now this one doesn't seem to work with no modification.
I have not used anything besides an Uno at this point, why would a Due be a better choice? Sorry if this is an obvious answer question too.
And I was going off memory for the capacitance reading, it was the same as the light so I was worried it was the code possibly reading the same info for the light and capacitance.
Noige:
I have not used anything besides an Uno at this point, why would a Due be a better choice? Sorry if this is an obvious answer question too.
And I was going off memory for the capacitance reading, it was the same as the light so I was worried it was the code possibly reading the same info for the light and capacitance.
It wouldn't.
I asked how a value of 69000-some could possibly be printed for an unsigned int, since unsigned int could not store something greater than 65531 (2^16-1). Paul suggested that you must be using a Due, since there the unsigned int is 32 bits (so up to 4.2 billion)
Therefor, we have a real mystery for that output.
Or are you saying that you made up those numbers? If so, go get the real numbers and post them, otherwise you're just wasting your time and ours.
I see this a lot here, and I just do not understand it. People make up output that they think looks kinda like how they remember it - you have the code, you have the hardware, why can you not provide the actual output? If the answer is "I'm not home now", then you should wait to post until you are home and have access to the actual output string!
I asked how a value of 69000-some could possibly be printed for an unsigned int, since unsigned int could not store something greater than 65531 (2^16-1). Paul suggested that you must be using a Due, since there the unsigned int is 32 bits (so up to 4.2 billion)
Therefor, we have a real mystery for that output.
Or are you saying that you made up those numbers? If so, go get the real numbers and post them, otherwise you're just wasting your time and ours.
I see this a lot here, and I just do not understand it. People make up output that they think looks kinda like how they remember it - you have the code, you have the hardware, why can you not provide the actual output? If the answer is "I'm not home now", then you should wait to post until you are home and have access to the actual output string!
You're exactly right, not at home at the moment. I know that value was high and matching the light value so I was thinking it was something in the code. I didn't realize I was so close to the upper limit of the unsigned int otherwise I wouldn't have gone off memory. It very well could have been 65531 but I don't know enough about the unsigned int to know if it will produce that value if readings exceed it's max output.
Still learning a lot about this stuff so I appreciate your patience and will post specific outputs when I'm home.
The value that I was receiving for the capacitance was actually 65531 which is not right. I started to think I had a communication problem with the I2C so I ran the I2C scanner and it gets stuck on "scanning".
Put on an LCD (I2C comm.) and it read the 0x20 address fine and also checked a motor shield with no issues.
I'm beginning to think it's an I2C communication issue. Following the setup for the original code I have the following hooked up. Arduino A5 and A4 I have a 4.6k pull up resistor to 5v. I have tried a 10k resistor with similar results.
I have been using the chirp to display the output to a i2c lcd and I am using similar code as yours (after changing it to lcd) but the values are messed up. So the light value is always 65535, and is printed in the temp line. and the temp value is printed on the light line.