Permalink
Browse files

T000200 example

  • Loading branch information...
1 parent d7a4699 commit 2342045b0921f3c3ea26c14a1178690a73cf780e @Fede85 Fede85 committed Nov 25, 2011
Showing with 3 additions and 7 deletions.
  1. +3 −7 library/TinkerKit/examples/T000200/T000200.pde
@@ -13,10 +13,6 @@
This example code is in the public domain.
*/
-// These constants won't change. They're used to give names
-// to the pins used:
-const int analogInPin = I0; // Analog input pin that the Themistor is attached to
-const int analogOutPin= O0; // Analog output pin that the LED is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
@@ -28,11 +24,11 @@ void setup() {
void loop() {
// read the analog in value:
- sensorValue = analogRead(analogInPin);
+ sensorValue = analogRead(I0);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
- analogWrite(analogOutPin, outputValue);
+ analogWrite(O0, outputValue);
// print the results to the serial monitor:
Serial.print("sensor = " );
@@ -44,4 +40,4 @@ void loop() {
// for the analog-to-digital converter to settle
// after the last reading:
delay(10);
-}
+}

0 comments on commit 2342045

Please sign in to comment.