Catégories
Liens
ESP32 fonctionne avec du 3.3v, éviter le 5v
#include <WiFi.h> #include <WiFiUdp.h> #include <OSCMessage.h> char ssid[] = "*****************"; // your network SSID (name) char pass[] = "*******"; // your network password WiFiUDP Udp; // A UDP instance to let us send and receive packets over UDP const IPAddress outIp(10,40,10,105); // remote IP of your computer const unsigned int outPort = 9999; // remote port to receive OSC const unsigned int localPort = 8888; // local port to listen for OSC packets (actually not used for sending) void setup() { Serial.begin(115200); // Connect to WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, pass); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Starting UDP"); Udp.begin(localPort); Serial.print("Local port: "); Serial.println(Udp.localPort()); } void loop() { OSCMessage msg("/test"); msg.add("hello, osc."); Udp.beginPacket(outIp, outPort); msg.send(Udp); Udp.endPacket(); msg.empty(); delay(500); }