http://erelement.com/arduino/bluetooth-shield#define numberOfSensors 2
void setup() {
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// loop over the sensors:
for (int thisSensor = 0; thisSensor < numberOfSensors; thisSensor++) {
// read each sensor
int sensorReading = analogRead(thisSensor);
// print its value out as an ASCII numeric string
Serial.print(sensorReading, DEC);
// if this isn't the last sensor to read,
// then print a comma after it
if (thisSensor < numberOfSensors -1) {
Serial.print(",");
}
}
// after all the sensors have been read,
// print a newline and carriage return
Serial.println();
}
имам закачен сензор на А0. С USB си работи всичко точно.