Help with Propeller programming.
Mark_T
Posts: 1,981
A link to the object in question would be good, searching "ADC" in the Obex is not illuminating!
[and this is a topic for the Propeller forum really]
[and this is a topic for the Propeller forum really]
Comments
How come there is no getSample method to obtain a reading?
You'd just check the value of the variable whenever you wanted to use a new reading.
I couldn't find a demo for it but I could write a quick one if you don't understand how to pass an address of a variable.
http://obex.parallax.com/objects/625/
@Brad, The ADC object chelleteng is referring to doesn't use an external ADC chip.
My bad chelleteng, if trying to make this work ends up consuming too much of your time, the chips are $3 and the object I referenced is easy to use
I always use an external chip myself. It was the first ADC method I learned with the Prop so I just stuck with what worked.
By the way, Beau posted a specific answer in chelleteng's general discussion question on sigma-delta.
So I wonder if Mark can change the thread to "Solved"?
The PASM section starts with:
The compiler will give an error if the SDF pin is higher than P8.
I also can't figure out why one would use the mov statement to make a pin an output. I'd think this would mess up any other pins that the program might be using.
I changed the above the above code to:
feedbackMask is defined as:
This is the code I use to start the object:
You can see I passed the address of "adcReading" to the ADC object.
The code the just outputs to the terminal the value stored in "adcReading".
I used the Demo Boards mic pins for the input and feedback pins. The value displayed didn't change much. It stayed around 65000 IIRC.