我正试图通过Wi-Fi网络将信息从arduino板发送到我的电脑.为了我的项目的目的,它必须是UDP连接我使用"发送和接收UDP字符串"示例(http://arduino.cc/en/Tutorial/WiFiSendReceiveUDPString),并进行一些更改:
#include <SPI.h>
#include <WiFi.h>
#include <WiFiUdp.h>
int status = WL_IDLE_STATUS;
char ssid[] = "itay_net"; // your network SSID (name)
char pass[] = "0527414540"; // your network password (use for WPA, or use as key for WEP)
unsigned int localPort = 50505; // local port to listen on
IPAddress remote_ip(192, 168, 1, 100);
unsigned int remote_port = 50505;
char ReplyBuffer[] = "acknowledged"; // a string to send back
WiFiUDP Udp;
void setup() {
//Initialize serial and wait for …Run Code Online (Sandbox Code Playgroud)