wiki:wade/embedded/arduino/example/example_2
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_fs.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.

Version 2 (modified by wade, 16 years ago) (diff)

--

/*
 * arduino 讀取 pin 5 這顆 sensor 資料,再寫入 serial
 */
#define sensorIn 5
int val = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  val = analogRead(sensorIn);
  Serial.println(val);
//  Serial.write("test\n");
  delay(100);
}