Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
OUT.txt
- Committer:
- TakushimaYukimasa
- Date:
- 2019-05-18
- Revision:
- 24:4555d379fa1e
- Parent:
- 16:a01acc32466d
File content as of revision 24:4555d379fa1e:
#include "mbed.h" #include "YKNCT_I2C.h" #define OUT_MAX 12 #define HIGH 1 #define LOW 0 Serial pc(USBTX, USBRX); // tx, rx Y_I2C i2c(PB_9, PB_8); OUT_I2C_Data_TypeDef OUT_I2C_Data[]= { {0, 0, 0}, {0, 1, 0}, {0, 2, 0}, {0, 3, 0}, {0, 4, 0}, {0, 5, 0}, {0, 6, 0}, {0, 7, 0}, {1, 0, 0}, {1, 1, 0}, {1, 2, 0}, {1, 3, 0}, }; int main() { while(1) { for(int i=0; i<OUT_MAX; i++) { i2c.Out_Set(OUT_I2C_Data, i, HIGH); i2c.Out(OUT_I2C_Data, OUT_MAX); wait(0.1); pc.printf("%d ",(OUT_I2C_Data+i) -> out_data); } pc.printf("\n\r"); for(int i=0; i<OUT_MAX; i++) { i2c.Out_Set(OUT_I2C_Data, i, LOW); i2c.Out(OUT_I2C_Data, OUT_MAX); wait(0.1); pc.printf("%d ",(OUT_I2C_Data+i) -> out_data); } pc.printf("\n\r"); } }