![]() ![]() This can be done using the command line “requestFrom(8,1)”. In the next step, the master requests to receive one byte of data from the slave that has the address “8”.Finally, the transmission of data is ended using the command line “endTransmission()”. Then, using the function “write()”, some characters containing some letters signs are sent, and then, a byte of the actual data is sent. Then, using the function “beginTransmission(8)”, the address of the slave is entered and I2C communication is started for data transfer.In the main loop, the analog input is stored in the variable “value” and converted to the range of 0-255.We start working with library using the “begin()” function.The following points are worth mentioning regarding the code above: We want to send the value of the potentiometer on the master side to the slave and receive a byte of the potentiometer data by the slave, display it on the Serial Monitor and control the brightness of the LED with it. ![]()
0 Comments
Leave a Reply. |