====== Analogread ====== //__About this Article__// * **Author**: aaron --- aaron@cubietech.com --- 2014/02/27 22:24 * **Copyrights**: [[http://creativecommons.org/licenses/by-sa/3.0/|CC Attribution-Share Alike 3.0 Unported]] * **Contributors**: [[http://cubieboard.org/|Cubieboard Community]] : ... ===== Abstract ===== How to do this,please refer to [[http://docs.cubieboard.org/tutorials/arduino/controlling_led |light led]] and [[http://docs.cubieboard.org/tutorials/arduino/connecting|how to connect cubieboard and arduino]] {{:tutorials:arduino:t1.jpg|400}} {{:tutorials:arduino:t2.jpg|400}} =====Schematics===== ==== Source Code ==== int potPin = 0; void setup() { Serial.begin(9600); } void loop() { int val; int dat; val=analogRead(0); dat=(125*val)>>8; Serial.print("Tep:"); Serial.print(dat); Serial.println("C"); delay(500); } ===== Headline ===== === See Also === {{tag>Cubieboard Cubietruck}}