Page 1 of 1

Reading Analog input

Posted: Fri Jul 01, 2011 3:21 am
by ferdtang
Hi All,

I just got my Freeduino USB host board, set it up with my Nexus One phone and the Google Demos are working. Moving forward, I would like the board to read an analogue input and then send it to the Android App.

I am new to Arduino, which pins should I use? Also should I be calling analogRead() somewhere on the demo sketch?

Any pointers would be greatly appreciated.

Thanks!
Ferd

Re: Reading Analog input

Posted: Mon Aug 29, 2011 11:17 am
by oz
Ferd,

It's dead simple, and you probably figured this out by now but here it is.

Code: Select all

int results = analogRead(A0);  // 10 bit A/D read is now in result
of course you can declare the variable separately from using it.

Paul