LoginSignup
0
0

More than 1 year has passed since last update.

LPC812MAXでGPIOレジ直で遊ぶ(IN)

Last updated at Posted at 2022-09-04

目的
GPIO_INのテスト

o_con722.jpg




//GPIO_in_P0_7_test_812_1

#include "mbed.h"

//         TX    RX
Serial pc(P0_4, P0_0); //812

DigitalIn enable(P0_7);

//メイン関数
int main()
{

    int hex1[] = {
        '0','1','2','3','4','5','6','7',
        '8','9','A','B','C','D','E','F'
    };

    int x;

    //無限ループ
    while(1) {

        x = LPC_GPIO_PORT->PIN0;

        pc.putc( hex1[ (x>>4) &  0x0f ]  );
        pc.putc( hex1[ (x)    &  0x0f ]  );
        pc.putc( '\r' );
        pc.putc( '\n' );

        wait_ms(500);//0.5秒待つ

    }//while

}//main



o_con833.jpg

-10-

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