arduino直接下载或者WCHISPTool_Setup需要按按钮插usb才能进入下载模式
针脚对应arduino针脚
1–> P3.2 -->32
2–> P1.4 -->14
.
.
.
11–> P3.4–>34
#define LED_BUILTIN 32
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(2000); // wait for a second
}
测试引脚程序
#define LED_BUILTIN 32
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
pinMode(14,OUTPUT);
pinMode(15,OUTPUT);
pinMode(16,OUTPUT);
pinMode(17,OUTPUT);
pinMode(33,OUTPUT);
pinMode(34,OUTPUT);
pinMode(30,OUTPUT);
pinMode(31,OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(14,HIGH);
digitalWrite(15,HIGH);
digitalWrite(16,HIGH);
digitalWrite(17,HIGH);
digitalWrite(33,HIGH);
digitalWrite(34,HIGH);
digitalWrite(30,HIGH);
digitalWrite(31,HIGH);
analogRead(11)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
digitalWrite(14,LOW);
digitalWrite(15,LOW);
digitalWrite(16,LOW);
digitalWrite(17,LOW);
digitalWrite(33,LOW);
digitalWrite(34,LOW);
digitalWrite(30,LOW);
digitalWrite(31,LOW);
delay(1000); // wait for a second
}