Joy-it RB-RS485 handleiding
Handleiding
Je bekijkt pagina 4 van 5

Next, you need to download the required additional libraries by
executing the following commands.
sudo apt-get install python3-serial
Once you have downloaded the libraries, you can now try out the two
code examples below or download them here.
Alternatively, you can download and unzip the example using the
following commands:
3.3 Code example transmitter
import serial
# Use this port only when using Raspberry Pi 4 or older
#port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=3.0)
# Use this port only when using Raspberry Pi 5
port = serial.Serial("/dev/tty0", baudrate=9600, timeout=3.0)
print("Starting test...")
while True:
port.write("\r\n RS485-Test".encode('utf-8'))
#rcv = port.read(10)
#port.write(("\r\nYou sent:" + repr(rcv)).encode('utf-8'))
3.4 Code example receiver
import serial
# Use this port only when using Raspberry Pi 4 or older
#port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=3.0)
# Use this port only when using Raspberry Pi 5
port = serial.Serial("/dev/tty0", baudrate=9600, timeout=3.0)
while True:
rcv = port.readline()
print(rcv)
Please note that depending on whether you are using a Raspberry Pi5 or
an older model, you will need to adapt the port in the code accordingly.
To do this, you can refer to the comments in the code example.
wget https://joy-it.net/files/files/Produkte/RB-RS485/RB-RS485-Beispielcodes.zip
unzip RB-RS485-Beispielcodes.zip
Bekijk gratis de handleiding van Joy-it RB-RS485, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.
Productinformatie
| Merk | Joy-it |
| Model | RB-RS485 |
| Categorie | Niet gecategoriseerd |
| Taal | Nederlands |
| Grootte | 1898 MB |
Caratteristiche Prodotto
| Kleur van het product | Black, Blue, Silver |
| Gewicht | 26 g |
| Breedte | 56 mm |
| Diepte | 49 mm |
| Hoogte | 23 mm |





