Changes between Version 12 and Version 13 of PCA9622DR


Ignore:
Timestamp:
Feb 15, 2016 9:34:27 PM (8 years ago)
Author:
kishida
Comment:

ソースコード修正

Legend:

Unmodified
Added
Removed
Modified
  • PCA9622DR

    v12 v13  
    1 = LEDドライバ PCA9622DR の使い方=
     1uせい= LEDドライバ PCA9622DR の使い方=
    22
    33[https://www.switch-science.com/catalog/2388/ PCA9622DR I2C 16ch LEDドライバ ]の使い方説明とArduino用サンプルスケッチです。
     
    138138   /*******************************************************************************
    139139   // SWITCHSCIENCE wiki -- http://trac.switch-science.com/
    140    // PCA9266DR Arduino Sample
     140   // PCA9622DR Arduino Sample
    141141   *******************************************************************************/
    142142   #include <Wire.h>
    143143
    144    #define PCA9266DR_ADDR 0x70 // in 7bit for Arduino
     144   #define PCA9622DR_ADDR 0x70 // in 7bit for Arduino
    145145
    146146   #define MODE1 0x00
     
    195195     initdata[0] = B10000001;// 4bit目のデフォルトはSLEEP=1
    196196     initdata[1] = B00100101;// 5bit目のDMBLNK=1で全体点滅を有効
    197      datasend(PCA9266DR_ADDR, MODE1 | AI_ALLEN, initdata, 2); // 全領域インクリメント
     197     datasend(PCA9622DR_ADDR, MODE1 | AI_ALLEN, initdata, 2); // 全領域インクリメント
    198198
    199199     // 調光用デューティー比の設定
     
    212212     ledPWM[14] = 0x30;
    213213     ledPWM[15] = 0x10;
    214      datasend(PCA9266DR_ADDR, PWM0 | AI_ALLEN,ledPWM,16);
     214     datasend(PCA9622DR_ADDR, PWM0 | AI_ALLEN,ledPWM,16);
    215215
    216216     // 全体点滅の設定
    217217     int grp_pwm = 0x80; // 5:5
    218      datasend(PCA9266DR_ADDR, GRPPWM,&grp_pwm,1);
     218     datasend(PCA9622DR_ADDR, GRPPWM,&grp_pwm,1);
    219219     int grp_freq = 0x2F; // (0x2F+1)/24 秒周期 = 2秒周期
    220      datasend(PCA9266DR_ADDR, GRPFREQ,&grp_freq,1);
     220     datasend(PCA9622DR_ADDR, GRPFREQ,&grp_freq,1);
    221221
    222222
     
    226226     ledOut[2] = B10101010;
    227227     ledOut[3] = B11111111;  // LEDは個別調光と全体の点滅(PWM)に影響される
    228      datasend(PCA9266DR_ADDR,LEDOUT0 | AI_ALLEN,ledOut,4);
     228     datasend(PCA9622DR_ADDR,LEDOUT0 | AI_ALLEN,ledOut,4);
    229229
    230230     Serial.println("LED turned ON, PWM, etc...");