17279浏览
查看: 17279|回复: 5

[项目] Arduino UNO R4 与行空板 LED矩阵互动

[复制链接]
本帖最后由 云天 于 2023-8-24 17:59 编辑

Arduino UNO R4 与行空板 LED矩阵互动图3


作为市场上最受欢迎的开源硬件之一,Arduino Uno R3 早在 2010 年就推出了,这款诞生已经超过十年的硬件可以说性能已经有点落后了。在大家都在翘首期盼之时,2023年3月份 Arduino 正式发布了 Arduino Uno R3 的升级版 —— Arduino Uno R4,新产品在处理能力、内存、存储和连接等方面都带来了巨大提升。
Arduino UNO R4 与行空板 LED矩阵互动图5

在 Uno R4 的官方照片中(上面的图),Arduino 用黄色和蓝绿色遮盖了 PCB 的部分区域,官方表示只有在接近发售时才会透露隐藏在这些区域的到底是什么?
Arduino UNO R4 与行空板 LED矩阵互动图6

原来是板载12x8的LED矩阵。
  • 具备WiFi和蓝牙功能
    • UNO R4 WiFi具有ESP32-S3-MINI协处理器,可增强RA4M1微控制器的功能。具备WiFi和蓝牙连接功能,使得开发者可以轻松连接到互联网并创建物联网项目。
  • 板载12x8的LED矩阵。
    • UNO R4 WiFi板载了一个明亮的12x8红色LED矩阵(总共96个点)。该功能非常适合使用动画或绘制传感器数据的创意项目,无需任何额外的硬件。
下面我来测试一下WIFI和LED矩阵,本项目一个亮点是用程序生成程序代码。
一、网页控制LED矩阵
1.UNO R4程序
  1. /*
  2.   WiFi Web Server LED Blink
  3. A simple web server that lets you blink an LED via the web.
  4. This sketch will print the IP address of your WiFi module (once connected)
  5. to the Serial Monitor. From there, you can open that address in a web browser
  6. to turn on and off the LED_BUILTIN.
  7. If the IP address of your board is yourAddress:
  8. http://yourAddress/H turns the LED on
  9. http://yourAddress/L turns it off
  10. This example is written for a network using WPA encryption. For
  11. WEP or WPA, change the WiFi.begin() call accordingly.
  12. Circuit:
  13. * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
  14. * LED attached to pin 9
  15. created 25 Nov 2012
  16. by Tom Igoe
  17. */
  18. #include "WiFiS3.h"
  19. #include "arduino_secrets.h"
  20. #include "Arduino_LED_Matrix.h"
  21. ArduinoLEDMatrix matrix;
  22. uint8_t frame[2][8][12] = {{
  23.   { 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0 },
  24.   { 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0 },
  25.   { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1 },
  26.   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
  27.   { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
  28.   { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
  29.   { 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
  30.   { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 }
  31.   },{
  32.   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
  33.   { 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
  34.   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  35.   { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
  36.   { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
  37.   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  38.   { 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
  39.   { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
  40.   }
  41. };
  42. ///////please enter your sensitive data in the Secret tab/arduino_secrets.h
  43. char ssid[] = SECRET_SSID;        // your network SSID (name)
  44. char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
  45. int keyIndex = 0;                 // your network key index number (needed only for WEP)
  46. int led =  LED_BUILTIN;
  47. int status = WL_IDLE_STATUS;
  48. WiFiServer server(80);
  49. void setup() {
  50.   Serial.begin(9600);      // initialize serial communication
  51.   pinMode(led, OUTPUT);      // set the LED pin mode
  52.   matrix.begin();
  53.   // check for the WiFi module:
  54.   if (WiFi.status() == WL_NO_MODULE) {
  55.     Serial.println("Communication with WiFi module failed!");
  56.     // don't continue
  57.     while (true);
  58.   }
  59.   String fv = WiFi.firmwareVersion();
  60.   if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
  61.     Serial.println("Please upgrade the firmware");
  62.   }
  63.   // attempt to connect to WiFi network:
  64.   while (status != WL_CONNECTED) {
  65.     Serial.print("Attempting to connect to Network named: ");
  66.     Serial.println(ssid);                   // print the network name (SSID);
  67.     // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
  68.     status = WiFi.begin(ssid, pass);
  69.     // wait 10 seconds for connection:
  70.     delay(10000);
  71.   }
  72.   server.begin();                           // start the web server on port 80
  73.   printWifiStatus();                        // you're connected now, so print out the status
  74. }
  75. void loop() {
  76.   WiFiClient client = server.available();   // listen for incoming clients
  77.   if (client) {                             // if you get a client,
  78.     Serial.println("new client");           // print a message out the serial port
  79.     String currentLine = "";                // make a String to hold incoming data from the client
  80.     while (client.connected()) {            // loop while the client's connected
  81.       if (client.available()) {             // if there's bytes to read from the client,
  82.         char c = client.read();             // read a byte, then
  83.         Serial.write(c);                    // print it out to the serial monitor
  84.         if (c == '\n') {                    // if the byte is a newline character
  85.           // if the current line is blank, you got two newline characters in a row.
  86.           // that's the end of the client HTTP request, so send a response:
  87.           if (currentLine.length() == 0) {
  88.             // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
  89.             // and a content-type so the client knows what's coming, then a blank line:
  90.             client.println("HTTP/1.1 200 OK");
  91.             client.println("Content-type:text/html");
  92.             client.println();
  93.             // the content of the HTTP response follows the header:
  94.             client.print("<p style="font-size:7vw;">Click <a href="/H">here</a> turn the LED on<br></p>");
  95.             client.print("<p style="font-size:7vw;">Click <a href="/L">here</a> turn the LED off<br></p>");
  96.             
  97.             // The HTTP response ends with another blank line:
  98.             client.println();
  99.             // break out of the while loop:
  100.             break;
  101.           } else {    // if you got a newline, then clear currentLine:
  102.             currentLine = "";
  103.           }
  104.         } else if (c != '\r') {  // if you got anything else but a carriage return character,
  105.           currentLine += c;      // add it to the end of the currentLine
  106.         }
  107.         // Check to see if the client request was "GET /H" or "GET /L":
  108.         if (currentLine.endsWith("GET /H")) {
  109.           digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
  110.           matrix.renderBitmap(frame[0], 8, 12);
  111.         }
  112.         if (currentLine.endsWith("GET /L")) {
  113.           digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
  114.           matrix.renderBitmap(frame[1], 8, 12);
  115.         }
  116.       }
  117.       
  118.     }
  119.     // close the connection:
  120.     client.stop();
  121.     Serial.println("client disconnected");
  122.   }
  123. }
  124. void printWifiStatus() {
  125.   // print the SSID of the network you're attached to:
  126.   Serial.print("SSID: ");
  127.   Serial.println(WiFi.SSID());
  128.   // print your board's IP address:
  129.   IPAddress ip = WiFi.localIP();
  130.   Serial.print("IP Address: ");
  131.   Serial.println(ip);
  132.   // print the received signal strength:
  133.   long rssi = WiFi.RSSI();
  134.   Serial.print("signal strength (RSSI):");
  135.   Serial.print(rssi);
  136.   Serial.println(" dBm");
  137.   // print where to go in a browser:
  138.   Serial.print("To see this page in action, open a browser to http://");
  139.   Serial.println(ip);
  140. }
复制代码
Arduino UNO R4 与行空板 LED矩阵互动图7


2.演示视频

二、UNO R4与行空板LED矩阵互动

1.分析LED矩阵


Arduino UNO R4 与行空板 LED矩阵互动图8

LED矩阵为8*12

2.分析显示程序中数据结构

  1. const uint32_t heart[] = {
  2.         0x3184a444,
  3.         0x44042081,
  4.         0x100a0040
  5. };
复制代码
数组中三个数据,十六进制,一个数据共32位,共96位,每位与LED灯珠一一对应。

3.行空板上“灯珠”设计

Arduino UNO R4 与行空板 LED矩阵互动图2

Arduino UNO R4 与行空板 LED矩阵互动图1

与UNO R4 LED矩阵一一对应。

4.UNO R4程序

  1. /*
  2.   WiFi UDP Send and Receive String
  3. This sketch waits for a UDP packet on localPort using the WiFi module.
  4. When a packet is received an Acknowledge packet is sent to the client on port remotePort
  5. created 30 December 2012
  6. by dlf (Metodo2 srl)
  7. */
  8. #include <WiFiS3.h>
  9. int status = WL_IDLE_STATUS;
  10. #include "arduino_secrets.h"
  11. #include "Arduino_LED_Matrix.h"
  12. ArduinoLEDMatrix matrix;
  13. ///////please enter your sensitive data in the Secret tab/arduino_secrets.h
  14. char ssid[] = SECRET_SSID;        // your network SSID (name)
  15. char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
  16. int keyIndex = 0;            // your network key index number (needed only for WEP)
  17. unsigned int localPort = 2390;      // local port to listen on
  18. char packetBuffer[256]; //buffer to hold incoming packet
  19. char  ReplyBuffer[] = "acknowledged\n";       // a string to send back
  20. WiFiUDP Udp;
  21. uint32_t frame[] = {
  22.   0, 0, 0, 0
  23. };
  24. void setup() {
  25.   //Initialize serial and wait for port to open:
  26.   Serial.begin(9600);
  27.   matrix.begin();
  28.   while (!Serial) {
  29.     ; // wait for serial port to connect. Needed for native USB port only
  30.   }
  31.   // check for the WiFi module:
  32.   if (WiFi.status() == WL_NO_MODULE) {
  33.     Serial.println("Communication with WiFi module failed!");
  34.     // don't continue
  35.     while (true);
  36.   }
  37.   String fv = WiFi.firmwareVersion();
  38.   if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
  39.     Serial.println("Please upgrade the firmware");
  40.   }
  41.   // attempt to connect to WiFi network:
  42.   while (status != WL_CONNECTED) {
  43.     Serial.print("Attempting to connect to SSID: ");
  44.     Serial.println(ssid);
  45.     // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
  46.     status = WiFi.begin(ssid, pass);
  47.     // wait 10 seconds for connection:
  48.     delay(10000);
  49.   }
  50.   Serial.println("Connected to WiFi");
  51.   printWifiStatus();
  52.   Serial.println("\nStarting connection to server...");
  53.   // if you get a connection, report back via serial:
  54.   Udp.begin(localPort);
  55. }
  56. void loop() {
  57.   // if there's data available, read a packet
  58.   int packetSize = Udp.parsePacket();
  59.   if (packetSize) {
  60.     Serial.print("Received packet of size ");
  61.     Serial.println(packetSize);
  62.     Serial.print("From ");
  63.     IPAddress remoteIp = Udp.remoteIP();
  64.     Serial.print(remoteIp);
  65.     Serial.print(", port ");
  66.     Serial.println(Udp.remotePort());
  67.     // read the packet into packetBuffer
  68.     int len = Udp.read(packetBuffer, 255);
  69.     if (len > 0) {
  70.       packetBuffer[len] = 0;
  71.     }
  72.     Serial.println("Contents:");
  73.     Serial.println(packetBuffer);
  74.     int fra=String(packetBuffer[0]).toInt();
  75.     String MyString="";
  76.     MyString.concat(packetBuffer[1]);
  77.     MyString.concat(packetBuffer[2]);
  78.     int num=31-MyString.toInt();
  79.     frame[fra]=frame[fra]^(1<<num);
  80.    
  81.     matrix.loadFrame(frame);
  82.    
  83.    
  84.     // send a reply, to the IP address and port that sent us the packet we received
  85.     //Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
  86.     //Udp.write(ReplyBuffer);
  87.    
  88.     //Udp.endPacket();
  89.   }
  90. }
  91. void printWifiStatus() {
  92.   // print the SSID of the network you're attached to:
  93.   Serial.print("SSID: ");
  94.   Serial.println(WiFi.SSID());
  95.   // print your board's IP address:
  96.   IPAddress ip = WiFi.localIP();
  97.   Serial.print("IP Address: ");
  98.   Serial.println(ip);
  99.   // print the received signal strength:
  100.   long rssi = WiFi.RSSI();
  101.   Serial.print("signal strength (RSSI):");
  102.   Serial.print(rssi);
  103.   Serial.println(" dBm");
  104. }
复制代码
重点程序是对接收的数据进行分析,并显示在LED矩阵上。
  1. int fra=String(packetBuffer[0]).toInt();
  2.    String MyString="";
  3.    MyString.concat(packetBuffer[1]);
  4.    MyString.concat(packetBuffer[2]);
  5.    int num=31-MyString.toInt();
  6.    frame[fra]=frame[fra]^(1<<num);
  7.    
  8.    matrix.loadFrame(frame);
复制代码
5.行空板程序
(1)先生成两个“灯珠”进行测试
  1. from unihiker import GUI
  2. import socket
  3. # 创建UDP socket
  4. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  5. # 绑定要发送的IP地址和端口号
  6. target_ip = '192.168.31.210'
  7. target_port = 2390
  8. data=[]
  9. for i in range(0,96):
  10.     data.append(0)
  11. # 事件回调函数
  12. def button_click031():
  13.   global data
  14.   if data[1]:
  15.     s.sendto("031".encode(), (target_ip, target_port))
  16.     d031.config(color='#000000')
  17.     data[1]=0
  18.   else:
  19.     s.sendto("031".encode(), (target_ip, target_port))
  20.     d031.config(color='#FF0000')
  21.     data[1]=1
  22. def button_click030():
  23.   global data
  24.   if data[0]:
  25.     s.sendto("030".encode(), (target_ip, target_port))
  26.     d030.config(color='#000000')
  27.     data[0]=0
  28.   else:
  29.     s.sendto("030".encode(), (target_ip, target_port))
  30.     d030.config(color='#FF0000')
  31.     data[0]=1
  32. u_gui=GUI()
  33. d031=u_gui.fill_circle(x=226,y=13,r=13,color="#000000")
  34. d031.config(onclick=button_click031)
  35. d030=u_gui.fill_circle(x=226,y=39,r=13,color="#000000")
  36. d030.config(onclick=button_click030)
  37. while 1:
  38.     pass
  39. s.close()
复制代码
(2)因要生成96个“灯珠”和96个“回调函数”,所以我使用Python程序生成程序代码。
1)生成96个“回调函数”程序
  1. fileObj = open("Mind+.txt", "w", encoding="UTF8")
  2. for k in range(0,3):
  3. for i in range(0,32):
  4.     if i<10:
  5.       j="0"+str(i)
  6.     else:
  7.       j=str(i)
  8.     fileObj.write("def button_click"+str(k)+j+"():\r")
  9.     fileObj.write("  global data\r")
  10.     fileObj.write("  if data["+str(32*k+i)+"]:\r")
  11.     fileObj.write("    s.sendto("+"""+str(k)+j+"""+".encode(), (target_ip, target_port))\r")
  12.     fileObj.write("    d"+str(k)+j+".config(color="+"'#000000')\r")
  13.     fileObj.write("    data["+str(32*k+i)+"]=0\r")
  14.     fileObj.write("  else:\r")
  15.     fileObj.write("    s.sendto("+"""+str(k)+j+"""+".encode(), (target_ip, target_port))\r")
  16.     fileObj.write("    d"+str(k)+j+".config(color="+"'#FF0000')\r")
  17.     fileObj.write("    data["+str(32*k+i)+"]=1\r")
  18. fileObj.close()
复制代码


生成的“回调函数”代码
  1. def button_click000():
  2.   global data
  3.   if data[0]:
  4.     s.sendto("000".encode(), (target_ip, target_port))
  5.     d000.config(color='#000000')
  6.     data[0]=0
  7.   else:
  8.     s.sendto("000".encode(), (target_ip, target_port))
  9.     d000.config(color='#FF0000')
  10.     data[0]=1
  11. def button_click001():
  12.   global data
  13.   if data[1]:
  14.     s.sendto("001".encode(), (target_ip, target_port))
  15.     d001.config(color='#000000')
  16.     data[1]=0
  17.   else:
  18.     s.sendto("001".encode(), (target_ip, target_port))
  19.     d001.config(color='#FF0000')
  20.     data[1]=1
  21. def button_click002():
  22.   global data
  23.   if data[2]:
  24.     s.sendto("002".encode(), (target_ip, target_port))
  25.     d002.config(color='#000000')
  26.     data[2]=0
  27.   else:
  28.     s.sendto("002".encode(), (target_ip, target_port))
  29.     d002.config(color='#FF0000')
  30.     data[2]=1
  31. def button_click003():
  32.   global data
  33.   if data[3]:
  34.     s.sendto("003".encode(), (target_ip, target_port))
  35.     d003.config(color='#000000')
  36.     data[3]=0
  37.   else:
  38.     s.sendto("003".encode(), (target_ip, target_port))
  39.     d003.config(color='#FF0000')
  40.     data[3]=1
  41. def button_click004():
  42.   global data
  43.   if data[4]:
  44.     s.sendto("004".encode(), (target_ip, target_port))
  45.     d004.config(color='#000000')
  46.     data[4]=0
  47.   else:
  48.     s.sendto("004".encode(), (target_ip, target_port))
  49.     d004.config(color='#FF0000')
  50.     data[4]=1
  51. def button_click005():
  52.   global data
  53.   if data[5]:
  54.     s.sendto("005".encode(), (target_ip, target_port))
  55.     d005.config(color='#000000')
  56.     data[5]=0
  57.   else:
  58.     s.sendto("005".encode(), (target_ip, target_port))
  59.     d005.config(color='#FF0000')
  60.     data[5]=1
  61. def button_click006():
  62.   global data
  63.   if data[6]:
  64.     s.sendto("006".encode(), (target_ip, target_port))
  65.     d006.config(color='#000000')
  66.     data[6]=0
  67.   else:
  68.     s.sendto("006".encode(), (target_ip, target_port))
  69.     d006.config(color='#FF0000')
  70.     data[6]=1
  71. def button_click007():
  72.   global data
  73.   if data[7]:
  74.     s.sendto("007".encode(), (target_ip, target_port))
  75.     d007.config(color='#000000')
  76.     data[7]=0
  77.   else:
  78.     s.sendto("007".encode(), (target_ip, target_port))
  79.     d007.config(color='#FF0000')
  80.     data[7]=1
  81. def button_click008():
  82.   global data
  83.   if data[8]:
  84.     s.sendto("008".encode(), (target_ip, target_port))
  85.     d008.config(color='#000000')
  86.     data[8]=0
  87.   else:
  88.     s.sendto("008".encode(), (target_ip, target_port))
  89.     d008.config(color='#FF0000')
  90.     data[8]=1
  91. def button_click009():
  92.   global data
  93.   if data[9]:
  94.     s.sendto("009".encode(), (target_ip, target_port))
  95.     d009.config(color='#000000')
  96.     data[9]=0
  97.   else:
  98.     s.sendto("009".encode(), (target_ip, target_port))
  99.     d009.config(color='#FF0000')
  100.     data[9]=1
  101. def button_click010():
  102.   global data
  103.   if data[10]:
  104.     s.sendto("010".encode(), (target_ip, target_port))
  105.     d010.config(color='#000000')
  106.     data[10]=0
  107.   else:
  108.     s.sendto("010".encode(), (target_ip, target_port))
  109.     d010.config(color='#FF0000')
  110.     data[10]=1
  111. def button_click011():
  112.   global data
  113.   if data[11]:
  114.     s.sendto("011".encode(), (target_ip, target_port))
  115.     d011.config(color='#000000')
  116.     data[11]=0
  117.   else:
  118.     s.sendto("011".encode(), (target_ip, target_port))
  119.     d011.config(color='#FF0000')
  120.     data[11]=1
  121. def button_click012():
  122.   global data
  123.   if data[12]:
  124.     s.sendto("012".encode(), (target_ip, target_port))
  125.     d012.config(color='#000000')
  126.     data[12]=0
  127.   else:
  128.     s.sendto("012".encode(), (target_ip, target_port))
  129.     d012.config(color='#FF0000')
  130.     data[12]=1
  131. def button_click013():
  132.   global data
  133.   if data[13]:
  134.     s.sendto("013".encode(), (target_ip, target_port))
  135.     d013.config(color='#000000')
  136.     data[13]=0
  137.   else:
  138.     s.sendto("013".encode(), (target_ip, target_port))
  139.     d013.config(color='#FF0000')
  140.     data[13]=1
  141. def button_click014():
  142.   global data
  143.   if data[14]:
  144.     s.sendto("014".encode(), (target_ip, target_port))
  145.     d014.config(color='#000000')
  146.     data[14]=0
  147.   else:
  148.     s.sendto("014".encode(), (target_ip, target_port))
  149.     d014.config(color='#FF0000')
  150.     data[14]=1
  151. def button_click015():
  152.   global data
  153.   if data[15]:
  154.     s.sendto("015".encode(), (target_ip, target_port))
  155.     d015.config(color='#000000')
  156.     data[15]=0
  157.   else:
  158.     s.sendto("015".encode(), (target_ip, target_port))
  159.     d015.config(color='#FF0000')
  160.     data[15]=1
  161. def button_click016():
  162.   global data
  163.   if data[16]:
  164.     s.sendto("016".encode(), (target_ip, target_port))
  165.     d016.config(color='#000000')
  166.     data[16]=0
  167.   else:
  168.     s.sendto("016".encode(), (target_ip, target_port))
  169.     d016.config(color='#FF0000')
  170.     data[16]=1
  171. def button_click017():
  172.   global data
  173.   if data[17]:
  174.     s.sendto("017".encode(), (target_ip, target_port))
  175.     d017.config(color='#000000')
  176.     data[17]=0
  177.   else:
  178.     s.sendto("017".encode(), (target_ip, target_port))
  179.     d017.config(color='#FF0000')
  180.     data[17]=1
  181. def button_click018():
  182.   global data
  183.   if data[18]:
  184.     s.sendto("018".encode(), (target_ip, target_port))
  185.     d018.config(color='#000000')
  186.     data[18]=0
  187.   else:
  188.     s.sendto("018".encode(), (target_ip, target_port))
  189.     d018.config(color='#FF0000')
  190.     data[18]=1
  191. def button_click019():
  192.   global data
  193.   if data[19]:
  194.     s.sendto("019".encode(), (target_ip, target_port))
  195.     d019.config(color='#000000')
  196.     data[19]=0
  197.   else:
  198.     s.sendto("019".encode(), (target_ip, target_port))
  199.     d019.config(color='#FF0000')
  200.     data[19]=1
  201. def button_click020():
  202.   global data
  203.   if data[20]:
  204.     s.sendto("020".encode(), (target_ip, target_port))
  205.     d020.config(color='#000000')
  206.     data[20]=0
  207.   else:
  208.     s.sendto("020".encode(), (target_ip, target_port))
  209.     d020.config(color='#FF0000')
  210.     data[20]=1
  211. def button_click021():
  212.   global data
  213.   if data[21]:
  214.     s.sendto("021".encode(), (target_ip, target_port))
  215.     d021.config(color='#000000')
  216.     data[21]=0
  217.   else:
  218.     s.sendto("021".encode(), (target_ip, target_port))
  219.     d021.config(color='#FF0000')
  220.     data[21]=1
  221. def button_click022():
  222.   global data
  223.   if data[22]:
  224.     s.sendto("022".encode(), (target_ip, target_port))
  225.     d022.config(color='#000000')
  226.     data[22]=0
  227.   else:
  228.     s.sendto("022".encode(), (target_ip, target_port))
  229.     d022.config(color='#FF0000')
  230.     data[22]=1
  231. def button_click023():
  232.   global data
  233.   if data[23]:
  234.     s.sendto("023".encode(), (target_ip, target_port))
  235.     d023.config(color='#000000')
  236.     data[23]=0
  237.   else:
  238.     s.sendto("023".encode(), (target_ip, target_port))
  239.     d023.config(color='#FF0000')
  240.     data[23]=1
  241. def button_click024():
  242.   global data
  243.   if data[24]:
  244.     s.sendto("024".encode(), (target_ip, target_port))
  245.     d024.config(color='#000000')
  246.     data[24]=0
  247.   else:
  248.     s.sendto("024".encode(), (target_ip, target_port))
  249.     d024.config(color='#FF0000')
  250.     data[24]=1
  251. def button_click025():
  252.   global data
  253.   if data[25]:
  254.     s.sendto("025".encode(), (target_ip, target_port))
  255.     d025.config(color='#000000')
  256.     data[25]=0
  257.   else:
  258.     s.sendto("025".encode(), (target_ip, target_port))
  259.     d025.config(color='#FF0000')
  260.     data[25]=1
  261. def button_click026():
  262.   global data
  263.   if data[26]:
  264.     s.sendto("026".encode(), (target_ip, target_port))
  265.     d026.config(color='#000000')
  266.     data[26]=0
  267.   else:
  268.     s.sendto("026".encode(), (target_ip, target_port))
  269.     d026.config(color='#FF0000')
  270.     data[26]=1
  271. def button_click027():
  272.   global data
  273.   if data[27]:
  274.     s.sendto("027".encode(), (target_ip, target_port))
  275.     d027.config(color='#000000')
  276.     data[27]=0
  277.   else:
  278.     s.sendto("027".encode(), (target_ip, target_port))
  279.     d027.config(color='#FF0000')
  280.     data[27]=1
  281. def button_click028():
  282.   global data
  283.   if data[28]:
  284.     s.sendto("028".encode(), (target_ip, target_port))
  285.     d028.config(color='#000000')
  286.     data[28]=0
  287.   else:
  288.     s.sendto("028".encode(), (target_ip, target_port))
  289.     d028.config(color='#FF0000')
  290.     data[28]=1
  291. def button_click029():
  292.   global data
  293.   if data[29]:
  294.     s.sendto("029".encode(), (target_ip, target_port))
  295.     d029.config(color='#000000')
  296.     data[29]=0
  297.   else:
  298.     s.sendto("029".encode(), (target_ip, target_port))
  299.     d029.config(color='#FF0000')
  300.     data[29]=1
  301. def button_click030():
  302.   global data
  303.   if data[30]:
  304.     s.sendto("030".encode(), (target_ip, target_port))
  305.     d030.config(color='#000000')
  306.     data[30]=0
  307.   else:
  308.     s.sendto("030".encode(), (target_ip, target_port))
  309.     d030.config(color='#FF0000')
  310.     data[30]=1
  311. def button_click031():
  312.   global data
  313.   if data[31]:
  314.     s.sendto("031".encode(), (target_ip, target_port))
  315.     d031.config(color='#000000')
  316.     data[31]=0
  317.   else:
  318.     s.sendto("031".encode(), (target_ip, target_port))
  319.     d031.config(color='#FF0000')
  320.     data[31]=1
  321. def button_click100():
  322.   global data
  323.   if data[32]:
  324.     s.sendto("100".encode(), (target_ip, target_port))
  325.     d100.config(color='#000000')
  326.     data[32]=0
  327.   else:
  328.     s.sendto("100".encode(), (target_ip, target_port))
  329.     d100.config(color='#FF0000')
  330.     data[32]=1
  331. def button_click101():
  332.   global data
  333.   if data[33]:
  334.     s.sendto("101".encode(), (target_ip, target_port))
  335.     d101.config(color='#000000')
  336.     data[33]=0
  337.   else:
  338.     s.sendto("101".encode(), (target_ip, target_port))
  339.     d101.config(color='#FF0000')
  340.     data[33]=1
  341. def button_click102():
  342.   global data
  343.   if data[34]:
  344.     s.sendto("102".encode(), (target_ip, target_port))
  345.     d102.config(color='#000000')
  346.     data[34]=0
  347.   else:
  348.     s.sendto("102".encode(), (target_ip, target_port))
  349.     d102.config(color='#FF0000')
  350.     data[34]=1
  351. def button_click103():
  352.   global data
  353.   if data[35]:
  354.     s.sendto("103".encode(), (target_ip, target_port))
  355.     d103.config(color='#000000')
  356.     data[35]=0
  357.   else:
  358.     s.sendto("103".encode(), (target_ip, target_port))
  359.     d103.config(color='#FF0000')
  360.     data[35]=1
  361. def button_click104():
  362.   global data
  363.   if data[36]:
  364.     s.sendto("104".encode(), (target_ip, target_port))
  365.     d104.config(color='#000000')
  366.     data[36]=0
  367.   else:
  368.     s.sendto("104".encode(), (target_ip, target_port))
  369.     d104.config(color='#FF0000')
  370.     data[36]=1
  371. def button_click105():
  372.   global data
  373.   if data[37]:
  374.     s.sendto("105".encode(), (target_ip, target_port))
  375.     d105.config(color='#000000')
  376.     data[37]=0
  377.   else:
  378.     s.sendto("105".encode(), (target_ip, target_port))
  379.     d105.config(color='#FF0000')
  380.     data[37]=1
  381. def button_click106():
  382.   global data
  383.   if data[38]:
  384.     s.sendto("106".encode(), (target_ip, target_port))
  385.     d106.config(color='#000000')
  386.     data[38]=0
  387.   else:
  388.     s.sendto("106".encode(), (target_ip, target_port))
  389.     d106.config(color='#FF0000')
  390.     data[38]=1
  391. def button_click107():
  392.   global data
  393.   if data[39]:
  394.     s.sendto("107".encode(), (target_ip, target_port))
  395.     d107.config(color='#000000')
  396.     data[39]=0
  397.   else:
  398.     s.sendto("107".encode(), (target_ip, target_port))
  399.     d107.config(color='#FF0000')
  400.     data[39]=1
  401. def button_click108():
  402.   global data
  403.   if data[40]:
  404.     s.sendto("108".encode(), (target_ip, target_port))
  405.     d108.config(color='#000000')
  406.     data[40]=0
  407.   else:
  408.     s.sendto("108".encode(), (target_ip, target_port))
  409.     d108.config(color='#FF0000')
  410.     data[40]=1
  411. def button_click109():
  412.   global data
  413.   if data[41]:
  414.     s.sendto("109".encode(), (target_ip, target_port))
  415.     d109.config(color='#000000')
  416.     data[41]=0
  417.   else:
  418.     s.sendto("109".encode(), (target_ip, target_port))
  419.     d109.config(color='#FF0000')
  420.     data[41]=1
  421. def button_click110():
  422.   global data
  423.   if data[42]:
  424.     s.sendto("110".encode(), (target_ip, target_port))
  425.     d110.config(color='#000000')
  426.     data[42]=0
  427.   else:
  428.     s.sendto("110".encode(), (target_ip, target_port))
  429.     d110.config(color='#FF0000')
  430.     data[42]=1
  431. def button_click111():
  432.   global data
  433.   if data[43]:
  434.     s.sendto("111".encode(), (target_ip, target_port))
  435.     d111.config(color='#000000')
  436.     data[43]=0
  437.   else:
  438.     s.sendto("111".encode(), (target_ip, target_port))
  439.     d111.config(color='#FF0000')
  440.     data[43]=1
  441. def button_click112():
  442.   global data
  443.   if data[44]:
  444.     s.sendto("112".encode(), (target_ip, target_port))
  445.     d112.config(color='#000000')
  446.     data[44]=0
  447.   else:
  448.     s.sendto("112".encode(), (target_ip, target_port))
  449.     d112.config(color='#FF0000')
  450.     data[44]=1
  451. def button_click113():
  452.   global data
  453.   if data[45]:
  454.     s.sendto("113".encode(), (target_ip, target_port))
  455.     d113.config(color='#000000')
  456.     data[45]=0
  457.   else:
  458.     s.sendto("113".encode(), (target_ip, target_port))
  459.     d113.config(color='#FF0000')
  460.     data[45]=1
  461. def button_click114():
  462.   global data
  463.   if data[46]:
  464.     s.sendto("114".encode(), (target_ip, target_port))
  465.     d114.config(color='#000000')
  466.     data[46]=0
  467.   else:
  468.     s.sendto("114".encode(), (target_ip, target_port))
  469.     d114.config(color='#FF0000')
  470.     data[46]=1
  471. def button_click115():
  472.   global data
  473.   if data[47]:
  474.     s.sendto("115".encode(), (target_ip, target_port))
  475.     d115.config(color='#000000')
  476.     data[47]=0
  477.   else:
  478.     s.sendto("115".encode(), (target_ip, target_port))
  479.     d115.config(color='#FF0000')
  480.     data[47]=1
  481. def button_click116():
  482.   global data
  483.   if data[48]:
  484.     s.sendto("116".encode(), (target_ip, target_port))
  485.     d116.config(color='#000000')
  486.     data[48]=0
  487.   else:
  488.     s.sendto("116".encode(), (target_ip, target_port))
  489.     d116.config(color='#FF0000')
  490.     data[48]=1
  491. def button_click117():
  492.   global data
  493.   if data[49]:
  494.     s.sendto("117".encode(), (target_ip, target_port))
  495.     d117.config(color='#000000')
  496.     data[49]=0
  497.   else:
  498.     s.sendto("117".encode(), (target_ip, target_port))
  499.     d117.config(color='#FF0000')
  500.     data[49]=1
  501. def button_click118():
  502.   global data
  503.   if data[50]:
  504.     s.sendto("118".encode(), (target_ip, target_port))
  505.     d118.config(color='#000000')
  506.     data[50]=0
  507.   else:
  508.     s.sendto("118".encode(), (target_ip, target_port))
  509.     d118.config(color='#FF0000')
  510.     data[50]=1
  511. def button_click119():
  512.   global data
  513.   if data[51]:
  514.     s.sendto("119".encode(), (target_ip, target_port))
  515.     d119.config(color='#000000')
  516.     data[51]=0
  517.   else:
  518.     s.sendto("119".encode(), (target_ip, target_port))
  519.     d119.config(color='#FF0000')
  520.     data[51]=1
  521. def button_click120():
  522.   global data
  523.   if data[52]:
  524.     s.sendto("120".encode(), (target_ip, target_port))
  525.     d120.config(color='#000000')
  526.     data[52]=0
  527.   else:
  528.     s.sendto("120".encode(), (target_ip, target_port))
  529.     d120.config(color='#FF0000')
  530.     data[52]=1
  531. def button_click121():
  532.   global data
  533.   if data[53]:
  534.     s.sendto("121".encode(), (target_ip, target_port))
  535.     d121.config(color='#000000')
  536.     data[53]=0
  537.   else:
  538.     s.sendto("121".encode(), (target_ip, target_port))
  539.     d121.config(color='#FF0000')
  540.     data[53]=1
  541. def button_click122():
  542.   global data
  543.   if data[54]:
  544.     s.sendto("122".encode(), (target_ip, target_port))
  545.     d122.config(color='#000000')
  546.     data[54]=0
  547.   else:
  548.     s.sendto("122".encode(), (target_ip, target_port))
  549.     d122.config(color='#FF0000')
  550.     data[54]=1
  551. def button_click123():
  552.   global data
  553.   if data[55]:
  554.     s.sendto("123".encode(), (target_ip, target_port))
  555.     d123.config(color='#000000')
  556.     data[55]=0
  557.   else:
  558.     s.sendto("123".encode(), (target_ip, target_port))
  559.     d123.config(color='#FF0000')
  560.     data[55]=1
  561. def button_click124():
  562.   global data
  563.   if data[56]:
  564.     s.sendto("124".encode(), (target_ip, target_port))
  565.     d124.config(color='#000000')
  566.     data[56]=0
  567.   else:
  568.     s.sendto("124".encode(), (target_ip, target_port))
  569.     d124.config(color='#FF0000')
  570.     data[56]=1
  571. def button_click125():
  572.   global data
  573.   if data[57]:
  574.     s.sendto("125".encode(), (target_ip, target_port))
  575.     d125.config(color='#000000')
  576.     data[57]=0
  577.   else:
  578.     s.sendto("125".encode(), (target_ip, target_port))
  579.     d125.config(color='#FF0000')
  580.     data[57]=1
  581. def button_click126():
  582.   global data
  583.   if data[58]:
  584.     s.sendto("126".encode(), (target_ip, target_port))
  585.     d126.config(color='#000000')
  586.     data[58]=0
  587.   else:
  588.     s.sendto("126".encode(), (target_ip, target_port))
  589.     d126.config(color='#FF0000')
  590.     data[58]=1
  591. def button_click127():
  592.   global data
  593.   if data[59]:
  594.     s.sendto("127".encode(), (target_ip, target_port))
  595.     d127.config(color='#000000')
  596.     data[59]=0
  597.   else:
  598.     s.sendto("127".encode(), (target_ip, target_port))
  599.     d127.config(color='#FF0000')
  600.     data[59]=1
  601. def button_click128():
  602.   global data
  603.   if data[60]:
  604.     s.sendto("128".encode(), (target_ip, target_port))
  605.     d128.config(color='#000000')
  606.     data[60]=0
  607.   else:
  608.     s.sendto("128".encode(), (target_ip, target_port))
  609.     d128.config(color='#FF0000')
  610.     data[60]=1
  611. def button_click129():
  612.   global data
  613.   if data[61]:
  614.     s.sendto("129".encode(), (target_ip, target_port))
  615.     d129.config(color='#000000')
  616.     data[61]=0
  617.   else:
  618.     s.sendto("129".encode(), (target_ip, target_port))
  619.     d129.config(color='#FF0000')
  620.     data[61]=1
  621. def button_click130():
  622.   global data
  623.   if data[62]:
  624.     s.sendto("130".encode(), (target_ip, target_port))
  625.     d130.config(color='#000000')
  626.     data[62]=0
  627.   else:
  628.     s.sendto("130".encode(), (target_ip, target_port))
  629.     d130.config(color='#FF0000')
  630.     data[62]=1
  631. def button_click131():
  632.   global data
  633.   if data[63]:
  634.     s.sendto("131".encode(), (target_ip, target_port))
  635.     d131.config(color='#000000')
  636.     data[63]=0
  637.   else:
  638.     s.sendto("131".encode(), (target_ip, target_port))
  639.     d131.config(color='#FF0000')
  640.     data[63]=1
  641. def button_click200():
  642.   global data
  643.   if data[64]:
  644.     s.sendto("200".encode(), (target_ip, target_port))
  645.     d200.config(color='#000000')
  646.     data[64]=0
  647.   else:
  648.     s.sendto("200".encode(), (target_ip, target_port))
  649.     d200.config(color='#FF0000')
  650.     data[64]=1
  651. def button_click201():
  652.   global data
  653.   if data[65]:
  654.     s.sendto("201".encode(), (target_ip, target_port))
  655.     d201.config(color='#000000')
  656.     data[65]=0
  657.   else:
  658.     s.sendto("201".encode(), (target_ip, target_port))
  659.     d201.config(color='#FF0000')
  660.     data[65]=1
  661. def button_click202():
  662.   global data
  663.   if data[66]:
  664.     s.sendto("202".encode(), (target_ip, target_port))
  665.     d202.config(color='#000000')
  666.     data[66]=0
  667.   else:
  668.     s.sendto("202".encode(), (target_ip, target_port))
  669.     d202.config(color='#FF0000')
  670.     data[66]=1
  671. def button_click203():
  672.   global data
  673.   if data[67]:
  674.     s.sendto("203".encode(), (target_ip, target_port))
  675.     d203.config(color='#000000')
  676.     data[67]=0
  677.   else:
  678.     s.sendto("203".encode(), (target_ip, target_port))
  679.     d203.config(color='#FF0000')
  680.     data[67]=1
  681. def button_click204():
  682.   global data
  683.   if data[68]:
  684.     s.sendto("204".encode(), (target_ip, target_port))
  685.     d204.config(color='#000000')
  686.     data[68]=0
  687.   else:
  688.     s.sendto("204".encode(), (target_ip, target_port))
  689.     d204.config(color='#FF0000')
  690.     data[68]=1
  691. def button_click205():
  692.   global data
  693.   if data[69]:
  694.     s.sendto("205".encode(), (target_ip, target_port))
  695.     d205.config(color='#000000')
  696.     data[69]=0
  697.   else:
  698.     s.sendto("205".encode(), (target_ip, target_port))
  699.     d205.config(color='#FF0000')
  700.     data[69]=1
  701. def button_click206():
  702.   global data
  703.   if data[70]:
  704.     s.sendto("206".encode(), (target_ip, target_port))
  705.     d206.config(color='#000000')
  706.     data[70]=0
  707.   else:
  708.     s.sendto("206".encode(), (target_ip, target_port))
  709.     d206.config(color='#FF0000')
  710.     data[70]=1
  711. def button_click207():
  712.   global data
  713.   if data[71]:
  714.     s.sendto("207".encode(), (target_ip, target_port))
  715.     d207.config(color='#000000')
  716.     data[71]=0
  717.   else:
  718.     s.sendto("207".encode(), (target_ip, target_port))
  719.     d207.config(color='#FF0000')
  720.     data[71]=1
  721. def button_click208():
  722.   global data
  723.   if data[72]:
  724.     s.sendto("208".encode(), (target_ip, target_port))
  725.     d208.config(color='#000000')
  726.     data[72]=0
  727.   else:
  728.     s.sendto("208".encode(), (target_ip, target_port))
  729.     d208.config(color='#FF0000')
  730.     data[72]=1
  731. def button_click209():
  732.   global data
  733.   if data[73]:
  734.     s.sendto("209".encode(), (target_ip, target_port))
  735.     d209.config(color='#000000')
  736.     data[73]=0
  737.   else:
  738.     s.sendto("209".encode(), (target_ip, target_port))
  739.     d209.config(color='#FF0000')
  740.     data[73]=1
  741. def button_click210():
  742.   global data
  743.   if data[74]:
  744.     s.sendto("210".encode(), (target_ip, target_port))
  745.     d210.config(color='#000000')
  746.     data[74]=0
  747.   else:
  748.     s.sendto("210".encode(), (target_ip, target_port))
  749.     d210.config(color='#FF0000')
  750.     data[74]=1
  751. def button_click211():
  752.   global data
  753.   if data[75]:
  754.     s.sendto("211".encode(), (target_ip, target_port))
  755.     d211.config(color='#000000')
  756.     data[75]=0
  757.   else:
  758.     s.sendto("211".encode(), (target_ip, target_port))
  759.     d211.config(color='#FF0000')
  760.     data[75]=1
  761. def button_click212():
  762.   global data
  763.   if data[76]:
  764.     s.sendto("212".encode(), (target_ip, target_port))
  765.     d212.config(color='#000000')
  766.     data[76]=0
  767.   else:
  768.     s.sendto("212".encode(), (target_ip, target_port))
  769.     d212.config(color='#FF0000')
  770.     data[76]=1
  771. def button_click213():
  772.   global data
  773.   if data[77]:
  774.     s.sendto("213".encode(), (target_ip, target_port))
  775.     d213.config(color='#000000')
  776.     data[77]=0
  777.   else:
  778.     s.sendto("213".encode(), (target_ip, target_port))
  779.     d213.config(color='#FF0000')
  780.     data[77]=1
  781. def button_click214():
  782.   global data
  783.   if data[78]:
  784.     s.sendto("214".encode(), (target_ip, target_port))
  785.     d214.config(color='#000000')
  786.     data[78]=0
  787.   else:
  788.     s.sendto("214".encode(), (target_ip, target_port))
  789.     d214.config(color='#FF0000')
  790.     data[78]=1
  791. def button_click215():
  792.   global data
  793.   if data[79]:
  794.     s.sendto("215".encode(), (target_ip, target_port))
  795.     d215.config(color='#000000')
  796.     data[79]=0
  797.   else:
  798.     s.sendto("215".encode(), (target_ip, target_port))
  799.     d215.config(color='#FF0000')
  800.     data[79]=1
  801. def button_click216():
  802.   global data
  803.   if data[80]:
  804.     s.sendto("216".encode(), (target_ip, target_port))
  805.     d216.config(color='#000000')
  806.     data[80]=0
  807.   else:
  808.     s.sendto("216".encode(), (target_ip, target_port))
  809.     d216.config(color='#FF0000')
  810.     data[80]=1
  811. def button_click217():
  812.   global data
  813.   if data[81]:
  814.     s.sendto("217".encode(), (target_ip, target_port))
  815.     d217.config(color='#000000')
  816.     data[81]=0
  817.   else:
  818.     s.sendto("217".encode(), (target_ip, target_port))
  819.     d217.config(color='#FF0000')
  820.     data[81]=1
  821. def button_click218():
  822.   global data
  823.   if data[82]:
  824.     s.sendto("218".encode(), (target_ip, target_port))
  825.     d218.config(color='#000000')
  826.     data[82]=0
  827.   else:
  828.     s.sendto("218".encode(), (target_ip, target_port))
  829.     d218.config(color='#FF0000')
  830.     data[82]=1
  831. def button_click219():
  832.   global data
  833.   if data[83]:
  834.     s.sendto("219".encode(), (target_ip, target_port))
  835.     d219.config(color='#000000')
  836.     data[83]=0
  837.   else:
  838.     s.sendto("219".encode(), (target_ip, target_port))
  839.     d219.config(color='#FF0000')
  840.     data[83]=1
  841. def button_click220():
  842.   global data
  843.   if data[84]:
  844.     s.sendto("220".encode(), (target_ip, target_port))
  845.     d220.config(color='#000000')
  846.     data[84]=0
  847.   else:
  848.     s.sendto("220".encode(), (target_ip, target_port))
  849.     d220.config(color='#FF0000')
  850.     data[84]=1
  851. def button_click221():
  852.   global data
  853.   if data[85]:
  854.     s.sendto("221".encode(), (target_ip, target_port))
  855.     d221.config(color='#000000')
  856.     data[85]=0
  857.   else:
  858.     s.sendto("221".encode(), (target_ip, target_port))
  859.     d221.config(color='#FF0000')
  860.     data[85]=1
  861. def button_click222():
  862.   global data
  863.   if data[86]:
  864.     s.sendto("222".encode(), (target_ip, target_port))
  865.     d222.config(color='#000000')
  866.     data[86]=0
  867.   else:
  868.     s.sendto("222".encode(), (target_ip, target_port))
  869.     d222.config(color='#FF0000')
  870.     data[86]=1
  871. def button_click223():
  872.   global data
  873.   if data[87]:
  874.     s.sendto("223".encode(), (target_ip, target_port))
  875.     d223.config(color='#000000')
  876.     data[87]=0
  877.   else:
  878.     s.sendto("223".encode(), (target_ip, target_port))
  879.     d223.config(color='#FF0000')
  880.     data[87]=1
  881. def button_click224():
  882.   global data
  883.   if data[88]:
  884.     s.sendto("224".encode(), (target_ip, target_port))
  885.     d224.config(color='#000000')
  886.     data[88]=0
  887.   else:
  888.     s.sendto("224".encode(), (target_ip, target_port))
  889.     d224.config(color='#FF0000')
  890.     data[88]=1
  891. def button_click225():
  892.   global data
  893.   if data[89]:
  894.     s.sendto("225".encode(), (target_ip, target_port))
  895.     d225.config(color='#000000')
  896.     data[89]=0
  897.   else:
  898.     s.sendto("225".encode(), (target_ip, target_port))
  899.     d225.config(color='#FF0000')
  900.     data[89]=1
  901. def button_click226():
  902.   global data
  903.   if data[90]:
  904.     s.sendto("226".encode(), (target_ip, target_port))
  905.     d226.config(color='#000000')
  906.     data[90]=0
  907.   else:
  908.     s.sendto("226".encode(), (target_ip, target_port))
  909.     d226.config(color='#FF0000')
  910.     data[90]=1
  911. def button_click227():
  912.   global data
  913.   if data[91]:
  914.     s.sendto("227".encode(), (target_ip, target_port))
  915.     d227.config(color='#000000')
  916.     data[91]=0
  917.   else:
  918.     s.sendto("227".encode(), (target_ip, target_port))
  919.     d227.config(color='#FF0000')
  920.     data[91]=1
  921. def button_click228():
  922.   global data
  923.   if data[92]:
  924.     s.sendto("228".encode(), (target_ip, target_port))
  925.     d228.config(color='#000000')
  926.     data[92]=0
  927.   else:
  928.     s.sendto("228".encode(), (target_ip, target_port))
  929.     d228.config(color='#FF0000')
  930.     data[92]=1
  931. def button_click229():
  932.   global data
  933.   if data[93]:
  934.     s.sendto("229".encode(), (target_ip, target_port))
  935.     d229.config(color='#000000')
  936.     data[93]=0
  937.   else:
  938.     s.sendto("229".encode(), (target_ip, target_port))
  939.     d229.config(color='#FF0000')
  940.     data[93]=1
  941. def button_click230():
  942.   global data
  943.   if data[94]:
  944.     s.sendto("230".encode(), (target_ip, target_port))
  945.     d230.config(color='#000000')
  946.     data[94]=0
  947.   else:
  948.     s.sendto("230".encode(), (target_ip, target_port))
  949.     d230.config(color='#FF0000')
  950.     data[94]=1
  951. def button_click231():
  952.   global data
  953.   if data[95]:
  954.     s.sendto("231".encode(), (target_ip, target_port))
  955.     d231.config(color='#000000')
  956.     data[95]=0
  957.   else:
  958.     s.sendto("231".encode(), (target_ip, target_port))
  959.     d231.config(color='#FF0000')
  960.     data[95]=1
复制代码

2)生成“灯珠”程序
  1. import math
  2. fileObj = open("Mind1+.txt", "w", encoding="UTF8")
  3. for k in range(0,3):
  4. for i in range(0,32):
  5.     if i<10:
  6.       j="0"+str(i)
  7.     else:
  8.       j=str(i)
  9.     num1=math.floor((32*k+i)/12)
  10.     num2=(32*k+i)%12
  11.     fileObj.write("d"+str(k)+j+"=u_gui.fill_circle(x="+str(240-(13+26*num1))+",y="+str(13+26*num2)+",r=13,color="#000000")\r")   
  12.     fileObj.write("d"+str(k)+j+".config(onclick=button_click"+str(k)+j+")\r")
  13. fileObj.close()
复制代码

生成的“灯珠”程序代码
  1. d000=u_gui.fill_circle(x=227,y=13,r=13,color="#000000")
  2. d000.config(onclick=button_click000)
  3. d001=u_gui.fill_circle(x=227,y=39,r=13,color="#000000")
  4. d001.config(onclick=button_click001)
  5. d002=u_gui.fill_circle(x=227,y=65,r=13,color="#000000")
  6. d002.config(onclick=button_click002)
  7. d003=u_gui.fill_circle(x=227,y=91,r=13,color="#000000")
  8. d003.config(onclick=button_click003)
  9. d004=u_gui.fill_circle(x=227,y=117,r=13,color="#000000")
  10. d004.config(onclick=button_click004)
  11. d005=u_gui.fill_circle(x=227,y=143,r=13,color="#000000")
  12. d005.config(onclick=button_click005)
  13. d006=u_gui.fill_circle(x=227,y=169,r=13,color="#000000")
  14. d006.config(onclick=button_click006)
  15. d007=u_gui.fill_circle(x=227,y=195,r=13,color="#000000")
  16. d007.config(onclick=button_click007)
  17. d008=u_gui.fill_circle(x=227,y=221,r=13,color="#000000")
  18. d008.config(onclick=button_click008)
  19. d009=u_gui.fill_circle(x=227,y=247,r=13,color="#000000")
  20. d009.config(onclick=button_click009)
  21. d010=u_gui.fill_circle(x=227,y=273,r=13,color="#000000")
  22. d010.config(onclick=button_click010)
  23. d011=u_gui.fill_circle(x=227,y=299,r=13,color="#000000")
  24. d011.config(onclick=button_click011)
  25. d012=u_gui.fill_circle(x=201,y=13,r=13,color="#000000")
  26. d012.config(onclick=button_click012)
  27. d013=u_gui.fill_circle(x=201,y=39,r=13,color="#000000")
  28. d013.config(onclick=button_click013)
  29. d014=u_gui.fill_circle(x=201,y=65,r=13,color="#000000")
  30. d014.config(onclick=button_click014)
  31. d015=u_gui.fill_circle(x=201,y=91,r=13,color="#000000")
  32. d015.config(onclick=button_click015)
  33. d016=u_gui.fill_circle(x=201,y=117,r=13,color="#000000")
  34. d016.config(onclick=button_click016)
  35. d017=u_gui.fill_circle(x=201,y=143,r=13,color="#000000")
  36. d017.config(onclick=button_click017)
  37. d018=u_gui.fill_circle(x=201,y=169,r=13,color="#000000")
  38. d018.config(onclick=button_click018)
  39. d019=u_gui.fill_circle(x=201,y=195,r=13,color="#000000")
  40. d019.config(onclick=button_click019)
  41. d020=u_gui.fill_circle(x=201,y=221,r=13,color="#000000")
  42. d020.config(onclick=button_click020)
  43. d021=u_gui.fill_circle(x=201,y=247,r=13,color="#000000")
  44. d021.config(onclick=button_click021)
  45. d022=u_gui.fill_circle(x=201,y=273,r=13,color="#000000")
  46. d022.config(onclick=button_click022)
  47. d023=u_gui.fill_circle(x=201,y=299,r=13,color="#000000")
  48. d023.config(onclick=button_click023)
  49. d024=u_gui.fill_circle(x=175,y=13,r=13,color="#000000")
  50. d024.config(onclick=button_click024)
  51. d025=u_gui.fill_circle(x=175,y=39,r=13,color="#000000")
  52. d025.config(onclick=button_click025)
  53. d026=u_gui.fill_circle(x=175,y=65,r=13,color="#000000")
  54. d026.config(onclick=button_click026)
  55. d027=u_gui.fill_circle(x=175,y=91,r=13,color="#000000")
  56. d027.config(onclick=button_click027)
  57. d028=u_gui.fill_circle(x=175,y=117,r=13,color="#000000")
  58. d028.config(onclick=button_click028)
  59. d029=u_gui.fill_circle(x=175,y=143,r=13,color="#000000")
  60. d029.config(onclick=button_click029)
  61. d030=u_gui.fill_circle(x=175,y=169,r=13,color="#000000")
  62. d030.config(onclick=button_click030)
  63. d031=u_gui.fill_circle(x=175,y=195,r=13,color="#000000")
  64. d031.config(onclick=button_click031)
  65. d100=u_gui.fill_circle(x=175,y=221,r=13,color="#000000")
  66. d100.config(onclick=button_click100)
  67. d101=u_gui.fill_circle(x=175,y=247,r=13,color="#000000")
  68. d101.config(onclick=button_click101)
  69. d102=u_gui.fill_circle(x=175,y=273,r=13,color="#000000")
  70. d102.config(onclick=button_click102)
  71. d103=u_gui.fill_circle(x=175,y=299,r=13,color="#000000")
  72. d103.config(onclick=button_click103)
  73. d104=u_gui.fill_circle(x=149,y=13,r=13,color="#000000")
  74. d104.config(onclick=button_click104)
  75. d105=u_gui.fill_circle(x=149,y=39,r=13,color="#000000")
  76. d105.config(onclick=button_click105)
  77. d106=u_gui.fill_circle(x=149,y=65,r=13,color="#000000")
  78. d106.config(onclick=button_click106)
  79. d107=u_gui.fill_circle(x=149,y=91,r=13,color="#000000")
  80. d107.config(onclick=button_click107)
  81. d108=u_gui.fill_circle(x=149,y=117,r=13,color="#000000")
  82. d108.config(onclick=button_click108)
  83. d109=u_gui.fill_circle(x=149,y=143,r=13,color="#000000")
  84. d109.config(onclick=button_click109)
  85. d110=u_gui.fill_circle(x=149,y=169,r=13,color="#000000")
  86. d110.config(onclick=button_click110)
  87. d111=u_gui.fill_circle(x=149,y=195,r=13,color="#000000")
  88. d111.config(onclick=button_click111)
  89. d112=u_gui.fill_circle(x=149,y=221,r=13,color="#000000")
  90. d112.config(onclick=button_click112)
  91. d113=u_gui.fill_circle(x=149,y=247,r=13,color="#000000")
  92. d113.config(onclick=button_click113)
  93. d114=u_gui.fill_circle(x=149,y=273,r=13,color="#000000")
  94. d114.config(onclick=button_click114)
  95. d115=u_gui.fill_circle(x=149,y=299,r=13,color="#000000")
  96. d115.config(onclick=button_click115)
  97. d116=u_gui.fill_circle(x=123,y=13,r=13,color="#000000")
  98. d116.config(onclick=button_click116)
  99. d117=u_gui.fill_circle(x=123,y=39,r=13,color="#000000")
  100. d117.config(onclick=button_click117)
  101. d118=u_gui.fill_circle(x=123,y=65,r=13,color="#000000")
  102. d118.config(onclick=button_click118)
  103. d119=u_gui.fill_circle(x=123,y=91,r=13,color="#000000")
  104. d119.config(onclick=button_click119)
  105. d120=u_gui.fill_circle(x=123,y=117,r=13,color="#000000")
  106. d120.config(onclick=button_click120)
  107. d121=u_gui.fill_circle(x=123,y=143,r=13,color="#000000")
  108. d121.config(onclick=button_click121)
  109. d122=u_gui.fill_circle(x=123,y=169,r=13,color="#000000")
  110. d122.config(onclick=button_click122)
  111. d123=u_gui.fill_circle(x=123,y=195,r=13,color="#000000")
  112. d123.config(onclick=button_click123)
  113. d124=u_gui.fill_circle(x=123,y=221,r=13,color="#000000")
  114. d124.config(onclick=button_click124)
  115. d125=u_gui.fill_circle(x=123,y=247,r=13,color="#000000")
  116. d125.config(onclick=button_click125)
  117. d126=u_gui.fill_circle(x=123,y=273,r=13,color="#000000")
  118. d126.config(onclick=button_click126)
  119. d127=u_gui.fill_circle(x=123,y=299,r=13,color="#000000")
  120. d127.config(onclick=button_click127)
  121. d128=u_gui.fill_circle(x=97,y=13,r=13,color="#000000")
  122. d128.config(onclick=button_click128)
  123. d129=u_gui.fill_circle(x=97,y=39,r=13,color="#000000")
  124. d129.config(onclick=button_click129)
  125. d130=u_gui.fill_circle(x=97,y=65,r=13,color="#000000")
  126. d130.config(onclick=button_click130)
  127. d131=u_gui.fill_circle(x=97,y=91,r=13,color="#000000")
  128. d131.config(onclick=button_click131)
  129. d200=u_gui.fill_circle(x=97,y=117,r=13,color="#000000")
  130. d200.config(onclick=button_click200)
  131. d201=u_gui.fill_circle(x=97,y=143,r=13,color="#000000")
  132. d201.config(onclick=button_click201)
  133. d202=u_gui.fill_circle(x=97,y=169,r=13,color="#000000")
  134. d202.config(onclick=button_click202)
  135. d203=u_gui.fill_circle(x=97,y=195,r=13,color="#000000")
  136. d203.config(onclick=button_click203)
  137. d204=u_gui.fill_circle(x=97,y=221,r=13,color="#000000")
  138. d204.config(onclick=button_click204)
  139. d205=u_gui.fill_circle(x=97,y=247,r=13,color="#000000")
  140. d205.config(onclick=button_click205)
  141. d206=u_gui.fill_circle(x=97,y=273,r=13,color="#000000")
  142. d206.config(onclick=button_click206)
  143. d207=u_gui.fill_circle(x=97,y=299,r=13,color="#000000")
  144. d207.config(onclick=button_click207)
  145. d208=u_gui.fill_circle(x=71,y=13,r=13,color="#000000")
  146. d208.config(onclick=button_click208)
  147. d209=u_gui.fill_circle(x=71,y=39,r=13,color="#000000")
  148. d209.config(onclick=button_click209)
  149. d210=u_gui.fill_circle(x=71,y=65,r=13,color="#000000")
  150. d210.config(onclick=button_click210)
  151. d211=u_gui.fill_circle(x=71,y=91,r=13,color="#000000")
  152. d211.config(onclick=button_click211)
  153. d212=u_gui.fill_circle(x=71,y=117,r=13,color="#000000")
  154. d212.config(onclick=button_click212)
  155. d213=u_gui.fill_circle(x=71,y=143,r=13,color="#000000")
  156. d213.config(onclick=button_click213)
  157. d214=u_gui.fill_circle(x=71,y=169,r=13,color="#000000")
  158. d214.config(onclick=button_click214)
  159. d215=u_gui.fill_circle(x=71,y=195,r=13,color="#000000")
  160. d215.config(onclick=button_click215)
  161. d216=u_gui.fill_circle(x=71,y=221,r=13,color="#000000")
  162. d216.config(onclick=button_click216)
  163. d217=u_gui.fill_circle(x=71,y=247,r=13,color="#000000")
  164. d217.config(onclick=button_click217)
  165. d218=u_gui.fill_circle(x=71,y=273,r=13,color="#000000")
  166. d218.config(onclick=button_click218)
  167. d219=u_gui.fill_circle(x=71,y=299,r=13,color="#000000")
  168. d219.config(onclick=button_click219)
  169. d220=u_gui.fill_circle(x=45,y=13,r=13,color="#000000")
  170. d220.config(onclick=button_click220)
  171. d221=u_gui.fill_circle(x=45,y=39,r=13,color="#000000")
  172. d221.config(onclick=button_click221)
  173. d222=u_gui.fill_circle(x=45,y=65,r=13,color="#000000")
  174. d222.config(onclick=button_click222)
  175. d223=u_gui.fill_circle(x=45,y=91,r=13,color="#000000")
  176. d223.config(onclick=button_click223)
  177. d224=u_gui.fill_circle(x=45,y=117,r=13,color="#000000")
  178. d224.config(onclick=button_click224)
  179. d225=u_gui.fill_circle(x=45,y=143,r=13,color="#000000")
  180. d225.config(onclick=button_click225)
  181. d226=u_gui.fill_circle(x=45,y=169,r=13,color="#000000")
  182. d226.config(onclick=button_click226)
  183. d227=u_gui.fill_circle(x=45,y=195,r=13,color="#000000")
  184. d227.config(onclick=button_click227)
  185. d228=u_gui.fill_circle(x=45,y=221,r=13,color="#000000")
  186. d228.config(onclick=button_click228)
  187. d229=u_gui.fill_circle(x=45,y=247,r=13,color="#000000")
  188. d229.config(onclick=button_click229)
  189. d230=u_gui.fill_circle(x=45,y=273,r=13,color="#000000")
  190. d230.config(onclick=button_click230)
  191. d231=u_gui.fill_circle(x=45,y=299,r=13,color="#000000")
  192. d231.config(onclick=button_click231)
复制代码

三、完整程序

  1. from unihiker import GUI
  2. import socket
  3. # 创建UDP socket
  4. s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  5. # 绑定要发送的IP地址和端口号
  6. target_ip = '192.168.31.210'
  7. target_port = 2390
  8. data=[]
  9. for i in range(0,96):
  10.     data.append(0)
  11. # 事件回调函数
  12. def button_click000():
  13.   global data
  14.   if data[0]:
  15.     s.sendto("000".encode(), (target_ip, target_port))
  16.     d000.config(color='#000000')
  17.     data[0]=0
  18.   else:
  19.     s.sendto("000".encode(), (target_ip, target_port))
  20.     d000.config(color='#FF0000')
  21.     data[0]=1
  22. def button_click001():
  23.   global data
  24.   if data[1]:
  25.     s.sendto("001".encode(), (target_ip, target_port))
  26.     d001.config(color='#000000')
  27.     data[1]=0
  28.   else:
  29.     s.sendto("001".encode(), (target_ip, target_port))
  30.     d001.config(color='#FF0000')
  31.     data[1]=1
  32. def button_click002():
  33.   global data
  34.   if data[2]:
  35.     s.sendto("002".encode(), (target_ip, target_port))
  36.     d002.config(color='#000000')
  37.     data[2]=0
  38.   else:
  39.     s.sendto("002".encode(), (target_ip, target_port))
  40.     d002.config(color='#FF0000')
  41.     data[2]=1
  42. def button_click003():
  43.   global data
  44.   if data[3]:
  45.     s.sendto("003".encode(), (target_ip, target_port))
  46.     d003.config(color='#000000')
  47.     data[3]=0
  48.   else:
  49.     s.sendto("003".encode(), (target_ip, target_port))
  50.     d003.config(color='#FF0000')
  51.     data[3]=1
  52. def button_click004():
  53.   global data
  54.   if data[4]:
  55.     s.sendto("004".encode(), (target_ip, target_port))
  56.     d004.config(color='#000000')
  57.     data[4]=0
  58.   else:
  59.     s.sendto("004".encode(), (target_ip, target_port))
  60.     d004.config(color='#FF0000')
  61.     data[4]=1
  62. def button_click005():
  63.   global data
  64.   if data[5]:
  65.     s.sendto("005".encode(), (target_ip, target_port))
  66.     d005.config(color='#000000')
  67.     data[5]=0
  68.   else:
  69.     s.sendto("005".encode(), (target_ip, target_port))
  70.     d005.config(color='#FF0000')
  71.     data[5]=1
  72. def button_click006():
  73.   global data
  74.   if data[6]:
  75.     s.sendto("006".encode(), (target_ip, target_port))
  76.     d006.config(color='#000000')
  77.     data[6]=0
  78.   else:
  79.     s.sendto("006".encode(), (target_ip, target_port))
  80.     d006.config(color='#FF0000')
  81.     data[6]=1
  82. def button_click007():
  83.   global data
  84.   if data[7]:
  85.     s.sendto("007".encode(), (target_ip, target_port))
  86.     d007.config(color='#000000')
  87.     data[7]=0
  88.   else:
  89.     s.sendto("007".encode(), (target_ip, target_port))
  90.     d007.config(color='#FF0000')
  91.     data[7]=1
  92. def button_click008():
  93.   global data
  94.   if data[8]:
  95.     s.sendto("008".encode(), (target_ip, target_port))
  96.     d008.config(color='#000000')
  97.     data[8]=0
  98.   else:
  99.     s.sendto("008".encode(), (target_ip, target_port))
  100.     d008.config(color='#FF0000')
  101.     data[8]=1
  102. def button_click009():
  103.   global data
  104.   if data[9]:
  105.     s.sendto("009".encode(), (target_ip, target_port))
  106.     d009.config(color='#000000')
  107.     data[9]=0
  108.   else:
  109.     s.sendto("009".encode(), (target_ip, target_port))
  110.     d009.config(color='#FF0000')
  111.     data[9]=1
  112. def button_click010():
  113.   global data
  114.   if data[10]:
  115.     s.sendto("010".encode(), (target_ip, target_port))
  116.     d010.config(color='#000000')
  117.     data[10]=0
  118.   else:
  119.     s.sendto("010".encode(), (target_ip, target_port))
  120.     d010.config(color='#FF0000')
  121.     data[10]=1
  122. def button_click011():
  123.   global data
  124.   if data[11]:
  125.     s.sendto("011".encode(), (target_ip, target_port))
  126.     d011.config(color='#000000')
  127.     data[11]=0
  128.   else:
  129.     s.sendto("011".encode(), (target_ip, target_port))
  130.     d011.config(color='#FF0000')
  131.     data[11]=1
  132. def button_click012():
  133.   global data
  134.   if data[12]:
  135.     s.sendto("012".encode(), (target_ip, target_port))
  136.     d012.config(color='#000000')
  137.     data[12]=0
  138.   else:
  139.     s.sendto("012".encode(), (target_ip, target_port))
  140.     d012.config(color='#FF0000')
  141.     data[12]=1
  142. def button_click013():
  143.   global data
  144.   if data[13]:
  145.     s.sendto("013".encode(), (target_ip, target_port))
  146.     d013.config(color='#000000')
  147.     data[13]=0
  148.   else:
  149.     s.sendto("013".encode(), (target_ip, target_port))
  150.     d013.config(color='#FF0000')
  151.     data[13]=1
  152. def button_click014():
  153.   global data
  154.   if data[14]:
  155.     s.sendto("014".encode(), (target_ip, target_port))
  156.     d014.config(color='#000000')
  157.     data[14]=0
  158.   else:
  159.     s.sendto("014".encode(), (target_ip, target_port))
  160.     d014.config(color='#FF0000')
  161.     data[14]=1
  162. def button_click015():
  163.   global data
  164.   if data[15]:
  165.     s.sendto("015".encode(), (target_ip, target_port))
  166.     d015.config(color='#000000')
  167.     data[15]=0
  168.   else:
  169.     s.sendto("015".encode(), (target_ip, target_port))
  170.     d015.config(color='#FF0000')
  171.     data[15]=1
  172. def button_click016():
  173.   global data
  174.   if data[16]:
  175.     s.sendto("016".encode(), (target_ip, target_port))
  176.     d016.config(color='#000000')
  177.     data[16]=0
  178.   else:
  179.     s.sendto("016".encode(), (target_ip, target_port))
  180.     d016.config(color='#FF0000')
  181.     data[16]=1
  182. def button_click017():
  183.   global data
  184.   if data[17]:
  185.     s.sendto("017".encode(), (target_ip, target_port))
  186.     d017.config(color='#000000')
  187.     data[17]=0
  188.   else:
  189.     s.sendto("017".encode(), (target_ip, target_port))
  190.     d017.config(color='#FF0000')
  191.     data[17]=1
  192. def button_click018():
  193.   global data
  194.   if data[18]:
  195.     s.sendto("018".encode(), (target_ip, target_port))
  196.     d018.config(color='#000000')
  197.     data[18]=0
  198.   else:
  199.     s.sendto("018".encode(), (target_ip, target_port))
  200.     d018.config(color='#FF0000')
  201.     data[18]=1
  202. def button_click019():
  203.   global data
  204.   if data[19]:
  205.     s.sendto("019".encode(), (target_ip, target_port))
  206.     d019.config(color='#000000')
  207.     data[19]=0
  208.   else:
  209.     s.sendto("019".encode(), (target_ip, target_port))
  210.     d019.config(color='#FF0000')
  211.     data[19]=1
  212. def button_click020():
  213.   global data
  214.   if data[20]:
  215.     s.sendto("020".encode(), (target_ip, target_port))
  216.     d020.config(color='#000000')
  217.     data[20]=0
  218.   else:
  219.     s.sendto("020".encode(), (target_ip, target_port))
  220.     d020.config(color='#FF0000')
  221.     data[20]=1
  222. def button_click021():
  223.   global data
  224.   if data[21]:
  225.     s.sendto("021".encode(), (target_ip, target_port))
  226.     d021.config(color='#000000')
  227.     data[21]=0
  228.   else:
  229.     s.sendto("021".encode(), (target_ip, target_port))
  230.     d021.config(color='#FF0000')
  231.     data[21]=1
  232. def button_click022():
  233.   global data
  234.   if data[22]:
  235.     s.sendto("022".encode(), (target_ip, target_port))
  236.     d022.config(color='#000000')
  237.     data[22]=0
  238.   else:
  239.     s.sendto("022".encode(), (target_ip, target_port))
  240.     d022.config(color='#FF0000')
  241.     data[22]=1
  242. def button_click023():
  243.   global data
  244.   if data[23]:
  245.     s.sendto("023".encode(), (target_ip, target_port))
  246.     d023.config(color='#000000')
  247.     data[23]=0
  248.   else:
  249.     s.sendto("023".encode(), (target_ip, target_port))
  250.     d023.config(color='#FF0000')
  251.     data[23]=1
  252. def button_click024():
  253.   global data
  254.   if data[24]:
  255.     s.sendto("024".encode(), (target_ip, target_port))
  256.     d024.config(color='#000000')
  257.     data[24]=0
  258.   else:
  259.     s.sendto("024".encode(), (target_ip, target_port))
  260.     d024.config(color='#FF0000')
  261.     data[24]=1
  262. def button_click025():
  263.   global data
  264.   if data[25]:
  265.     s.sendto("025".encode(), (target_ip, target_port))
  266.     d025.config(color='#000000')
  267.     data[25]=0
  268.   else:
  269.     s.sendto("025".encode(), (target_ip, target_port))
  270.     d025.config(color='#FF0000')
  271.     data[25]=1
  272. def button_click026():
  273.   global data
  274.   if data[26]:
  275.     s.sendto("026".encode(), (target_ip, target_port))
  276.     d026.config(color='#000000')
  277.     data[26]=0
  278.   else:
  279.     s.sendto("026".encode(), (target_ip, target_port))
  280.     d026.config(color='#FF0000')
  281.     data[26]=1
  282. def button_click027():
  283.   global data
  284.   if data[27]:
  285.     s.sendto("027".encode(), (target_ip, target_port))
  286.     d027.config(color='#000000')
  287.     data[27]=0
  288.   else:
  289.     s.sendto("027".encode(), (target_ip, target_port))
  290.     d027.config(color='#FF0000')
  291.     data[27]=1
  292. def button_click028():
  293.   global data
  294.   if data[28]:
  295.     s.sendto("028".encode(), (target_ip, target_port))
  296.     d028.config(color='#000000')
  297.     data[28]=0
  298.   else:
  299.     s.sendto("028".encode(), (target_ip, target_port))
  300.     d028.config(color='#FF0000')
  301.     data[28]=1
  302. def button_click029():
  303.   global data
  304.   if data[29]:
  305.     s.sendto("029".encode(), (target_ip, target_port))
  306.     d029.config(color='#000000')
  307.     data[29]=0
  308.   else:
  309.     s.sendto("029".encode(), (target_ip, target_port))
  310.     d029.config(color='#FF0000')
  311.     data[29]=1
  312. def button_click030():
  313.   global data
  314.   if data[30]:
  315.     s.sendto("030".encode(), (target_ip, target_port))
  316.     d030.config(color='#000000')
  317.     data[30]=0
  318.   else:
  319.     s.sendto("030".encode(), (target_ip, target_port))
  320.     d030.config(color='#FF0000')
  321.     data[30]=1
  322. def button_click031():
  323.   global data
  324.   if data[31]:
  325.     s.sendto("031".encode(), (target_ip, target_port))
  326.     d031.config(color='#000000')
  327.     data[31]=0
  328.   else:
  329.     s.sendto("031".encode(), (target_ip, target_port))
  330.     d031.config(color='#FF0000')
  331.     data[31]=1
  332. def button_click100():
  333.   global data
  334.   if data[32]:
  335.     s.sendto("100".encode(), (target_ip, target_port))
  336.     d100.config(color='#000000')
  337.     data[32]=0
  338.   else:
  339.     s.sendto("100".encode(), (target_ip, target_port))
  340.     d100.config(color='#FF0000')
  341.     data[32]=1
  342. def button_click101():
  343.   global data
  344.   if data[33]:
  345.     s.sendto("101".encode(), (target_ip, target_port))
  346.     d101.config(color='#000000')
  347.     data[33]=0
  348.   else:
  349.     s.sendto("101".encode(), (target_ip, target_port))
  350.     d101.config(color='#FF0000')
  351.     data[33]=1
  352. def button_click102():
  353.   global data
  354.   if data[34]:
  355.     s.sendto("102".encode(), (target_ip, target_port))
  356.     d102.config(color='#000000')
  357.     data[34]=0
  358.   else:
  359.     s.sendto("102".encode(), (target_ip, target_port))
  360.     d102.config(color='#FF0000')
  361.     data[34]=1
  362. def button_click103():
  363.   global data
  364.   if data[35]:
  365.     s.sendto("103".encode(), (target_ip, target_port))
  366.     d103.config(color='#000000')
  367.     data[35]=0
  368.   else:
  369.     s.sendto("103".encode(), (target_ip, target_port))
  370.     d103.config(color='#FF0000')
  371.     data[35]=1
  372. def button_click104():
  373.   global data
  374.   if data[36]:
  375.     s.sendto("104".encode(), (target_ip, target_port))
  376.     d104.config(color='#000000')
  377.     data[36]=0
  378.   else:
  379.     s.sendto("104".encode(), (target_ip, target_port))
  380.     d104.config(color='#FF0000')
  381.     data[36]=1
  382. def button_click105():
  383.   global data
  384.   if data[37]:
  385.     s.sendto("105".encode(), (target_ip, target_port))
  386.     d105.config(color='#000000')
  387.     data[37]=0
  388.   else:
  389.     s.sendto("105".encode(), (target_ip, target_port))
  390.     d105.config(color='#FF0000')
  391.     data[37]=1
  392. def button_click106():
  393.   global data
  394.   if data[38]:
  395.     s.sendto("106".encode(), (target_ip, target_port))
  396.     d106.config(color='#000000')
  397.     data[38]=0
  398.   else:
  399.     s.sendto("106".encode(), (target_ip, target_port))
  400.     d106.config(color='#FF0000')
  401.     data[38]=1
  402. def button_click107():
  403.   global data
  404.   if data[39]:
  405.     s.sendto("107".encode(), (target_ip, target_port))
  406.     d107.config(color='#000000')
  407.     data[39]=0
  408.   else:
  409.     s.sendto("107".encode(), (target_ip, target_port))
  410.     d107.config(color='#FF0000')
  411.     data[39]=1
  412. def button_click108():
  413.   global data
  414.   if data[40]:
  415.     s.sendto("108".encode(), (target_ip, target_port))
  416.     d108.config(color='#000000')
  417.     data[40]=0
  418.   else:
  419.     s.sendto("108".encode(), (target_ip, target_port))
  420.     d108.config(color='#FF0000')
  421.     data[40]=1
  422. def button_click109():
  423.   global data
  424.   if data[41]:
  425.     s.sendto("109".encode(), (target_ip, target_port))
  426.     d109.config(color='#000000')
  427.     data[41]=0
  428.   else:
  429.     s.sendto("109".encode(), (target_ip, target_port))
  430.     d109.config(color='#FF0000')
  431.     data[41]=1
  432. def button_click110():
  433.   global data
  434.   if data[42]:
  435.     s.sendto("110".encode(), (target_ip, target_port))
  436.     d110.config(color='#000000')
  437.     data[42]=0
  438.   else:
  439.     s.sendto("110".encode(), (target_ip, target_port))
  440.     d110.config(color='#FF0000')
  441.     data[42]=1
  442. def button_click111():
  443.   global data
  444.   if data[43]:
  445.     s.sendto("111".encode(), (target_ip, target_port))
  446.     d111.config(color='#000000')
  447.     data[43]=0
  448.   else:
  449.     s.sendto("111".encode(), (target_ip, target_port))
  450.     d111.config(color='#FF0000')
  451.     data[43]=1
  452. def button_click112():
  453.   global data
  454.   if data[44]:
  455.     s.sendto("112".encode(), (target_ip, target_port))
  456.     d112.config(color='#000000')
  457.     data[44]=0
  458.   else:
  459.     s.sendto("112".encode(), (target_ip, target_port))
  460.     d112.config(color='#FF0000')
  461.     data[44]=1
  462. def button_click113():
  463.   global data
  464.   if data[45]:
  465.     s.sendto("113".encode(), (target_ip, target_port))
  466.     d113.config(color='#000000')
  467.     data[45]=0
  468.   else:
  469.     s.sendto("113".encode(), (target_ip, target_port))
  470.     d113.config(color='#FF0000')
  471.     data[45]=1
  472. def button_click114():
  473.   global data
  474.   if data[46]:
  475.     s.sendto("114".encode(), (target_ip, target_port))
  476.     d114.config(color='#000000')
  477.     data[46]=0
  478.   else:
  479.     s.sendto("114".encode(), (target_ip, target_port))
  480.     d114.config(color='#FF0000')
  481.     data[46]=1
  482. def button_click115():
  483.   global data
  484.   if data[47]:
  485.     s.sendto("115".encode(), (target_ip, target_port))
  486.     d115.config(color='#000000')
  487.     data[47]=0
  488.   else:
  489.     s.sendto("115".encode(), (target_ip, target_port))
  490.     d115.config(color='#FF0000')
  491.     data[47]=1
  492. def button_click116():
  493.   global data
  494.   if data[48]:
  495.     s.sendto("116".encode(), (target_ip, target_port))
  496.     d116.config(color='#000000')
  497.     data[48]=0
  498.   else:
  499.     s.sendto("116".encode(), (target_ip, target_port))
  500.     d116.config(color='#FF0000')
  501.     data[48]=1
  502. def button_click117():
  503.   global data
  504.   if data[49]:
  505.     s.sendto("117".encode(), (target_ip, target_port))
  506.     d117.config(color='#000000')
  507.     data[49]=0
  508.   else:
  509.     s.sendto("117".encode(), (target_ip, target_port))
  510.     d117.config(color='#FF0000')
  511.     data[49]=1
  512. def button_click118():
  513.   global data
  514.   if data[50]:
  515.     s.sendto("118".encode(), (target_ip, target_port))
  516.     d118.config(color='#000000')
  517.     data[50]=0
  518.   else:
  519.     s.sendto("118".encode(), (target_ip, target_port))
  520.     d118.config(color='#FF0000')
  521.     data[50]=1
  522. def button_click119():
  523.   global data
  524.   if data[51]:
  525.     s.sendto("119".encode(), (target_ip, target_port))
  526.     d119.config(color='#000000')
  527.     data[51]=0
  528.   else:
  529.     s.sendto("119".encode(), (target_ip, target_port))
  530.     d119.config(color='#FF0000')
  531.     data[51]=1
  532. def button_click120():
  533.   global data
  534.   if data[52]:
  535.     s.sendto("120".encode(), (target_ip, target_port))
  536.     d120.config(color='#000000')
  537.     data[52]=0
  538.   else:
  539.     s.sendto("120".encode(), (target_ip, target_port))
  540.     d120.config(color='#FF0000')
  541.     data[52]=1
  542. def button_click121():
  543.   global data
  544.   if data[53]:
  545.     s.sendto("121".encode(), (target_ip, target_port))
  546.     d121.config(color='#000000')
  547.     data[53]=0
  548.   else:
  549.     s.sendto("121".encode(), (target_ip, target_port))
  550.     d121.config(color='#FF0000')
  551.     data[53]=1
  552. def button_click122():
  553.   global data
  554.   if data[54]:
  555.     s.sendto("122".encode(), (target_ip, target_port))
  556.     d122.config(color='#000000')
  557.     data[54]=0
  558.   else:
  559.     s.sendto("122".encode(), (target_ip, target_port))
  560.     d122.config(color='#FF0000')
  561.     data[54]=1
  562. def button_click123():
  563.   global data
  564.   if data[55]:
  565.     s.sendto("123".encode(), (target_ip, target_port))
  566.     d123.config(color='#000000')
  567.     data[55]=0
  568.   else:
  569.     s.sendto("123".encode(), (target_ip, target_port))
  570.     d123.config(color='#FF0000')
  571.     data[55]=1
  572. def button_click124():
  573.   global data
  574.   if data[56]:
  575.     s.sendto("124".encode(), (target_ip, target_port))
  576.     d124.config(color='#000000')
  577.     data[56]=0
  578.   else:
  579.     s.sendto("124".encode(), (target_ip, target_port))
  580.     d124.config(color='#FF0000')
  581.     data[56]=1
  582. def button_click125():
  583.   global data
  584.   if data[57]:
  585.     s.sendto("125".encode(), (target_ip, target_port))
  586.     d125.config(color='#000000')
  587.     data[57]=0
  588.   else:
  589.     s.sendto("125".encode(), (target_ip, target_port))
  590.     d125.config(color='#FF0000')
  591.     data[57]=1
  592. def button_click126():
  593.   global data
  594.   if data[58]:
  595.     s.sendto("126".encode(), (target_ip, target_port))
  596.     d126.config(color='#000000')
  597.     data[58]=0
  598.   else:
  599.     s.sendto("126".encode(), (target_ip, target_port))
  600.     d126.config(color='#FF0000')
  601.     data[58]=1
  602. def button_click127():
  603.   global data
  604.   if data[59]:
  605.     s.sendto("127".encode(), (target_ip, target_port))
  606.     d127.config(color='#000000')
  607.     data[59]=0
  608.   else:
  609.     s.sendto("127".encode(), (target_ip, target_port))
  610.     d127.config(color='#FF0000')
  611.     data[59]=1
  612. def button_click128():
  613.   global data
  614.   if data[60]:
  615.     s.sendto("128".encode(), (target_ip, target_port))
  616.     d128.config(color='#000000')
  617.     data[60]=0
  618.   else:
  619.     s.sendto("128".encode(), (target_ip, target_port))
  620.     d128.config(color='#FF0000')
  621.     data[60]=1
  622. def button_click129():
  623.   global data
  624.   if data[61]:
  625.     s.sendto("129".encode(), (target_ip, target_port))
  626.     d129.config(color='#000000')
  627.     data[61]=0
  628.   else:
  629.     s.sendto("129".encode(), (target_ip, target_port))
  630.     d129.config(color='#FF0000')
  631.     data[61]=1
  632. def button_click130():
  633.   global data
  634.   if data[62]:
  635.     s.sendto("130".encode(), (target_ip, target_port))
  636.     d130.config(color='#000000')
  637.     data[62]=0
  638.   else:
  639.     s.sendto("130".encode(), (target_ip, target_port))
  640.     d130.config(color='#FF0000')
  641.     data[62]=1
  642. def button_click131():
  643.   global data
  644.   if data[63]:
  645.     s.sendto("131".encode(), (target_ip, target_port))
  646.     d131.config(color='#000000')
  647.     data[63]=0
  648.   else:
  649.     s.sendto("131".encode(), (target_ip, target_port))
  650.     d131.config(color='#FF0000')
  651.     data[63]=1
  652. def button_click200():
  653.   global data
  654.   if data[64]:
  655.     s.sendto("200".encode(), (target_ip, target_port))
  656.     d200.config(color='#000000')
  657.     data[64]=0
  658.   else:
  659.     s.sendto("200".encode(), (target_ip, target_port))
  660.     d200.config(color='#FF0000')
  661.     data[64]=1
  662. def button_click201():
  663.   global data
  664.   if data[65]:
  665.     s.sendto("201".encode(), (target_ip, target_port))
  666.     d201.config(color='#000000')
  667.     data[65]=0
  668.   else:
  669.     s.sendto("201".encode(), (target_ip, target_port))
  670.     d201.config(color='#FF0000')
  671.     data[65]=1
  672. def button_click202():
  673.   global data
  674.   if data[66]:
  675.     s.sendto("202".encode(), (target_ip, target_port))
  676.     d202.config(color='#000000')
  677.     data[66]=0
  678.   else:
  679.     s.sendto("202".encode(), (target_ip, target_port))
  680.     d202.config(color='#FF0000')
  681.     data[66]=1
  682. def button_click203():
  683.   global data
  684.   if data[67]:
  685.     s.sendto("203".encode(), (target_ip, target_port))
  686.     d203.config(color='#000000')
  687.     data[67]=0
  688.   else:
  689.     s.sendto("203".encode(), (target_ip, target_port))
  690.     d203.config(color='#FF0000')
  691.     data[67]=1
  692. def button_click204():
  693.   global data
  694.   if data[68]:
  695.     s.sendto("204".encode(), (target_ip, target_port))
  696.     d204.config(color='#000000')
  697.     data[68]=0
  698.   else:
  699.     s.sendto("204".encode(), (target_ip, target_port))
  700.     d204.config(color='#FF0000')
  701.     data[68]=1
  702. def button_click205():
  703.   global data
  704.   if data[69]:
  705.     s.sendto("205".encode(), (target_ip, target_port))
  706.     d205.config(color='#000000')
  707.     data[69]=0
  708.   else:
  709.     s.sendto("205".encode(), (target_ip, target_port))
  710.     d205.config(color='#FF0000')
  711.     data[69]=1
  712. def button_click206():
  713.   global data
  714.   if data[70]:
  715.     s.sendto("206".encode(), (target_ip, target_port))
  716.     d206.config(color='#000000')
  717.     data[70]=0
  718.   else:
  719.     s.sendto("206".encode(), (target_ip, target_port))
  720.     d206.config(color='#FF0000')
  721.     data[70]=1
  722. def button_click207():
  723.   global data
  724.   if data[71]:
  725.     s.sendto("207".encode(), (target_ip, target_port))
  726.     d207.config(color='#000000')
  727.     data[71]=0
  728.   else:
  729.     s.sendto("207".encode(), (target_ip, target_port))
  730.     d207.config(color='#FF0000')
  731.     data[71]=1
  732. def button_click208():
  733.   global data
  734.   if data[72]:
  735.     s.sendto("208".encode(), (target_ip, target_port))
  736.     d208.config(color='#000000')
  737.     data[72]=0
  738.   else:
  739.     s.sendto("208".encode(), (target_ip, target_port))
  740.     d208.config(color='#FF0000')
  741.     data[72]=1
  742. def button_click209():
  743.   global data
  744.   if data[73]:
  745.     s.sendto("209".encode(), (target_ip, target_port))
  746.     d209.config(color='#000000')
  747.     data[73]=0
  748.   else:
  749.     s.sendto("209".encode(), (target_ip, target_port))
  750.     d209.config(color='#FF0000')
  751.     data[73]=1
  752. def button_click210():
  753.   global data
  754.   if data[74]:
  755.     s.sendto("210".encode(), (target_ip, target_port))
  756.     d210.config(color='#000000')
  757.     data[74]=0
  758.   else:
  759.     s.sendto("210".encode(), (target_ip, target_port))
  760.     d210.config(color='#FF0000')
  761.     data[74]=1
  762. def button_click211():
  763.   global data
  764.   if data[75]:
  765.     s.sendto("211".encode(), (target_ip, target_port))
  766.     d211.config(color='#000000')
  767.     data[75]=0
  768.   else:
  769.     s.sendto("211".encode(), (target_ip, target_port))
  770.     d211.config(color='#FF0000')
  771.     data[75]=1
  772. def button_click212():
  773.   global data
  774.   if data[76]:
  775.     s.sendto("212".encode(), (target_ip, target_port))
  776.     d212.config(color='#000000')
  777.     data[76]=0
  778.   else:
  779.     s.sendto("212".encode(), (target_ip, target_port))
  780.     d212.config(color='#FF0000')
  781.     data[76]=1
  782. def button_click213():
  783.   global data
  784.   if data[77]:
  785.     s.sendto("213".encode(), (target_ip, target_port))
  786.     d213.config(color='#000000')
  787.     data[77]=0
  788.   else:
  789.     s.sendto("213".encode(), (target_ip, target_port))
  790.     d213.config(color='#FF0000')
  791.     data[77]=1
  792. def button_click214():
  793.   global data
  794.   if data[78]:
  795.     s.sendto("214".encode(), (target_ip, target_port))
  796.     d214.config(color='#000000')
  797.     data[78]=0
  798.   else:
  799.     s.sendto("214".encode(), (target_ip, target_port))
  800.     d214.config(color='#FF0000')
  801.     data[78]=1
  802. def button_click215():
  803.   global data
  804.   if data[79]:
  805.     s.sendto("215".encode(), (target_ip, target_port))
  806.     d215.config(color='#000000')
  807.     data[79]=0
  808.   else:
  809.     s.sendto("215".encode(), (target_ip, target_port))
  810.     d215.config(color='#FF0000')
  811.     data[79]=1
  812. def button_click216():
  813.   global data
  814.   if data[80]:
  815.     s.sendto("216".encode(), (target_ip, target_port))
  816.     d216.config(color='#000000')
  817.     data[80]=0
  818.   else:
  819.     s.sendto("216".encode(), (target_ip, target_port))
  820.     d216.config(color='#FF0000')
  821.     data[80]=1
  822. def button_click217():
  823.   global data
  824.   if data[81]:
  825.     s.sendto("217".encode(), (target_ip, target_port))
  826.     d217.config(color='#000000')
  827.     data[81]=0
  828.   else:
  829.     s.sendto("217".encode(), (target_ip, target_port))
  830.     d217.config(color='#FF0000')
  831.     data[81]=1
  832. def button_click218():
  833.   global data
  834.   if data[82]:
  835.     s.sendto("218".encode(), (target_ip, target_port))
  836.     d218.config(color='#000000')
  837.     data[82]=0
  838.   else:
  839.     s.sendto("218".encode(), (target_ip, target_port))
  840.     d218.config(color='#FF0000')
  841.     data[82]=1
  842. def button_click219():
  843.   global data
  844.   if data[83]:
  845.     s.sendto("219".encode(), (target_ip, target_port))
  846.     d219.config(color='#000000')
  847.     data[83]=0
  848.   else:
  849.     s.sendto("219".encode(), (target_ip, target_port))
  850.     d219.config(color='#FF0000')
  851.     data[83]=1
  852. def button_click220():
  853.   global data
  854.   if data[84]:
  855.     s.sendto("220".encode(), (target_ip, target_port))
  856.     d220.config(color='#000000')
  857.     data[84]=0
  858.   else:
  859.     s.sendto("220".encode(), (target_ip, target_port))
  860.     d220.config(color='#FF0000')
  861.     data[84]=1
  862. def button_click221():
  863.   global data
  864.   if data[85]:
  865.     s.sendto("221".encode(), (target_ip, target_port))
  866.     d221.config(color='#000000')
  867.     data[85]=0
  868.   else:
  869.     s.sendto("221".encode(), (target_ip, target_port))
  870.     d221.config(color='#FF0000')
  871.     data[85]=1
  872. def button_click222():
  873.   global data
  874.   if data[86]:
  875.     s.sendto("222".encode(), (target_ip, target_port))
  876.     d222.config(color='#000000')
  877.     data[86]=0
  878.   else:
  879.     s.sendto("222".encode(), (target_ip, target_port))
  880.     d222.config(color='#FF0000')
  881.     data[86]=1
  882. def button_click223():
  883.   global data
  884.   if data[87]:
  885.     s.sendto("223".encode(), (target_ip, target_port))
  886.     d223.config(color='#000000')
  887.     data[87]=0
  888.   else:
  889.     s.sendto("223".encode(), (target_ip, target_port))
  890.     d223.config(color='#FF0000')
  891.     data[87]=1
  892. def button_click224():
  893.   global data
  894.   if data[88]:
  895.     s.sendto("224".encode(), (target_ip, target_port))
  896.     d224.config(color='#000000')
  897.     data[88]=0
  898.   else:
  899.     s.sendto("224".encode(), (target_ip, target_port))
  900.     d224.config(color='#FF0000')
  901.     data[88]=1
  902. def button_click225():
  903.   global data
  904.   if data[89]:
  905.     s.sendto("225".encode(), (target_ip, target_port))
  906.     d225.config(color='#000000')
  907.     data[89]=0
  908.   else:
  909.     s.sendto("225".encode(), (target_ip, target_port))
  910.     d225.config(color='#FF0000')
  911.     data[89]=1
  912. def button_click226():
  913.   global data
  914.   if data[90]:
  915.     s.sendto("226".encode(), (target_ip, target_port))
  916.     d226.config(color='#000000')
  917.     data[90]=0
  918.   else:
  919.     s.sendto("226".encode(), (target_ip, target_port))
  920.     d226.config(color='#FF0000')
  921.     data[90]=1
  922. def button_click227():
  923.   global data
  924.   if data[91]:
  925.     s.sendto("227".encode(), (target_ip, target_port))
  926.     d227.config(color='#000000')
  927.     data[91]=0
  928.   else:
  929.     s.sendto("227".encode(), (target_ip, target_port))
  930.     d227.config(color='#FF0000')
  931.     data[91]=1
  932. def button_click228():
  933.   global data
  934.   if data[92]:
  935.     s.sendto("228".encode(), (target_ip, target_port))
  936.     d228.config(color='#000000')
  937.     data[92]=0
  938.   else:
  939.     s.sendto("228".encode(), (target_ip, target_port))
  940.     d228.config(color='#FF0000')
  941.     data[92]=1
  942. def button_click229():
  943.   global data
  944.   if data[93]:
  945.     s.sendto("229".encode(), (target_ip, target_port))
  946.     d229.config(color='#000000')
  947.     data[93]=0
  948.   else:
  949.     s.sendto("229".encode(), (target_ip, target_port))
  950.     d229.config(color='#FF0000')
  951.     data[93]=1
  952. def button_click230():
  953.   global data
  954.   if data[94]:
  955.     s.sendto("230".encode(), (target_ip, target_port))
  956.     d230.config(color='#000000')
  957.     data[94]=0
  958.   else:
  959.     s.sendto("230".encode(), (target_ip, target_port))
  960.     d230.config(color='#FF0000')
  961.     data[94]=1
  962. def button_click231():
  963.   global data
  964.   if data[95]:
  965.     s.sendto("231".encode(), (target_ip, target_port))
  966.     d231.config(color='#000000')
  967.     data[95]=0
  968.   else:
  969.     s.sendto("231".encode(), (target_ip, target_port))
  970.     d231.config(color='#FF0000')
  971.     data[95]=1
  972. u_gui=GUI()
  973. d000=u_gui.fill_circle(x=227,y=13,r=13,color="#000000")
  974. d000.config(onclick=button_click000)
  975. d001=u_gui.fill_circle(x=227,y=39,r=13,color="#000000")
  976. d001.config(onclick=button_click001)
  977. d002=u_gui.fill_circle(x=227,y=65,r=13,color="#000000")
  978. d002.config(onclick=button_click002)
  979. d003=u_gui.fill_circle(x=227,y=91,r=13,color="#000000")
  980. d003.config(onclick=button_click003)
  981. d004=u_gui.fill_circle(x=227,y=117,r=13,color="#000000")
  982. d004.config(onclick=button_click004)
  983. d005=u_gui.fill_circle(x=227,y=143,r=13,color="#000000")
  984. d005.config(onclick=button_click005)
  985. d006=u_gui.fill_circle(x=227,y=169,r=13,color="#000000")
  986. d006.config(onclick=button_click006)
  987. d007=u_gui.fill_circle(x=227,y=195,r=13,color="#000000")
  988. d007.config(onclick=button_click007)
  989. d008=u_gui.fill_circle(x=227,y=221,r=13,color="#000000")
  990. d008.config(onclick=button_click008)
  991. d009=u_gui.fill_circle(x=227,y=247,r=13,color="#000000")
  992. d009.config(onclick=button_click009)
  993. d010=u_gui.fill_circle(x=227,y=273,r=13,color="#000000")
  994. d010.config(onclick=button_click010)
  995. d011=u_gui.fill_circle(x=227,y=299,r=13,color="#000000")
  996. d011.config(onclick=button_click011)
  997. d012=u_gui.fill_circle(x=201,y=13,r=13,color="#000000")
  998. d012.config(onclick=button_click012)
  999. d013=u_gui.fill_circle(x=201,y=39,r=13,color="#000000")
  1000. d013.config(onclick=button_click013)
  1001. d014=u_gui.fill_circle(x=201,y=65,r=13,color="#000000")
  1002. d014.config(onclick=button_click014)
  1003. d015=u_gui.fill_circle(x=201,y=91,r=13,color="#000000")
  1004. d015.config(onclick=button_click015)
  1005. d016=u_gui.fill_circle(x=201,y=117,r=13,color="#000000")
  1006. d016.config(onclick=button_click016)
  1007. d017=u_gui.fill_circle(x=201,y=143,r=13,color="#000000")
  1008. d017.config(onclick=button_click017)
  1009. d018=u_gui.fill_circle(x=201,y=169,r=13,color="#000000")
  1010. d018.config(onclick=button_click018)
  1011. d019=u_gui.fill_circle(x=201,y=195,r=13,color="#000000")
  1012. d019.config(onclick=button_click019)
  1013. d020=u_gui.fill_circle(x=201,y=221,r=13,color="#000000")
  1014. d020.config(onclick=button_click020)
  1015. d021=u_gui.fill_circle(x=201,y=247,r=13,color="#000000")
  1016. d021.config(onclick=button_click021)
  1017. d022=u_gui.fill_circle(x=201,y=273,r=13,color="#000000")
  1018. d022.config(onclick=button_click022)
  1019. d023=u_gui.fill_circle(x=201,y=299,r=13,color="#000000")
  1020. d023.config(onclick=button_click023)
  1021. d024=u_gui.fill_circle(x=175,y=13,r=13,color="#000000")
  1022. d024.config(onclick=button_click024)
  1023. d025=u_gui.fill_circle(x=175,y=39,r=13,color="#000000")
  1024. d025.config(onclick=button_click025)
  1025. d026=u_gui.fill_circle(x=175,y=65,r=13,color="#000000")
  1026. d026.config(onclick=button_click026)
  1027. d027=u_gui.fill_circle(x=175,y=91,r=13,color="#000000")
  1028. d027.config(onclick=button_click027)
  1029. d028=u_gui.fill_circle(x=175,y=117,r=13,color="#000000")
  1030. d028.config(onclick=button_click028)
  1031. d029=u_gui.fill_circle(x=175,y=143,r=13,color="#000000")
  1032. d029.config(onclick=button_click029)
  1033. d030=u_gui.fill_circle(x=175,y=169,r=13,color="#000000")
  1034. d030.config(onclick=button_click030)
  1035. d031=u_gui.fill_circle(x=175,y=195,r=13,color="#000000")
  1036. d031.config(onclick=button_click031)
  1037. d100=u_gui.fill_circle(x=175,y=221,r=13,color="#000000")
  1038. d100.config(onclick=button_click100)
  1039. d101=u_gui.fill_circle(x=175,y=247,r=13,color="#000000")
  1040. d101.config(onclick=button_click101)
  1041. d102=u_gui.fill_circle(x=175,y=273,r=13,color="#000000")
  1042. d102.config(onclick=button_click102)
  1043. d103=u_gui.fill_circle(x=175,y=299,r=13,color="#000000")
  1044. d103.config(onclick=button_click103)
  1045. d104=u_gui.fill_circle(x=149,y=13,r=13,color="#000000")
  1046. d104.config(onclick=button_click104)
  1047. d105=u_gui.fill_circle(x=149,y=39,r=13,color="#000000")
  1048. d105.config(onclick=button_click105)
  1049. d106=u_gui.fill_circle(x=149,y=65,r=13,color="#000000")
  1050. d106.config(onclick=button_click106)
  1051. d107=u_gui.fill_circle(x=149,y=91,r=13,color="#000000")
  1052. d107.config(onclick=button_click107)
  1053. d108=u_gui.fill_circle(x=149,y=117,r=13,color="#000000")
  1054. d108.config(onclick=button_click108)
  1055. d109=u_gui.fill_circle(x=149,y=143,r=13,color="#000000")
  1056. d109.config(onclick=button_click109)
  1057. d110=u_gui.fill_circle(x=149,y=169,r=13,color="#000000")
  1058. d110.config(onclick=button_click110)
  1059. d111=u_gui.fill_circle(x=149,y=195,r=13,color="#000000")
  1060. d111.config(onclick=button_click111)
  1061. d112=u_gui.fill_circle(x=149,y=221,r=13,color="#000000")
  1062. d112.config(onclick=button_click112)
  1063. d113=u_gui.fill_circle(x=149,y=247,r=13,color="#000000")
  1064. d113.config(onclick=button_click113)
  1065. d114=u_gui.fill_circle(x=149,y=273,r=13,color="#000000")
  1066. d114.config(onclick=button_click114)
  1067. d115=u_gui.fill_circle(x=149,y=299,r=13,color="#000000")
  1068. d115.config(onclick=button_click115)
  1069. d116=u_gui.fill_circle(x=123,y=13,r=13,color="#000000")
  1070. d116.config(onclick=button_click116)
  1071. d117=u_gui.fill_circle(x=123,y=39,r=13,color="#000000")
  1072. d117.config(onclick=button_click117)
  1073. d118=u_gui.fill_circle(x=123,y=65,r=13,color="#000000")
  1074. d118.config(onclick=button_click118)
  1075. d119=u_gui.fill_circle(x=123,y=91,r=13,color="#000000")
  1076. d119.config(onclick=button_click119)
  1077. d120=u_gui.fill_circle(x=123,y=117,r=13,color="#000000")
  1078. d120.config(onclick=button_click120)
  1079. d121=u_gui.fill_circle(x=123,y=143,r=13,color="#000000")
  1080. d121.config(onclick=button_click121)
  1081. d122=u_gui.fill_circle(x=123,y=169,r=13,color="#000000")
  1082. d122.config(onclick=button_click122)
  1083. d123=u_gui.fill_circle(x=123,y=195,r=13,color="#000000")
  1084. d123.config(onclick=button_click123)
  1085. d124=u_gui.fill_circle(x=123,y=221,r=13,color="#000000")
  1086. d124.config(onclick=button_click124)
  1087. d125=u_gui.fill_circle(x=123,y=247,r=13,color="#000000")
  1088. d125.config(onclick=button_click125)
  1089. d126=u_gui.fill_circle(x=123,y=273,r=13,color="#000000")
  1090. d126.config(onclick=button_click126)
  1091. d127=u_gui.fill_circle(x=123,y=299,r=13,color="#000000")
  1092. d127.config(onclick=button_click127)
  1093. d128=u_gui.fill_circle(x=97,y=13,r=13,color="#000000")
  1094. d128.config(onclick=button_click128)
  1095. d129=u_gui.fill_circle(x=97,y=39,r=13,color="#000000")
  1096. d129.config(onclick=button_click129)
  1097. d130=u_gui.fill_circle(x=97,y=65,r=13,color="#000000")
  1098. d130.config(onclick=button_click130)
  1099. d131=u_gui.fill_circle(x=97,y=91,r=13,color="#000000")
  1100. d131.config(onclick=button_click131)
  1101. d200=u_gui.fill_circle(x=97,y=117,r=13,color="#000000")
  1102. d200.config(onclick=button_click200)
  1103. d201=u_gui.fill_circle(x=97,y=143,r=13,color="#000000")
  1104. d201.config(onclick=button_click201)
  1105. d202=u_gui.fill_circle(x=97,y=169,r=13,color="#000000")
  1106. d202.config(onclick=button_click202)
  1107. d203=u_gui.fill_circle(x=97,y=195,r=13,color="#000000")
  1108. d203.config(onclick=button_click203)
  1109. d204=u_gui.fill_circle(x=97,y=221,r=13,color="#000000")
  1110. d204.config(onclick=button_click204)
  1111. d205=u_gui.fill_circle(x=97,y=247,r=13,color="#000000")
  1112. d205.config(onclick=button_click205)
  1113. d206=u_gui.fill_circle(x=97,y=273,r=13,color="#000000")
  1114. d206.config(onclick=button_click206)
  1115. d207=u_gui.fill_circle(x=97,y=299,r=13,color="#000000")
  1116. d207.config(onclick=button_click207)
  1117. d208=u_gui.fill_circle(x=71,y=13,r=13,color="#000000")
  1118. d208.config(onclick=button_click208)
  1119. d209=u_gui.fill_circle(x=71,y=39,r=13,color="#000000")
  1120. d209.config(onclick=button_click209)
  1121. d210=u_gui.fill_circle(x=71,y=65,r=13,color="#000000")
  1122. d210.config(onclick=button_click210)
  1123. d211=u_gui.fill_circle(x=71,y=91,r=13,color="#000000")
  1124. d211.config(onclick=button_click211)
  1125. d212=u_gui.fill_circle(x=71,y=117,r=13,color="#000000")
  1126. d212.config(onclick=button_click212)
  1127. d213=u_gui.fill_circle(x=71,y=143,r=13,color="#000000")
  1128. d213.config(onclick=button_click213)
  1129. d214=u_gui.fill_circle(x=71,y=169,r=13,color="#000000")
  1130. d214.config(onclick=button_click214)
  1131. d215=u_gui.fill_circle(x=71,y=195,r=13,color="#000000")
  1132. d215.config(onclick=button_click215)
  1133. d216=u_gui.fill_circle(x=71,y=221,r=13,color="#000000")
  1134. d216.config(onclick=button_click216)
  1135. d217=u_gui.fill_circle(x=71,y=247,r=13,color="#000000")
  1136. d217.config(onclick=button_click217)
  1137. d218=u_gui.fill_circle(x=71,y=273,r=13,color="#000000")
  1138. d218.config(onclick=button_click218)
  1139. d219=u_gui.fill_circle(x=71,y=299,r=13,color="#000000")
  1140. d219.config(onclick=button_click219)
  1141. d220=u_gui.fill_circle(x=45,y=13,r=13,color="#000000")
  1142. d220.config(onclick=button_click220)
  1143. d221=u_gui.fill_circle(x=45,y=39,r=13,color="#000000")
  1144. d221.config(onclick=button_click221)
  1145. d222=u_gui.fill_circle(x=45,y=65,r=13,color="#000000")
  1146. d222.config(onclick=button_click222)
  1147. d223=u_gui.fill_circle(x=45,y=91,r=13,color="#000000")
  1148. d223.config(onclick=button_click223)
  1149. d224=u_gui.fill_circle(x=45,y=117,r=13,color="#000000")
  1150. d224.config(onclick=button_click224)
  1151. d225=u_gui.fill_circle(x=45,y=143,r=13,color="#000000")
  1152. d225.config(onclick=button_click225)
  1153. d226=u_gui.fill_circle(x=45,y=169,r=13,color="#000000")
  1154. d226.config(onclick=button_click226)
  1155. d227=u_gui.fill_circle(x=45,y=195,r=13,color="#000000")
  1156. d227.config(onclick=button_click227)
  1157. d228=u_gui.fill_circle(x=45,y=221,r=13,color="#000000")
  1158. d228.config(onclick=button_click228)
  1159. d229=u_gui.fill_circle(x=45,y=247,r=13,color="#000000")
  1160. d229.config(onclick=button_click229)
  1161. d230=u_gui.fill_circle(x=45,y=273,r=13,color="#000000")
  1162. d230.config(onclick=button_click230)
  1163. d231=u_gui.fill_circle(x=45,y=299,r=13,color="#000000")
  1164. d231.config(onclick=button_click231)
  1165. while 1:
  1166.     pass
  1167. s.close()
复制代码
Arduino UNO R4 与行空板 LED矩阵互动图4

四、演示视频



三春牛-创客  初级技神

发表于 2023-8-26 10:33:39

厉害厉害!!
回复

使用道具 举报

三春牛-创客  初级技神

发表于 2023-8-26 10:35:11

赞一个!!
回复

使用道具 举报

花生编程  中级技匠

发表于 2023-8-29 17:25:26

厉害厉害!
回复

使用道具 举报

花生编程  中级技匠

发表于 2023-8-29 17:27:04

赞赞赞赞赞!
回复

使用道具 举报

xiang12138  学徒

发表于 2023-8-31 14:57:29

楼主,第一个网页控制LED矩阵这个程序,我咋运行失败,   
#include "arduino_secrets.h" compilation terminated,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail