LoginSignup
0
0

More than 1 year has passed since last update.

ArduinoUNOとGPIOで800khz(1.25us)を作る

Posted at

目的
GPIOのテスト



// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);
}

//              76543210
#define on1   0b00100000
#define off1  0b00000000

// the loop function runs over and over again forever
void loop() {
  //digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
//PORTD |= _BV(5);
//        76543210   
//PORTB = 0b00100000;
//PORTB = on1;
//  delay(1000);                       // wait for a second
//PORTD &= ~_BV(5);
//        76543210
//PORTB = 0b00000000;
//PORTB = off1;
//  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
//  delay(1000);                       // wait for a second

while(1){

  PORTB = on1; //1
  PORTB = on1; //2
  PORTB = on1; //3
  PORTB = on1; //4
  PORTB = on1; //5
  PORTB = on1; //6
  PORTB = on1; //7
  PORTB = on1; //8


  PORTB = off1; //1
  PORTB = off1; //2
  PORTB = off1; //3
  PORTB = off1; //4
  PORTB = off1; //5
  PORTB = off1; //6
  PORTB = off1; //7
  PORTB = off1; //8



}//while






}



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