当前位置: 首页 > news >正文

站长工具搜一搜seo专业知识培训

站长工具搜一搜,seo专业知识培训,官方网站开发公司排名,商标注册网上申请流程25个步骤这次的项目在软件上没多少调整,但本人希望分享一下硬件上的经验。 小车使用两轮差速底盘,驱动轮在小车中间,前后都要万向轮。这种形式可以实现0转弯半径,但受万向轮及用于加高的铜柱的规格限制,两个万向轮难以调到相同…

这次的项目在软件上没多少调整,但本人希望分享一下硬件上的经验。

小车使用两轮差速底盘,驱动轮在小车中间,前后都要万向轮。这种形式可以实现0转弯半径,但受万向轮及用于加高的铜柱的规格限制,两个万向轮难以调到相同高度。考虑铜柱规格,本人万向轮调到比后面的万向轮略高,这样在向前加速时也更稳定。底盘的底板和盖板均使用4mm亚克力板,强度足够。由于重量较轻,在机械臂未指向正前方时可能出现一边车轮抓地效果不好的情况,建议先调整机械臂再行进。

 

底盘采用闭环控制,由于对实时性要求高,不适合用同一块主控运行网页,因此使用另一块主控提供网页,并通过串口转发指令,此外还开启热点以便在户外连接。由于要给两块主控和两个编码器供电,对12v电池降压有较大压降,AMS1117不能满足需要,就改用性能更高的LM7805降压模块。由于专门的编码器电机驱动尚无标准化设计,性价比较低,本人使用杜邦线连接编码器电机的接口,电机驱动使用经典的L298N。由于搭载机械臂增大了负载,底盘的PID参数调到P=20、I=2,实测相应速度和稳定性良好。

 机械臂使用PCA9685进行驱动,舵机为MG996R,由于希望达到6v电压以充分发挥舵机性能,本人尝试了6v电池和使用LM7806对7.4v电池降压的方案,均不能正常运行。之后使用LM7805对7.4v电池降压输出到主控,并由主控输出5v电压到PCA9685,也不能正常运行。最后改用充电宝给主控供电并由主控输出5v电压到PCA9685,可以正常运行。出现这种情况可能是因为PCA9685对电压稳定性要求较高。由于MG996R舵机的线不够长,有3个舵机使用了舵机延长线。为了方便操作,控制机械臂的主控也连接到底盘上的主控发出的热点。本人测试过把这两部分程序合并,但不能正常加载网页,就分两块主控。

 相应程序

控制电机的ESP32

from machine import *
import time
from motos import *
import _thread
'''
底盘参数计算(最终结果保留3位有效数字)
(speed为编码器脉冲计数)
轮直径:0.065
轮周长:0.2041
每圈脉冲数:110
底盘周长:0.6908
底盘直径/每rad长:0.22
每次脉冲长度:0.001855
线速度:speed*10*0.001855=speed*0.0186
角速度:(speed1-speed2)*10*0.001855/0.22=(speed1-speed2)*0.0843
考虑丢步情况,大约只有63%的脉冲能被统计,因此公式改为:
线速度=speed/0.63*0.0186=speed*0.0295
角速度=(speed1-speed2)/0.63*0.0843=(speed1-speed2)*0.134
每旋转1度(一边轮静止,另一边旋转)所需脉冲数=0.22*2*3.14/360/0.00186*0.63=1.30
每行驶1米所需脉冲数:1/0.001855*0.63=340
'''
# 编码器初始化
pin17 = Pin(17, Pin.IN)
pin5 = Pin(5, Pin.IN)   
encoder1 = encoder1(pin5, pin17, 0)   # 参数(编码器A相引脚,编码器B相引脚,定时器序号)
pin19 = Pin(19, Pin.IN) 
pin18 = Pin(18, Pin.IN) 
encoder2 = encoder2(pin18, pin19, 2)# 电机初始化
motor1=PWM(Pin(15),freq=1000,duty=0)
motor2=PWM(Pin(2),freq=1000,duty=0)
motor3=PWM(Pin(4),freq=1000,duty=0)
motor4=PWM(Pin(16),freq=1000,duty=0)duty1=0
duty2=0
linear_velocity=0
angular_velocity=0
target1=0
target2=0
offset1=0
offset2=0
'''
distance=0
angle=0
target_distance=0
target_angle=0
flag=0
'''def set_target(duty1,duty2):global linear_velocityglobal angular_velocityglobal target1global target2global target_distanceglobal target_angleglobal flagwhile True:try:target=int(input("input"))''' #控制底盘旋转一定角度并前进一定距离,实测不能正常运行,已弃用if target//1000>600: #前3位组成的数大于600时控制行驶距离和旋转角度target_distance=target%1000 #后三位为距离*100target_angle=target//1000-800 #前三位为旋转角度+800,角度为正时右转target_angle=round(target_angle*1.3)target_distance=round(target_distance*0.34)print(target_angle,target_distance)flag=1target=0elif target>0: #前3位组成的数小于600时控制线速度和角速度'''linear_velocity=target%1000-400 #前三位为角速度*100+400,角速度为正时右转,后三位为线速度*100+400angular_velocity=target//1000-400 #换算时数字放大1000倍,除法运算后结果不用缩小target_speed=linear_velocity/2.95 #计算每周期目标脉冲数target_offset=angular_velocity/26.8 #计算每周期目标脉冲数差并换算为每边车轮速度与平均速度的差target1=round(target_speed+target_offset) #左轮目标每周期脉冲数target2=round(target_speed-target_offset) #右轮目标每周期脉冲数target=0except:pass
_thread.start_new_thread(set_target, (duty1, duty2))while True:speed1 = encoder1.read() #编码器读数speed2 = encoder2.read()Offset1=offset1 #记录上一次偏差Offset2=offset2offset1=target1-speed1 offset2=target2-speed2adujstment1=offset1*20-Offset1*18 #PID控制:P=20,I=2adujstment2=offset2*20-Offset2*18duty1+=adujstment1duty2+=adujstment2''' #控制底盘旋转一定角度并前进一定距离,实测不能正常运行,已弃用if flag==1: #指定角度转向print(flag,angle)if 0<target_angle-angle<10 or 0>target_angle-angle>-10:target1=0target2=0flag=2angle=0target_angle=0if target_angle>0: #右转target1=20target2=0angle+=speed1if target_angle<0: #左转target1=0target2=20angle+=speed2if flag==2: #指定距离直行print(flag,distance)if target_distance-distance>400:target1=100target2=100elif target_distance-distance>100:target1=25target2=25elif target_distance-distance>40:target1=10target2=10elif target_distance-distance<15:target1=0target2=0flag=0distance=0target_distance=0distance+=speed1'''if target1<0: #由于实测发现电机反向时不能正常测速,这部分改为开环控制duty1=10*target1if target2<0:duty2=10*target2 if duty1<-1023:duty1=-1023if duty1>1023:duty1=1023if duty2<-1023:duty2=-1023if duty2>1023:duty2=1023if duty1>0:motor1.duty(duty1)motor2.duty(0)if duty1<0:motor1.duty(0) motor2.duty(-duty1)if duty2>0:motor3.duty(duty2)motor4.duty(0)if duty2<0:motor3.duty(0) motor4.duty(-duty2)   time.sleep(0.1)

发出热点的ESP32C3

#导入Pin模块
from machine import Pin
import time
from machine import PWM
import network
import socket#定义LED控制对象
led1=Pin(6,Pin.OUT,Pin.PULL_DOWN)duty=0
speed=0
turn=0
angular=400
linear=400#WIFI连接
def wifi_connect():ap = network.WLAN(network.AP_IF)  # 指定用ap模式ap.active(True)                   # 启用wifi前需要先激活接口ap.config(essid="ESP32_Motor_Control")      # 设置热点名称ap.config(authmode=0)  # 设置认证模式return True#网页数据
def web_page():global a1global a2global a3global a4html = """<html>
<head><meta name="viewport" content="width=device-width, initial-scale=1"><style>.button{display: inline-block; background-color: #8080f0; border: none; border-radius: 4px; color: white; padding: 8px 15px; text-decoration: none; font-size: 20px; margin: 2px; cursor: pointer;}a:link {text-decoration:none;}a:visited {text-decoration:none;}a:hover {text-decoration:none;}a:active {text-decoration:none;} html {font-family: Arial;display: inline-block;margin: 0px auto;text-align: center;}h2 { font-size: 1.5rem; }p { font-size: 1.5rem; }.units { font-size: 1rem; }.dht-labels{font-size: 1rem;vertical-align:middle;padding-bottom: 7px;}</style>
</head>
<body><h2>ESP32 Motor Control</h2> <p><a href="/?d1">linear: <strong>""" + str(speed) + """</strong></a></p><p><a href="/?w10"><button class="button">-3.00</button></a><a href="/?w11"><button class="button">-2.75</button></a><a href="/?w12"><button class="button">-2.50</button></a><a href="/?w13"><button class="button">-2.25</button></a><a href="/?w14"><button class="button">-2.00</button></a><a href="/?w15"><button class="button">-1.75</button></a><a href="/?w16"><button class="button">-1.50</button></a><a href="/?w17"><button class="button">-1.25</button></a><a href="/?w18"><button class="button">-1.00</button></a><a href="/?w19"><button class="button">-0.75</button></a><a href="/?w1a"><button class="button">-0.50</button></a><a href="/?w1b"><button class="button">-0.25</button></a><a href="/?w1c"><button class="button">0.00</button></a><a href="/?w1d"><button class="button">0.25</button></a><a href="/?w1e"><button class="button">0.50</button></a><a href="/?w1f"><button class="button">0.75</button></a><a href="/?w1g"><button class="button">1.00</button></a><a href="/?w1h"><button class="button">1.25</button></a><a href="/?w1i"><button class="button">1.50</button></a><a href="/?w1j"><button class="button">1.75</button></a><a href="/?w1k"><button class="button">2.00</button></a><a href="/?w1l"><button class="button">2.25</button></a><a href="/?w1m"><button class="button">2.50</button></a><a href="/?w1n"><button class="button">2.75</button></a><a href="/?w1o"><button class="button">3.00</button></a></p><p><a href="/?d2">angular: <strong>""" + str(turn) + """</strong></a></p><p><a href="/?w20"><button class="button">-3.00</button></a><a href="/?w21"><button class="button">-2.75</button></a><a href="/?w22"><button class="button">-2.50</button></a><a href="/?w23"><button class="button">-2.25</button></a><a href="/?w24"><button class="button">-2.00</button></a><a href="/?w25"><button class="button">-1.75</button></a><a href="/?w26"><button class="button">-1.50</button></a><a href="/?w27"><button class="button">-1.25</button></a><a href="/?w28"><button class="button">-1.00</button></a><a href="/?w29"><button class="button">-0.75</button></a><a href="/?w2a"><button class="button">-0.50</button></a><a href="/?w2b"><button class="button">-0.25</button></a><a href="/?w2c"><button class="button">0.00</button></a><a href="/?w2d"><button class="button">0.25</button></a><a href="/?w2e"><button class="button">0.50</button></a><a href="/?w2f"><button class="button">0.75</button></a><a href="/?w2g"><button class="button">1.00</button></a><a href="/?w2h"><button class="button">1.25</button></a><a href="/?w2i"><button class="button">1.50</button></a><a href="/?w2j"><button class="button">1.75</button></a><a href="/?w2k"><button class="button">2.00</button></a><a href="/?w2l"><button class="button">2.25</button></a><a href="/?w2m"><button class="button">2.50</button></a><a href="/?w2n"><button class="button">2.75</button></a><a href="/?w2o"><button class="button">3.00</button></a></p>
</body>
</html>"""return html#程序入口
if __name__=="__main__":wifi_connect()#SOCK_STREAM表示的是TCP协议,SOCK_DGRAM表示的是UDP协议my_socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)  #创建socket连接# 将socket对象绑定ip地址和端口号my_socket.bind(('', 80))# 相当于电话的开机 括号里的参数表示可以同时接收5个请求my_socket.listen(5)while True:try:    # 进入监听状态,等待别人链接过来,有两个返回值,#一个是对方的socket对象,一个是对方的ip以及端口client, addr = my_socket.accept()# recv表示接收,括号里是最大接收字节request = client.recv(1024)request = str(request)w10 = request.find('/?w10')w11 = request.find('/?w11')w12 = request.find('/?w12')w13 = request.find('/?w13')w14 = request.find('/?w14')w15 = request.find('/?w15')w16 = request.find('/?w16')w17 = request.find('/?w17')w18 = request.find('/?w18')w19 = request.find('/?w19')w1a = request.find('/?w1a')w1b = request.find('/?w1b')w1c = request.find('/?w1c')w1d = request.find('/?w1d')w1e = request.find('/?w1e')w1f = request.find('/?w1f')w1g = request.find('/?w1g')w1h = request.find('/?w1h')w1i = request.find('/?w1i')w1j = request.find('/?w1j')w1k = request.find('/?w1k')w1l = request.find('/?w1l')w1m = request.find('/?w1m')w1n = request.find('/?w1n')w1o = request.find('/?w1o')w20 = request.find('/?w20')w21 = request.find('/?w21')w22 = request.find('/?w22')w23 = request.find('/?w23')w24 = request.find('/?w24')w25 = request.find('/?w25')w26 = request.find('/?w26')w27 = request.find('/?w27')w28 = request.find('/?w28')w29 = request.find('/?w29')w2a = request.find('/?w2a')w2b = request.find('/?w2b')w2c = request.find('/?w2c')w2d = request.find('/?w2d')w2e = request.find('/?w2e')w2f = request.find('/?w2f')w2g = request.find('/?w2g')w2h = request.find('/?w2h')w2i = request.find('/?w2i')w2j = request.find('/?w2j')w2k = request.find('/?w2k')w2l = request.find('/?w2l')w2m = request.find('/?w2m')w2n = request.find('/?w2n')w2o = request.find('/?w2o')d1 = request.find('/?d1')d2 = request.find('/?d2')if d1 == 6:speed=0.00linear=400print(str(angular)+str(linear))if d2 == 6:turn=0.00angular=400print(str(angular)+str(linear))    if w10 == 6:speed=-3.00linear=100print(str(angular)+str(linear))if w11 == 6:speed=-2.75linear=125print(str(angular)+str(linear))   if w12 == 6:speed=-2.50linear=150print(str(angular)+str(linear))if w13 == 6:speed=-2.25linear=175print(str(angular)+str(linear))if w14 == 6:speed=-2.00linear=200print(str(angular)+str(linear))if w15 == 6:speed=-1.75linear=225print(str(angular)+str(linear))   if w16 == 6:speed=-1.50linear=250print(str(angular)+str(linear))if w17 == 6:speed=-1.25linear=275print(str(angular)+str(linear))if w18 == 6:speed=-1.00linear=300print(str(angular)+str(linear))if w19 == 6:speed=-0.75linear=325print(str(angular)+str(linear))   if w1a == 6:speed=-0.50linear=350print(str(angular)+str(linear))if w1b == 6:speed=-0.25linear=375print(str(angular)+str(linear))if w1c == 6:speed=0.00linear=400print(str(angular)+str(linear))if w1d == 6:speed=0.25linear=425print(str(angular)+str(linear))   if w1e == 6:speed=0.50linear=450print(str(angular)+str(linear))if w1f == 6:speed=0.75linear=475print(str(angular)+str(linear))if w1g == 6:speed=1.00linear=500print(str(angular)+str(linear))if w1h == 6:speed=1.25linear=525print(str(angular)+str(linear))   if w1i == 6:speed=1.50linear=550print(str(angular)+str(linear))if w1j == 6:speed=1.75linear=575print(str(angular)+str(linear))if w1k == 6:speed=2.00linear=600print(str(angular)+str(linear))if w1l == 6:speed=2.25linear=625print(str(angular)+str(linear))   if w1m == 6:speed=2.50linear=650print(str(angular)+str(linear))if w1n == 6:speed=2.75linear=675print(str(angular)+str(linear))if w1o == 6:speed=3.00linear=700print(str(angular)+str(linear))if w20 == 6:turn=-3.00angular=100print(str(angular)+str(linear))if w21 == 6:turn=-2.75angular=125print(str(angular)+str(linear))   if w22 == 6:turn=-2.50angular=150print(str(angular)+str(linear))if w23 == 6:turn=-2.25angular=175print(str(angular)+str(linear))if w24 == 6:turn=-2.00angular=200print(str(angular)+str(linear))if w25 == 6:turn=-1.75angular=225print(str(angular)+str(linear))   if w26 == 6:turn=-1.50angular=250print(str(angular)+str(linear))if w27 == 6:turn=-1.25angular=275print(str(angular)+str(linear))if w28 == 6:turn=-1.00angular=300print(str(angular)+str(linear))if w29 == 6:turn=-0.75angular=325print(str(angular)+str(linear))   if w2a == 6:turn=-0.50angular=350print(str(angular)+str(linear))if w2b == 6:turn=-0.25angular=375print(str(angular)+str(linear))if w2c == 6:turn=0.00angular=400print(str(angular)+str(linear))if w2d == 6:turn=0.25angular=425print(str(angular)+str(linear))   if w2e == 6:turn=0.50angular=450print(str(angular)+str(linear))if w2f == 6:turn=0.75angular=475print(str(angular)+str(linear))if w2g == 6:turn=1.00angular=500print(str(angular)+str(linear))if w2h == 6:turn=1.25angular=525print(str(angular)+str(linear))   if w2i == 6:turn=1.50angular=550print(str(angular)+str(linear))if w2j == 6:turn=1.75angular=575print(str(angular)+str(linear))if w2k == 6:turn=2.00angular=600print(str(angular)+str(linear))if w2l == 6:turn=2.25angular=625print(str(angular)+str(linear))   if w2m == 6:turn=2.50angular=650print(str(angular)+str(linear))if w2n == 6:turn=2.75angular=675print(str(angular)+str(linear))if w2o == 6:turn=3.00angular=700print(str(angular)+str(linear))    response = web_page()client.send('HTTP/1.1 200 OK\n')client.send('Content-Type: text/html\n')client.send('Connection: close\n\n')client.sendall(response)client.close()except:pass

控制机械臂的ESP32C3

#导入Pin模块
from machine import Pin
import time
from machine import SoftI2C
from servo import Servos
import network
import socket#定义LED控制对象
led1=Pin(4,Pin.OUT,Pin.PULL_DOWN)
i2c=SoftI2C(sda=Pin(9),scl=Pin(8),freq=10000)
servos=Servos(i2c,address=0x40)#连接的WIFI账号和密码
ssid = "ESP32_Motor_Control"
password=None
#舵机默认角度
servos.position(0,90)
servos.position(1,90)
servos.position(2,90)
servos.position(3,90)
servos.position(4,90)#WIFI连接
def wifi_connect():wlan=network.WLAN(network.STA_IF)  #STA模式wlan.active(True)  #激活if not wlan.isconnected():print("conneting to network...")wlan.connect(ssid,password)  #输入 WIFI 账号密码while not wlan.isconnected():led1.value(1)time.sleep_ms(300)led1.value(0)time.sleep_ms(300)led1.value(0)return Falseelse:led1.value(0)print("network information:", wlan.ifconfig())return Truea0=90
a1=90
a2=90
a3=90
a4=90
#网页数据
def web_page():global a0global a1global a2global a3global a4html = """<html>
<head><meta name="viewport" content="width=device-width, initial-scale=1"><style>.button{display: inline-block; background-color: #971080; border: none; border-radius: 4px; color: white; padding: 8px 15px; text-decoration: none; font-size: 20px; margin: 2px; cursor: pointer;}a:link {text-decoration:none;}a:visited {text-decoration:none;}a:hover {text-decoration:none;}a:active {text-decoration:none;} html {font-family: Arial;display: inline-block;margin: 0px auto;text-align: center;}h2 { font-size: 1.5rem; }p { font-size: 1.5rem; }.units { font-size: 1rem; }.dht-labels{font-size: 1rem;vertical-align:middle;padding-bottom: 7px;}</style>
</head>
<body><h2>ESP32 Servo Control</h2><p><a href="/?d0">Servo0: <strong>""" + str(a0) + """</strong></a></p><p><a href="/?b00"><button class="button">0</button></a><a href="/?b01"><button class="button">10</button></a><a href="/?b02"><button class="button">20</button></a><a href="/?b03"><button class="button">30</button></a><a href="/?b04"><button class="button">40</button></a><a href="/?b05"><button class="button">50</button></a><a href="/?b06"><button class="button">60</button></a><a href="/?b07"><button class="button">70</button></a><a href="/?b08"><button class="button">80</button></a><a href="/?b09"><button class="button">90</button></a><a href="/?b0a"><button class="button">100</button></a><a href="/?b0b"><button class="button">110</button></a><a href="/?b0c"><button class="button">120</button></a><a href="/?b0d"><button class="button">130</button></a><a href="/?b0e"><button class="button">140</button></a><a href="/?b0f"><button class="button">150</button></a><a href="/?b0g"><button class="button">160</button></a><a href="/?b0h"><button class="button">170</button></a><a href="/?b0i"><button class="button">180</button></a></p><p><a href="/?d1">Servo1: <strong>""" + str(a1) + """</strong></a></p><p><a href="/?b10"><button class="button">0</button></a><a href="/?b11"><button class="button">10</button></a><a href="/?b12"><button class="button">20</button></a><a href="/?b13"><button class="button">30</button></a><a href="/?b14"><button class="button">40</button></a><a href="/?b15"><button class="button">50</button></a><a href="/?b16"><button class="button">60</button></a><a href="/?b17"><button class="button">70</button></a><a href="/?b18"><button class="button">80</button></a><a href="/?b19"><button class="button">90</button></a><a href="/?b1a"><button class="button">100</button></a><a href="/?b1b"><button class="button">110</button></a><a href="/?b1c"><button class="button">120</button></a><a href="/?b1d"><button class="button">130</button></a><a href="/?b1e"><button class="button">140</button></a><a href="/?b1f"><button class="button">150</button></a><a href="/?b1g"><button class="button">160</button></a><a href="/?b1h"><button class="button">170</button></a><a href="/?b1i"><button class="button">180</button></a></p><p><a href="/?d2">Servo2: <strong>""" + str(a2) + """</strong></a></p><p><a href="/?b10"><button class="button">0</button></a><a href="/?b21"><button class="button">10</button></a><a href="/?b22"><button class="button">20</button></a><a href="/?b23"><button class="button">30</button></a><a href="/?b24"><button class="button">40</button></a><a href="/?b25"><button class="button">50</button></a><a href="/?b26"><button class="button">60</button></a><a href="/?b27"><button class="button">70</button></a><a href="/?b28"><button class="button">80</button></a><a href="/?b29"><button class="button">90</button></a><a href="/?b2a"><button class="button">100</button></a><a href="/?b2b"><button class="button">110</button></a><a href="/?b2c"><button class="button">120</button></a><a href="/?b2d"><button class="button">130</button></a><a href="/?b2e"><button class="button">140</button></a><a href="/?b2f"><button class="button">150</button></a><a href="/?b2g"><button class="button">160</button></a><a href="/?b2h"><button class="button">170</button></a><a href="/?b2i"><button class="button">180</button></a></p><p><a href="/?d3">Servo3: <strong>""" + str(a3) + """</strong></a></p><p><a href="/?b30"><button class="button">0</button></a><a href="/?b31"><button class="button">10</button></a><a href="/?b32"><button class="button">20</button></a><a href="/?b33"><button class="button">30</button></a><a href="/?b34"><button class="button">40</button></a><a href="/?b35"><button class="button">50</button></a><a href="/?b36"><button class="button">60</button></a><a href="/?b37"><button class="button">70</button></a><a href="/?b38"><button class="button">80</button></a><a href="/?b39"><button class="button">90</button></a><a href="/?b3a"><button class="button">100</button></a><a href="/?b3b"><button class="button">110</button></a><a href="/?b3c"><button class="button">120</button></a><a href="/?b3d"><button class="button">130</button></a><a href="/?b3e"><button class="button">140</button></a><a href="/?b3f"><button class="button">150</button></a><a href="/?b3g"><button class="button">160</button></a><a href="/?b3h"><button class="button">170</button></a><a href="/?b3i"><button class="button">180</button></a></p><p><a href="/?d4">Servo4: <strong>""" + str(a4) + """</strong></a></p><p><a href="/?b30"><button class="button">0</button></a><a href="/?b41"><button class="button">10</button></a><a href="/?b42"><button class="button">20</button></a><a href="/?b43"><button class="button">30</button></a><a href="/?b44"><button class="button">40</button></a><a href="/?b45"><button class="button">50</button></a><a href="/?b46"><button class="button">60</button></a><a href="/?b47"><button class="button">70</button></a><a href="/?b48"><button class="button">80</button></a><a href="/?b49"><button class="button">90</button></a><a href="/?b4a"><button class="button">100</button></a><a href="/?b4b"><button class="button">110</button></a><a href="/?b4c"><button class="button">120</button></a><a href="/?b4d"><button class="button">130</button></a><a href="/?b4e"><button class="button">140</button></a><a href="/?b4f"><button class="button">150</button></a><a href="/?b4g"><button class="button">160</button></a><a href="/?b4h"><button class="button">170</button></a><a href="/?b4i"><button class="button">180</button></a></p>
</body>
</html>"""return html#程序入口
if __name__=="__main__":wifi_connect()#SOCK_STREAM表示的是TCP协议,SOCK_DGRAM表示的是UDP协议my_socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)  #创建socket连接# 将socket对象绑定ip地址和端口号my_socket.bind(('', 80))# 相当于电话的开机 括号里的参数表示可以同时接收5个请求my_socket.listen(5)while True:try:    # 进入监听状态,等待别人链接过来,有两个返回值,#一个是对方的socket对象,一个是对方的ip以及端口client, addr = my_socket.accept()print('Got a connection from %s' % str(addr))# recv表示接收,括号里是最大接收字节request = client.recv(1024)request = str(request)print('Content = %s' % request)b00 = request.find('/?b00')b01 = request.find('/?b01')b02 = request.find('/?b02')b03 = request.find('/?b03')b04 = request.find('/?b04')b05 = request.find('/?b05')b06 = request.find('/?b06')b07 = request.find('/?b07')b08 = request.find('/?b08')b09 = request.find('/?b09')b0a = request.find('/?b0a')b0b = request.find('/?b0b')b0c = request.find('/?b0c')b0d = request.find('/?b0d')b0e = request.find('/?b0e')b0f = request.find('/?b0f')b0g = request.find('/?b0g')b0h = request.find('/?b0h')b0i = request.find('/?b0i')b10 = request.find('/?b10')b11 = request.find('/?b11')b12 = request.find('/?b12')b13 = request.find('/?b13')b14 = request.find('/?b14')b15 = request.find('/?b15')b16 = request.find('/?b16')b17 = request.find('/?b17')b18 = request.find('/?b18')b19 = request.find('/?b19')b1a = request.find('/?b1a')b1b = request.find('/?b1b')b1c = request.find('/?b1c')b1d = request.find('/?b1d')b1e = request.find('/?b1e')b1f = request.find('/?b1f')b1g = request.find('/?b1g')b1h = request.find('/?b1h')b1i = request.find('/?b1i')b20 = request.find('/?b10')b21 = request.find('/?b21')b22 = request.find('/?b22')b23 = request.find('/?b23')b24 = request.find('/?b24')b25 = request.find('/?b25')b26 = request.find('/?b26')b27 = request.find('/?b27')b28 = request.find('/?b28')b29 = request.find('/?b29')b2a = request.find('/?b2a')b2b = request.find('/?b2b')b2c = request.find('/?b2c')b2d = request.find('/?b2d')b2e = request.find('/?b2e')b2f = request.find('/?b2f')b2g = request.find('/?b2g')b2h = request.find('/?b2h')b2i = request.find('/?b2i')b30 = request.find('/?b30')b31 = request.find('/?b31')b32 = request.find('/?b32')b33 = request.find('/?b33')b34 = request.find('/?b34')b35 = request.find('/?b35')b36 = request.find('/?b36')b37 = request.find('/?b37')b38 = request.find('/?b38')b39 = request.find('/?b39')b3a = request.find('/?b3a')b3b = request.find('/?b3b')b3c = request.find('/?b3c')b3d = request.find('/?b3d')b3e = request.find('/?b3e')b3f = request.find('/?b3f')b3g = request.find('/?b3g')b3h = request.find('/?b3h')b3i = request.find('/?b3i')b40 = request.find('/?b40')b41 = request.find('/?b41')b42 = request.find('/?b42')b43 = request.find('/?b43')b44 = request.find('/?b44')b45 = request.find('/?b45')b46 = request.find('/?b46')b47 = request.find('/?b47')b48 = request.find('/?b48')b49 = request.find('/?b49')b4a = request.find('/?b4a')b4b = request.find('/?b4b')b4c = request.find('/?b4c')b4d = request.find('/?b4d')b4e = request.find('/?b4e')b4f = request.find('/?b4f')b4g = request.find('/?b4g')b4h = request.find('/?b4h')b4i = request.find('/?b4i')if b00 == 6:servos.position(0,0)a0=0if b11 == 6:servos.position(0,10)a0=10if b02 == 6:servos.position(0,20)a0=20if b03 == 6:servos.position(0,30)a0=30if b04 == 6:servos.position(0,40)a0=40if b05 == 6:servos.position(0,50)a0=50if b06 == 6:servos.position(0,60)a0=60if b07 == 6:servos.position(0,70)a0=70if b08 == 6:servos.position(0,80)a0=80if b09 == 6:servos.position(0,90)a0=90if b0a == 6:servos.position(0,100)a0=100if b0b == 6:servos.position(0,110)a0=110if b0c == 6:servos.position(0,120)a0=120if b0d == 6:servos.position(0,130)a0=130if b0e == 6:servos.position(0,140)a0=140if b0f == 6:servos.position(0,150)a0=150if b0g == 6:servos.position(0,160)a0=160if b0h == 6:servos.position(0,170)a0=170if b0i == 6:servos.position(0,180)a0=180if b10 == 6:servos.position(1,0)a1=0if b11 == 6:servos.position(1,10)a1=10if b12 == 6:servos.position(1,20)a1=20if b13 == 6:servos.position(1,30)a1=30if b14 == 6:servos.position(1,40)a1=40if b15 == 6:servos.position(1,50)a1=50if b16 == 6:servos.position(1,60)a1=60if b17 == 6:servos.position(1,70)a1=70if b18 == 6:servos.position(1,80)a1=80if b19 == 6:servos.position(1,90)a1=90if b1a == 6:servos.position(1,100)a1=100if b1b == 6:servos.position(1,110)a1=110if b1c == 6:servos.position(1,120)a1=120if b1d == 6:servos.position(1,130)a1=130if b1e == 6:servos.position(1,140)a1=140if b1f == 6:servos.position(1,150)a1=150if b1g == 6:servos.position(1,160)a1=160if b1h == 6:servos.position(1,170)a1=170if b1i == 6:servos.position(1,180)a1=180if b20 == 6:servos.position(2,0)a2=0if b21 == 6:servos.position(2,10)a2=10if b22 == 6:servos.position(2,20)a2=20if b23 == 6:servos.position(2,30)a2=30if b24 == 6:servos.position(2,40)a2=40if b25 == 6:servos.position(2,50)a2=50if b26 == 6:servos.position(2,60)a2=60if b27 == 6:servos.position(2,70)a2=70if b28 == 6:servos.position(2,80)a2=80if b29 == 6:servos.position(2,90)a2=90if b2a == 6:servos.position(2,100)a2=100if b2b == 6:servos.position(2,110)a2=110if b2c == 6:servos.position(2,120)a2=120if b2d == 6:servos.position(2,130)a2=130if b2e == 6:servos.position(2,140)a2=140if b2f == 6:servos.position(2,150)a2=150if b2g == 6:servos.position(2,160)a2=160if b2h == 6:servos.position(2,170)a2=170if b2i == 6:servos.position(2,180)a2=180if b30 == 6:servos.position(3,0)a3=0if b31 == 6:servos.position(3,10)a3=10if b32 == 6:servos.position(3,20)a3=20if b33 == 6:servos.position(3,30)a3=30if b34 == 6:servos.position(3,40)a3=40if b35 == 6:servos.position(3,50)a3=50if b36 == 6:servos.position(3,60)a3=60if b37 == 6:servos.position(3,70)a3=70if b38 == 6:servos.position(3,80)a3=80if b39 == 6:servos.position(3,90)a3=90if b3a == 6:servos.position(3,100)a3=100if b3b == 6:servos.position(3,110)a3=110if b3c == 6:servos.position(3,120)a3=120if b3d == 6:servos.position(3,130)a3=130if b3e == 6:servos.position(3,140)a3=140if b3f == 6:servos.position(3,150)a3=150if b3g == 6:servos.position(3,160)a3=160if b3h == 6:servos.position(3,170)a3=170if b3i == 6:servos.position(3,180)a3=180if b40 == 6:servos.position(4,0)a4=0if b41 == 6:servos.position(4,10)a4=10if b42 == 6:servos.position(4,20)a4=20if b43 == 6:servos.position(4,30)a4=30if b44 == 6:servos.position(4,40)a4=40if b45 == 6:servos.position(4,50)a4=50if b46 == 6:servos.position(4,60)a4=60if b47 == 6:servos.position(4,70)a4=70if b48 == 6:servos.position(4,80)a4=80if b49 == 6:servos.position(4,90)a4=90if b4a == 6:servos.position(4,100)a4=100if b4b == 6:servos.position(4,110)a4=110if b4c == 6:servos.position(4,120)a4=120if b4d == 6:servos.position(4,130)a4=130if b4e == 6:servos.position(4,140)a4=140if b4f == 6:servos.position(4,150)a4=150if b4g == 6:servos.position(4,160)a4=160if b4h == 6:servos.position(4,170)a4=170if b4i == 6:servos.position(4,180)a4=180    response = web_page()client.send('HTTP/1.1 200 OK\n')client.send('Content-Type: text/html\n')client.send('Connection: close\n\n')client.sendall(response)client.close()except:pass

http://www.dinnco.com/news/6539.html

相关文章:

  • 如何做收机微网站最新国内重大新闻
  • 南昌有没有做企业网站和公司友情链接大全
  • 怎么用手机做钓鱼软件或者网站口碑营销的案例及分析
  • dedecms小说网站模板信息流广告哪个平台好
  • 珠海品牌网站制作seo网站管理
  • 动漫培训资源网站排名优化seo
  • 豪华网站设计千锋教育前端学费多少
  • 高端网站建设品牌智慧软文发稿平台
  • 国外互联网科技网站中国最新新闻
  • 如何个网站做二维码关键词的分类和优化
  • 石家庄模板做网站百度应用商店
  • 中国空间站完整图全网网站快速排名推广软件
  • 卖货平台有什么软件呢seo领导屋
  • 软件开发培训一般要多少钱重庆seo海洋qq
  • 唐山网站网络科技
  • 自助下单网站怎么做seo怎么推广
  • 永久链接生成器seo店铺描述例子
  • 有肌肉男与小姐姐做床上运动的网站最近的热点新闻
  • 兰州做网站公司es5188淘宝的前100个关键词排名
  • 电脑可以做网站服务器么企业网址怎么注册
  • 毕业设计音乐网站开发背景品牌推广软文案例
  • 铜陵商城网站建设如何做百度搜索推广
  • iis7 网站无法显示该页面58网络推广
  • 做自媒体用到的网站浙江专业网站seo
  • 广告公司网站建设的定位济南新站seo外包
  • 怎么看出网站是dede做的网络营销推广外包平台
  • 专业做室内设计的网站有哪些长沙优化网站哪家公司好
  • 在国内做电商网站需要什么审核营销型网站方案
  • 烟台建网站公司自己做网站的流程
  • 楚雄网站开发cx189独立站seo是什么意思