Arrays in Spin?
adri
Posts: 34
Hi
I'm new to the Propeller and to Microcontrollers in general. I have a background in PC programming. I'm wanting to fill an array with values from an ADC. Any suggestions as to the Spin for the array part would be most welcome.
Any general tutorials in Spin would also be a plus. Are there any out there?
Many thanks
Adri
I'm new to the Propeller and to Microcontrollers in general. I have a background in PC programming. I'm wanting to fill an array with values from an ADC. Any suggestions as to the Spin for the array part would be most welcome.
Any general tutorials in Spin would also be a plus. Are there any out there?
Many thanks
Adri
Comments
There's nothing fancy about arrays in Spin. They're one dimensional. You have to declare them with the array size. Subscripts range from zero to the array size - 1.
Look in the object exchange for existing I/O drivers for a variety of ADCs. The Propeller can also do its own sigma-delta ADC with a couple of resistors and a capacitor. Download the application note (AN001) on the cog counters for details and examples (www.parallax.com/tabid/442/Default.aspx).