Reading Analog input

ferdtang
Posts: 1
Joined: Fri Jul 01, 2011 3:16 am

Reading Analog input

Post 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

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: Reading Analog input

Post 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

Post Reply