Reading Analog input

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

Reading Analog input

Post by ferdtang » Fri Jul 01, 2011 3:21 am

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

paul
Site Admin
Posts: 734
Joined: Mon May 12, 2008 4:19 pm

Re: Reading Analog input

Post by paul » Mon Aug 29, 2011 11:17 am

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