Arduino Uno analogue input issue

Use this section to discuss your embedded Flowcode projects.
Post Reply
kramtlas
Posts: 13
http://meble-kuchenne.info.pl
Joined: Mon Dec 14, 2020 7:22 am
Has thanked: 1 time

Arduino Uno analogue input issue

Post by kramtlas »

Hi, I have written a program using the Arduino Uno R3 smd version and FC9. It simulates perfectly but when I connect the Arduino in circuit it does not seem to respond to the analogue inputs at all. For example I can o/c all the analogue inputs and the program runs through the "Start up Macro" and on to the main program before it then fails. The "Start up Macro" uses a check to make sure the 4 inputs are ALL within the defined parameters before moving on to the main program and with them all o/c this should not be possible. I have also tried varying the inputs too with no success!
To add to the frustration I tried to use a BL0061 with the code modified to suit the board as an alternative but, the code failed to be executed with error messages referring to code e.g. Output / Decision etc.
I am under pressure time wise to get this running so any assistance would be greatly appreciated.
I have attached the both programs for you to see.
Thanks
Attachments
Temp control_fuel flange_4_voltage_BL0061.fcfx
(53.14 KiB) Downloaded 61 times
Temp control_fuel flange_4_voltage.fcfx
(53.03 KiB) Downloaded 59 times

medelec35
Matrix Staff
Posts: 1463
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 514 times
Been thanked: 473 times

Re: Arduino Uno analogue input issue

Post by medelec35 »

Hello.
Sorry to hear you are having some issues with Flowcode.
With the voltage reading issues, you will need to change the VRef default properties of the ADC from AREF to AVCC.
Also, change the Conversion speed from Fosc / 8 to Fosc / 128 for more stable readings.
AS with the not compiling, your project compiled for me OK.
Have you checked to see if you have got all the latest updates?
You can download all the updates by selecting Help, Library Updates...
Change the Files in-use to full database
If any components have been updated, you will need to select Reload for the effects to take place.
Hopefully, then your project will work the way you intend it to.
Martin

kramtlas
Posts: 13
Joined: Mon Dec 14, 2020 7:22 am
Has thanked: 1 time

Re: Arduino Uno analogue input issue

Post by kramtlas »

Hi Martin,
Thanks for your fast response. I am not in the lab until next week so I will not be able to test the circuit until then. However, I have written a small program at home and tested the analogue inputs using the suggestions you made and it works fine, so I have confidence in the changes working.
As regard to compiling to the BL0061 board, I checked the updates and there were quite a few, so I have updated my FC9. Again I can't try this until next week but my fingers are crossed.
Once again Thank you

Post Reply