2019年度キャンパスプロジェクトで使用する基盤のテストコードです。

Dependencies:   TLC59116

Committer:
Suzutomo
Date:
Tue Nov 09 07:38:18 2021 +0000
Revision:
1:61ceb7b49db8
Parent:
0:a010f4a9fcdd
last commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Suzutomo 0:a010f4a9fcdd 1 #include "mbed.h"
Suzutomo 1:61ceb7b49db8 2 #include "TLC59116.h"
Suzutomo 1:61ceb7b49db8 3
Suzutomo 1:61ceb7b49db8 4 TLC59116 led(PB_9,PB_8,0x60<<1);
Suzutomo 1:61ceb7b49db8 5 I2C i2c(PB_9,PB_8);
Suzutomo 0:a010f4a9fcdd 6
Suzutomo 0:a010f4a9fcdd 7 DigitalOut led1(LED1);
Suzutomo 0:a010f4a9fcdd 8
Suzutomo 0:a010f4a9fcdd 9 // main() runs in its own thread in the OS
Suzutomo 1:61ceb7b49db8 10 int main()
Suzutomo 1:61ceb7b49db8 11 {
Suzutomo 1:61ceb7b49db8 12 printf("Hello World!!");
Suzutomo 0:a010f4a9fcdd 13 while (true) {
Suzutomo 1:61ceb7b49db8 14 for (int i = 0; i < 16; i++) {
Suzutomo 1:61ceb7b49db8 15 led.setChannel(i,1);
Suzutomo 1:61ceb7b49db8 16 }
Suzutomo 0:a010f4a9fcdd 17 led1 = !led1;
Suzutomo 1:61ceb7b49db8 18 wait(1);
Suzutomo 1:61ceb7b49db8 19 for (int i = 0; i < 16; i++) {
Suzutomo 1:61ceb7b49db8 20 led.setChannel(i,0);
Suzutomo 1:61ceb7b49db8 21 }
Suzutomo 1:61ceb7b49db8 22 led1 = !led1;
Suzutomo 1:61ceb7b49db8 23 wait(1);
Suzutomo 0:a010f4a9fcdd 24 }
Suzutomo 0:a010f4a9fcdd 25 }
Suzutomo 0:a010f4a9fcdd 26