#include // Include the Wire library for I2C communication void setup() { Serial.begin(9600); // Initialize serial communication at 9600 baud rate Wire.begin(); // Initialize the I2C communication } void loop() { Wire.requestFrom(9, 1); // Request 1 byte from the slave device with address 9 while (Wire.available()) { int data = Wire.read(); // Read the byte received from the slave Serial.print("Pos:"); // Print "Pos:" to serial monitor Serial.println(data); // Print the received data to serial monitor // Additional processing can be done here } delay(500); // Delay for 500 milliseconds }