// Add to Wi-Fi Robot Car sketch — XBOTNOW (core esp32 v3.x)
#include <esp_now.h>

struct DrivePacket { int16_t left; int16_t right; uint8_t seq; };

void onDrive(const esp_now_recv_info_t* info, const uint8_t* data, int len) {
  if (len != sizeof(DrivePacket)) return;
  DrivePacket p; memcpy(&p, data, sizeof(p));
  drive(constrain(p.left, -255, 255), constrain(p.right, -255, 255));
  lastCmd = millis();          // feeds the same 500 ms watchdog
}

// in setup(), replace WiFi.softAP(...) with:
//   WiFi.mode(WIFI_AP_STA);
//   WiFi.softAP(AP_SSID, AP_PASS, 1);          // fixed channel 1
//   Serial.printf("Car MAC: %s\n", WiFi.macAddress().c_str());
//   esp_now_init();
//   esp_now_register_recv_cb(onDrive);
