Arduino框架下STM32F103C系列单片机引脚映射关系

admin 2022-9-7 289



enum {

    PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13,PA14,PA15,

PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13,PB14,PB15,

PC13, PC14,PC15

};


PA0=0   PA15=15;PB0=16  PB15=31;PC13=32  PC14=33 PC15=34

PC13为led


void setup() {

  // initialize digital pin PB1 as an output.

  pinMode(32, OUTPUT);//LED_BUILTIN

  //pinMode(LED_BUILTIN, OUTPUT);

  //pinMode(PC13, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

  digitalWrite(32, HIGH);   // turn the LED on (HIGH is the voltage level)

  delay(1000);              // wait for a second

  digitalWrite(32, LOW);    // turn the LED off by making the voltage LOW

  delay(1000);              // wait for a second

}




  pinMode(32, OUTPUT);//LED_BUILTIN

  pinMode(PC13, OUTPUT);

这种定义也可以

欢迎联系本站长QQ:3216572
最新回复 (0)
返回