這是sparkfun.com官網提供的程式碼卻是應用在Wiring上,
可是因為彽電流檢測器輸出訊號為類比訊號,請問如果要應用BASIC STAMP II執行,
一定要透過A/D converter把類比轉成數位才能使用嗎?
-----我是程式碼-----
int val;
void setup()
{
Serial.begin(9600); // sets the serial port to 9600
}
void loop()
{
val = analogRead(0); // read analog input pin 0
Serial.print(val, DEC); // prints the value read
Serial.print(" "); // prints a space between the numbers
delay(100); // wait 100ms for next reading
}
-----程式碼結束-----