0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

STM32G071でKnight Rider(ナイトライダー)で遊ぶ(その3)

Last updated at Posted at 2023-05-30

x 過去ログを見よ

A0からA5まで

o_cop552.jpg




//GPIO_Knight_Rider3_test_767_1


void GPIO_A0(int s)
{

  digitalWrite(A0,s);

} //GPIO_A0

void GPIO_A1(int s)
{

  digitalWrite(A1,s);

} //GPIO_A1


void GPIO_A2(int s)
{

  digitalWrite(A2,s);

} //GPIO_A2


void GPIO_A3(int s)
{

  digitalWrite(A3,s);

} //GPIO_A3


void GPIO_A4(int s)
{

  digitalWrite(A4,s);

} //GPIO_A4


void GPIO_A5(int s)
{

  digitalWrite(A5,s);

} //GPIO_A5


void GPIO_A0_A5_cls()
{

  digitalWrite(A0,0);
  digitalWrite(A1,0);
  digitalWrite(A2,0);

  digitalWrite(A3,0);
  digitalWrite(A4,0);
  digitalWrite(A5,0);

} //GPIO_D8_D13_cls()

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PB7, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);

} //setup


void loop() {

  digitalWrite(PB7, HIGH);
  
  GPIO_A0_A5_cls();
  GPIO_A0(1);

  delay(1000);

  digitalWrite(PB7, LOW);
  
  GPIO_A0_A5_cls();
  GPIO_A1(1);

  delay(1000);

  digitalWrite(PB7, HIGH);
  
  GPIO_A0_A5_cls();
  GPIO_A2(1);

  delay(1000);

  digitalWrite(PB7, LOW);
  
  GPIO_A0_A5_cls();
  GPIO_A3(1);

  delay(1000);

  digitalWrite(PB7, HIGH);
  
  GPIO_A0_A5_cls();
  GPIO_A4(1);

  delay(1000);

  digitalWrite(PB7, LOW);
  
  GPIO_A0_A5_cls();
  GPIO_A5(1);

  delay(1000);

} //loop




0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?