Showing results for 
Search instead for 
Did you mean: 

Code Examples

Contributor II


This is the sample code for I2C master and slave.

You can program the I2C master in CY8C4045AZI-S413 and program the I2C slave in CYBLE-022001-00.

The ASCII code typed with the PC terminal software is set in i2cOutBuffer [1] and echoed back to the PC at the same time.

The value of i2cOutBuffer [1] -i2cOutBuffer [4] is sent from PSoC4000S (CY8C4045AZI-S413) to EZ-BLE PRoC module (CYBLE-022001-00) using I2C communication.Then, the value of i2cOutBuffer [1]: bit0 is set to the LED12 connected to the EZ-BLE PRoC module.

The value of i2cOutBuffer [1] -i2cOutBuffer [4] sent to the EZ-BLE PRoC module is received by i2cInBuffer [0] -i2cInBuffer [3] of PSoC4000S using I2C communication.

The value of i2cInBuffer [0]: bit0 is set to LED4, i2cInBuffer [0]: bit1 is set to LED5, i2cInBuffer [0]: bit2 is set to LED6, and i2cInBuffer [0]: bit3 is set to LED7 connected to PSoC4000S.

Try typing the ASCII codes in order.

0 1 2 3 4 5 6 7 8 9 : ; < = > ?

After operation, we recommend erasing the flash of CYBLE-022001-00 with PSoC Programer.

Best regards,


0 Replies
Top labels