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.

STM32F767でKnight Rider(ナイトライダー)で遊ぶ(その2)

Last updated at Posted at 2023-05-16

x 過去ログを見よ

D8からD13まで

o_cop527.jpg




//GPIO_Knight_Rider2_test_767_1


void GPIO_D13(int s)
{

  digitalWrite(13,s);

} //GPIO_D13

void GPIO_D12(int s)
{

  digitalWrite(12,s);

} //GPIO_D12


void GPIO_D11(int s)
{

  digitalWrite(11,s);

} //GPIO_D11


void GPIO_D10(int s)
{

  digitalWrite(10,s);

} //GPIO_D10


void GPIO_D9(int s)
{

  digitalWrite(9,s);

} //GPIO_D9


void GPIO_D8(int s)
{

  digitalWrite(8,s);

} //GPIO_D8


void GPIO_D8_D13_cls()
{

  digitalWrite(13,0);
  digitalWrite(12,0);
  digitalWrite(11,0);

  digitalWrite(10,0);
  digitalWrite(9,0);
  digitalWrite(8,0);

} //GPIO_D8_D13_cls()

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PB7, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);

} //setup


void loop() {

  digitalWrite(PB7, HIGH);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D13(1);

  delay(1000);                       // wait for a second

  digitalWrite(PB7, LOW);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D12(1);

  delay(1000);                       // wait for a second

  digitalWrite(PB7, HIGH);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D11(1);

  delay(1000);                       // wait for a second

  digitalWrite(PB7, LOW);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D10(1);

  delay(1000);                       // wait for a second

  digitalWrite(PB7, HIGH);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D9(1);

  delay(1000);                       // wait for a second

  digitalWrite(PB7, LOW);   // turn the LED on (HIGH is the voltage level)
  
  GPIO_D8_D13_cls();
  GPIO_D8(1);

  delay(1000);                       // wait for a second

} //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?