safwan092

Untitled

May 3rd, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <Wire.h>
  2.  
  3. #define ESP32_ADDRESS 0x10
  4.  
  5. void setup() {
  6. Wire.begin(); // Initialize I2C bus
  7. Serial.begin(9600); // Initialize serial communication
  8. }
  9.  
  10. void loop() {
  11. // Data to send to ESP32 Xiao C3
  12. byte data[] = {0x01, 0x02, 0x03, 0x04, 0x05};
  13.  
  14. // Send data to ESP32 Xiao C3
  15. Wire.beginTransmission(ESP32_ADDRESS);
  16. Wire.write(data, sizeof(data));
  17. Wire.endTransmission();
  18.  
  19. Serial.println("Data sent");
  20.  
  21. // Wait for some time
  22. delay(1000);
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment