ADEEPT AWR Wheeled Robot Manual page 119

4wd smart robot kit compatible with raspberry pi 4 3 model b+ b, opencv target tracking
Table of Contents

Advertisement

110
tcpSerSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
tcpSerSock.bind(ADDR)
tcpSerSock.listen(5)
'''
Start listening to the client connection, after the client connection is successful, start to receive the information sent
from the client
'''
tcpCliSock, addr = tcpSerSock.accept()
while True:
data = ''
'''
Receive information from the client
'''
data = str(tcpCliSock.recv(BUFSIZ).decode())
if not
data:
continue
'''
Turn on the light if the information content is on
If the information content is off, turn off the light
'''
elif
'on' == data:
for
i
in
range(strip.numPixels()):
strip.setPixelColor(i,
strip.show()
elif
'off' == data:
for
i
in
range(strip.numPixels()):
strip.setPixelColor(i,
strip.show()
'''
Finally print out the received data and start to continue listening to the next message from the client
'''
print(data)
●The program of the client in the PC is as follows:
'''
Import socket library to be used for TCP communication
'''
from
socket
import
*
Color(255, 0,
255))
Color(0, 0,
0))

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?

This manual is also suitable for:

Picar-b

Table of Contents

Save PDF