https://www.digi.com/products/iot-platform/xctu
Ubah pengaturan berikut, kemudian klik Write
const int potPin= 34; //Pot at Arduino A0 pin
int value ; //Value from pot
void setup() {
//Start the serial communication
Serial.begin(9600); //Baud rate must be the same as is on xBeemodule
}
void loop() {
//Read the analog value from pot and store it to "value" variable
value = analogRead(potPin);
//Map the analog value to pwm value
value = map (value, 0, 1023, 0, 255);
//Send the message:
Serial.print('<'); //Starting symbol
Serial.print(value);//Value from 0 to 255
Serial.println('>');//Ending symbol
}
Tidak ada komentar:
Posting Komentar