Changes between Version 12 and Version 13 of PCA9622DR
- Timestamp:
- Feb 15, 2016 9:34:27 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PCA9622DR
v12 v13 1 = LEDドライバ PCA9622DR の使い方=1 uせい= LEDドライバ PCA9622DR の使い方= 2 2 3 3 [https://www.switch-science.com/catalog/2388/ PCA9622DR I2C 16ch LEDドライバ ]の使い方説明とArduino用サンプルスケッチです。 … … 138 138 /******************************************************************************* 139 139 // SWITCHSCIENCE wiki -- http://trac.switch-science.com/ 140 // PCA9 266DR Arduino Sample140 // PCA9622DR Arduino Sample 141 141 *******************************************************************************/ 142 142 #include <Wire.h> 143 143 144 #define PCA9 266DR_ADDR 0x70 // in 7bit for Arduino144 #define PCA9622DR_ADDR 0x70 // in 7bit for Arduino 145 145 146 146 #define MODE1 0x00 … … 195 195 initdata[0] = B10000001;// 4bit目のデフォルトはSLEEP=1 196 196 initdata[1] = B00100101;// 5bit目のDMBLNK=1で全体点滅を有効 197 datasend(PCA9 266DR_ADDR, MODE1 | AI_ALLEN, initdata, 2); // 全領域インクリメント197 datasend(PCA9622DR_ADDR, MODE1 | AI_ALLEN, initdata, 2); // 全領域インクリメント 198 198 199 199 // 調光用デューティー比の設定 … … 212 212 ledPWM[14] = 0x30; 213 213 ledPWM[15] = 0x10; 214 datasend(PCA9 266DR_ADDR, PWM0 | AI_ALLEN,ledPWM,16);214 datasend(PCA9622DR_ADDR, PWM0 | AI_ALLEN,ledPWM,16); 215 215 216 216 // 全体点滅の設定 217 217 int grp_pwm = 0x80; // 5:5 218 datasend(PCA9 266DR_ADDR, GRPPWM,&grp_pwm,1);218 datasend(PCA9622DR_ADDR, GRPPWM,&grp_pwm,1); 219 219 int grp_freq = 0x2F; // (0x2F+1)/24 秒周期 = 2秒周期 220 datasend(PCA9 266DR_ADDR, GRPFREQ,&grp_freq,1);220 datasend(PCA9622DR_ADDR, GRPFREQ,&grp_freq,1); 221 221 222 222 … … 226 226 ledOut[2] = B10101010; 227 227 ledOut[3] = B11111111; // LEDは個別調光と全体の点滅(PWM)に影響される 228 datasend(PCA9 266DR_ADDR,LEDOUT0 | AI_ALLEN,ledOut,4);228 datasend(PCA9622DR_ADDR,LEDOUT0 | AI_ALLEN,ledOut,4); 229 229 230 230 Serial.println("LED turned ON, PWM, etc...");