LoginSignup
0
0

More than 1 year has passed since last update.

LPC812MAXで3個のLEDでRGB(赤、緑、青)

Last updated at Posted at 2022-09-01

x mbed2リビジョン144

x リビジョン変更がわかる人むけ

目的

基本テスト

o_con708.jpg

o_con707.jpg

いろいろ(ぐち)

書き込み器のファームがよくぶっこわれる
再度、書き込めがいいのだけど何とかならないのか?ならん

100円前後だけどいきなり値上げされない事を祈ってます。

mbed_binky_812_RGB




//mbed_binky_812_RGB

#include "mbed.h"

//GPIOの初期化
DigitalOut  leds[]  = {
    DigitalOut (P0_7),   //R
    DigitalOut (P0_17),  //G
    DigitalOut (P0_16),  //B
};

int main() {


  leds[ 0 ] = 1;
  leds[ 1 ] = 1;
  leds[ 2 ] = 1;

 wait_ms(3000);
  
//while(1){
//  
//  leds[ 0 ] = 0; wait_ms(1000);
//  leds[ 0 ] = 1; wait_ms(1000);
//  leds[ 1 ] = 0; wait_ms(1000);
//  leds[ 1 ] = 1; wait_ms(1000);
//  leds[ 2 ] = 0; wait_ms(1000);
//  leds[ 2 ] = 1; wait_ms(1000);
//    
//}
    
    
    //無限ループ
    while(1) {

        for(int ii=0; ii<3; ii++) {

            for(int jj=0; jj<3; jj++) {

                //GPIOへビットを設定
                if(ii == jj) {
                    leds[ jj ] = 0;
                } else {
                    leds[ jj ] = 1;
                }

            }//for

            wait_ms(1000);// 1秒待つ

        }//for

    }//while



}//main




o_con833.jpg

-2-

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