Same here! I copied the map method from the arduino reference page.I really should pay more attention to the methods that are available in each class. I wrote my one code to do that recently.
Analog Input Help Needed
#21
Posted 22 August 2010 - 05:02 PM
#22
Posted 23 August 2010 - 05:04 AM
Is it possible to get a double from input pin? I feel like an integer is not good precision, or is it already possible?We have two updates in the works:
v4.1.0.3 (patch 3):
* Minor updates to deployment/reboot code
v4.1.1.0 (first feature update)
* SD card mounting, file system support
* Expanded PWM support (ability to set clock times, etc.)
A few other things that we're working on:
* Networking capabilities
* Drivers for a number of shields
Chris
#23
Posted 23 August 2010 - 05:29 AM
Is it possible to get a double from input pin? I feel like an integer is not good precision, or is it already possible?
The AnalogInput (ADC) is 10-bit, so you'll get 0-1023. If you'd like to translate that to a range of doubles, you can do something like this:
// assume a desired range of 0.00 - 100.00 double value; analogInput.SetRange(0, 10000); value = (double)((double)analogInput.Read() / 100)
Chris
#24
Posted 23 August 2010 - 05:32 AM
The AnalogInput (ADC) is 10-bit, so you'll get 0-1023. If you'd like to translate that to a range of doubles, you can do something like this:
// assume a desired range of 0.00 - 100.00 double value; analogInput.SetRange(0, 10000); value = (double)((double)analogInput.Read() / 100)
Chris
Yeah, I should have thought of that, as always thanks for the help
#25
Posted 23 August 2010 - 02:58 PM
We have two updates in the works:
v4.1.0.3 (patch 3):
* Minor updates to deployment/reboot code
v4.1.1.0 (first feature update)
* SD card mounting, file system support
* Expanded PWM support (ability to set clock times, etc.)
A few other things that we're working on:
* Networking capabilities
* Drivers for a number of shields
Chris
Hi Chris,
It would be very helpful if you could create a new thread and list out every bug found + future patches in progress and which bug/feature will they fix/have. That way it wouldn't be a surprise when a programmer discover a bug and have to report it.
I know you have a thread that sort of list what each patch fixes when you roll it out but would be great if you could list out future patches/found bugs too.
Thanks!
#26
Posted 25 August 2010 - 05:35 AM
I really should pay more attention to the methods that are available in each class. I wrote my one code to do that recently.
Hi,
How do you get the analog sensor to work any sample driver? I wrote driver for sharp distance sensor and for some reasons the reading remains unchanged.
Thanks!
#27
Posted 25 August 2010 - 05:36 AM
How do you get the analof sensor to work any sample driver? I wrote driver for sharp distance sensor and for some reasons the reading remains unchanged.
Hi Hai,
Can you share your code? Also, which analog pin(s) are you using?
Chris
#28
Posted 25 August 2010 - 08:21 PM
Hi Hai,
Can you share your code? Also, which analog pin(s) are you using?
Chris
Chris,
Here are my wiring, I will update this post with code and photo tonight.
A0->Sensor's Vo
3.3v->Sensor's Vcc
GND->Sensor's GND
code has been removed due to it may trigger legal issue -Hai
Thanks!
#29
Posted 26 August 2010 - 07:17 AM
Here are my wiring, I will update this post with code and photo tonight.
A0->Sensor's Vo
3.3v->Sensor's Vcc
GND->Sensor's GND
Hai,
Did you attach the AREF pin to the 3.3V header too? If there's not an analog reference, the analog values will probably all read at their maximum value...
Chris
#30
Posted 26 August 2010 - 08:21 PM
Attached Files
#31
Posted 26 August 2010 - 08:33 PM
Chris,
You mean connect like this?
Yup, but see Chris' below. I wasn't looking at that, just the AREF link!
#32
Posted 26 August 2010 - 08:35 PM
Chris,
You mean connect like this?
Hai,
You have the sensor connected to digital pin 0 (D0), not analog pin 0 (A0).
Chris
#33
Posted 26 August 2010 - 09:20 PM
#34
Posted 27 August 2010 - 03:40 AM
#35
Posted 27 August 2010 - 04:00 AM
-What is the AREF pin for and why do I have to cross-connect analog pin to this to get work correctly?
-Where else AREF pin is required when working with Netduino?
The AREF pin is "analog reference." The analog readings use this as their "maximum voltage" reading. You can make it anything between 2.7V and 3.3V, but basically it helps ensure good readings for your analog sensors.
Chris
#36
Posted 27 August 2010 - 04:01 AM
I hook it up the way suggested but still didnt see any change on the reading. Any other thought?
Hai,
AnalogInputs are pretty straightforward, but let's see what else we can find...
1. Can you take a photo of your setup? Just so we can eliminate any obvious questions...
2. Do you have a multimeter? If so, what is the reading on the analog input wire (a) not attached to the Netduino; ( attached to the Netduino?
Chris
#37
Posted 27 August 2010 - 04:33 AM
Hai,
AnalogInputs are pretty straightforward, but let's see what else we can find...
1. Can you take a photo of your setup? Just so we can eliminate any obvious questions...
2. Do you have a multimeter? If so, what is the reading on the analog input wire (a) not attached to the Netduino; ( attached to the Netduino?
Chris
Here is the image, I have multimeter I will post reading result soon
Attached Files
#38
Posted 27 August 2010 - 04:54 AM
Your AREF is not connected in that photo.
Could you please run your test under the two scenarios that follow?
[a] connect the 3.3V line to the AREF pin in addition to your sensor
[b] if that doesn't work, disconnect the wire from the the RESET line and the wires from analog 1 and analog 2
Chris
#39
Posted 27 August 2010 - 05:09 AM
Hai,
Your AREF is not connected in that photo.
Could you please run your test under the two scenarios that follow?
[a] connect the 3.3V line to the AREF pin in addition to your sensor
[b] if that doesn't work, disconnect the wire from the the RESET line and the wires from analog 1 and analog 2
Chris
Chris,
Oop, careless mistake I thougth that was AREF pin for some reasons. all three sensors work fine now
Thanks very much for your helps
#40
Posted 27 August 2010 - 05:15 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users