馬達
尋找裝置開啟範例 Servo->Sweep
黑:GND
白:input (9)
紅:接電壓 (5V)
--------------------------------------------------------------------------------------------------------------------------
馬達+旋鈕
開啟範例 Servo->Knob
馬達
黑:GND
白:input_DIGITAL(9)
紅:接電壓 (5V)
旋鈕在下
左:output_ANALOG IN (A0)
中:電壓(3.3V)
右:GND
--------------------------------------------------------------------------------------------------------------------------
開啟範例 Communication-> Serial Call and Response
CODE
void setup() {
Serial.begin(9600);
Serial.print("Hello~~");
// put your setup code here, to run once:
}
String s;
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) {
s=Serial.readString();
Serial.print("\nYou said:\n");
Serial.print(s);
}
}










沒有留言:
張貼留言