I set potentiometer connect to A0 with GETBYTE and decision IF Getbyte>128 LED TurnON
When simulate its is OK but when to compile to target, LED always turn on ???
Someone please explain
Thanks
Amrat
Analg read
-
- Matrix Staff
- Posts: 1463
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 514 times
- Been thanked: 473 times
Re: Analg read
Hi
An issue like that is when the potentiometer VRef voltage properties is set to vref+ instead VDD and Vref+ pin is left floating.
If that is not the case can you post your project file that has extension .fcfx
An issue like that is when the potentiometer VRef voltage properties is set to vref+ instead VDD and Vref+ pin is left floating.
If that is not the case can you post your project file that has extension .fcfx
Martin
Re: Analg read
Hi Martin,
Thanks for your reply. About set parameter Vref I confused as no explanation on Wiki. Will you please send sample base on my fcfx file ? then I will understand.
Thanks in advance
Attached is simple file I do test.
Thanks again
Amrat
Thanks for your reply. About set parameter Vref I confused as no explanation on Wiki. Will you please send sample base on my fcfx file ? then I will understand.
Thanks in advance
Attached is simple file I do test.
Thanks again
Amrat
- Attachments
-
- Arduino KitOnShield.fcfx
- (10.51 KiB) Downloaded 91 times
-
- Matrix Staff
- Posts: 1463
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 514 times
- Been thanked: 473 times
Re: Analg read
Hello.
I have modified your project by changing Vref option from the default AREF to AVCC. Additionally, I have increased the conversion speed to Fosc/128 for extra stability.
I have also added a note on wiki for each potentiometer.
I have modified your project by changing Vref option from the default AREF to AVCC. Additionally, I have increased the conversion speed to Fosc/128 for extra stability.
I have also added a note on wiki for each potentiometer.
- Attachments
-
- Arduino KitOnShield v2.fcfx
- (10.51 KiB) Downloaded 92 times
Martin
Re: Analg read
Hi Martin,
Again need some advice.
How to program to read Analog Voltage of Microphone ? as in component libraries have no mic !!
Thanks in Advance
Best rgds
Amrat
Again need some advice.
How to program to read Analog Voltage of Microphone ? as in component libraries have no mic !!
Thanks in Advance
Best rgds
Amrat
-
- Valued Contributor
- Posts: 1181
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 287 times
- Been thanked: 417 times
Re: Analg read
Hi
It depends on your application.
There is a component to measure strength of background sound levels, but if you are looking to record your voice or such like then things get a little more complicated and component speeds are critical to success.
Generally speaking you would need to take a reading (sample) at twice the highest frequency you wish to capture. As an example, analogue telephones have a bandwidth of 4KHz (being 300 - 3400Hz + gaps) therefore we would need to sample at 8KHz to stand a reasonable chance of recording / transmitting recognisable speech.
Whilst that works out at a sample every 125uS you have to take the time taken to actually sample and store / do something with the sample into consideration too.
Regards
It depends on your application.
There is a component to measure strength of background sound levels, but if you are looking to record your voice or such like then things get a little more complicated and component speeds are critical to success.
Generally speaking you would need to take a reading (sample) at twice the highest frequency you wish to capture. As an example, analogue telephones have a bandwidth of 4KHz (being 300 - 3400Hz + gaps) therefore we would need to sample at 8KHz to stand a reasonable chance of recording / transmitting recognisable speech.
Whilst that works out at a sample every 125uS you have to take the time taken to actually sample and store / do something with the sample into consideration too.
Regards