Shop OBEX P1 Docs P2 Docs Learn Events
Analog to Digital C Function — Parallax Forums

Analog to Digital C Function

DiscoveryDiscovery Posts: 606
edited 2014-07-22 08:34 in Propeller 1
I cannot find a C function for using the ADC on the Propeller Activity Board. In the SimpleIDE there is a C function description for using the DAC but I want the ADC.

Can it be supplied?

Discovery

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2014-07-17 19:04
    Did you update your Learn folder recently? It's not that hard to find under Simple Libraries/Convert (and that's using a package from May).
  • jazzedjazzed Posts: 11,803
    edited 2014-07-17 19:04
    Discovery wrote: »
    I cannot find a C function for using the ADC on the Propeller Activity Board. In the SimpleIDE there is a C function description for using the DAC but I want the ADC.

    Can it be supplied?

    Discovery

    Simple Libraries Convert folder
    ADC DC Propeller Activity Board Library

    ADC AC Proeller Activity Board Library
  • twm47099twm47099 Posts: 867
    edited 2014-07-17 19:07
    Discovery wrote: »
    I cannot find a C function for using the ADC on the Propeller Activity Board. In the SimpleIDE there is a C function description for using the DAC but I want the ADC.

    Can it be supplied?

    Discovery
    In the SimpleIDE library there is an example in the folder:

    \SimpleIDE\Learn\Examples\Circuits

    The program is "measure volts.c" The full IDE project is "measure volts.side"

    The lesson starts on this page:

    http://learn.parallax.com/propeller-c-simple-circuits/measure-volts

    There is a following lesson on using the DAC.

    In post 26 of:
    http://forums.parallax.com/showthread.php/155501-Pixy-for-Propeller?p=1278851#post1278851
    I have a c program that uses the ADC function to read voltage values from the Pixy image sensor and control the motion of the ActivityBot (uses the Activity Board.)

    Hope this helps

    Tom
  • DiscoveryDiscovery Posts: 606
    edited 2014-07-18 14:08
    I was successful in downloading the learn update file that included ADC...it ran fine form the file.

    How do I get the the learn update files to be seen by my IDE\project file set?

    That appears to be my problem. The updates are being read when I perform the BUILD.

    Discovery
  • jazzedjazzed Posts: 11,803
    edited 2014-07-18 14:21
    Discovery wrote: »
    I was successful in downloading the learn update file that included ADC...it ran fine form the file.

    How do I get the the learn update files to be seen by my IDE\project file set?

    That appears to be my problem. The updates are being read when I perform the BUILD.

    Discovery

    http://learn.parallax.com/propeller-c-set-simpleide/update-your-learn-folder

    Replace the Documents/SimpleIDE/Learn folder with the Learn folder you downloaded.
    Remove any -I or -L entries from the Project Manager list.
    Make sure "Auto Include Simple Libraries" is checked.
  • DiscoveryDiscovery Posts: 606
    edited 2014-07-21 07:39
    Hi Jazzed,
    I began following the instructions provided by Andy for updating the learn file but ran into a problem understanding the instructions to rename the learn file then replace the learn file with the downloaded learn file. It did not make sense to me so I copied all my programs contained in My Projects to a thumb drive then erased all IDE files and started from scratch.

    The Simple IDE was down loaded and installed as brand new. I am trying to get the Measure Volts application as called out in "Learn.Parallax" to operate so that I can use a version of it in my application. The compiler flagged the instruction #include "adcDCpropab.h" as an error. So, I downloaded the Learn file update, unzipped it and copied the files into the Learn folder under the Documents\IDE folder. The compiler got past the #include statement but flagged the putChar(Home); instruction as an error.

    I have not been able to clear this error.

    You mentioned to make sure the "Auto Include Simple Libraries" is checked. I cannot find the block to be checked.

    Someone sent me the Measure Volts code in a file that was down loaded and run. It worked perfectly but was not in My Projects folder. This program was lost when I cleared out the Simple IDE files.

    Sincerely,

    Discovery
  • jazzedjazzed Posts: 11,803
    edited 2014-07-21 10:33
    Which SimpleIDE version do you have? The pre-release version simplifies Learn Simple Library maintenance.

    The "Auto Include Simple Libraries" checkbox is in the Properties General tab (F6 or Menu -> Tools -> Properties).

    There was a problem with the spelling and case of some adc libraries at one time, but that should have been cleaned up already.

    Can you capture the output of your build status? Right click, select all; right click, copy; paste to forum post. This is being simplified too.
  • DiscoveryDiscovery Posts: 606
    edited 2014-07-21 10:51
    Hi Jazzed,

    I got it...

    There was a type "O" in one instruction but the Build compiler could not catch it.

    Measure volts DC works perfectly.

    Now I can proceed with my project.

    Thank you.

    Discovery
  • jazzedjazzed Posts: 11,803
    edited 2014-07-21 10:59
    Discovery wrote: »
    Hi Jazzed,

    I got it...

    There was a type "O" in one instruction but the Build compiler could not catch it.


    If there is a type-o in the instruction, please provide more information so that it can be fixed.

    Thanks.
  • DiscoveryDiscovery Posts: 606
    edited 2014-07-22 08:34
    The instruction was correct...it was my error in transcription.

    The working analog to digital converter code was modified and inserted in a COG of my main propeller program that servos the z-axis position of my new plasma cutting machine. It works just fine.

    Sincerely,

    Discovery
Sign In or Register to comment.