Search found 3 matches

by Tinayou
02 Aug 2024, 09:48
Forum: General questions
Topic: sim.serialOpen returns -1
Replies: 8
Views: 8449

Re: sim.serialOpen returns -1

I only use the Arduino transmits data from outside source to the PC port, and the script inside CoppeliaSim read and process data. So after I download the Arduino code into the chip, the Arduino IDE only is used to monitor the data to the port. Closing it would not bring any affect to the system ...
by Tinayou
01 Aug 2024, 10:09
Forum: General questions
Topic: sim.serialOpen returns -1
Replies: 8
Views: 8449

Re: sim.serialOpen returns -1

I found my solution luckily. The problem for me is that I ran the Coppelia Sim script with the Arduino IDE serial monitor opening. So the port was detected as "is using". Please make sure that the port you selected in Coppelia Sim is not using in other software.
by Tinayou
31 Jul 2024, 15:57
Forum: General questions
Topic: sim.serialOpen returns -1
Replies: 8
Views: 8449

Re: sim.serialOpen returns -1


My goal is to use serial communication between CoppeliaSim and Arduino to manipulate simulation elements through sensors read by the Arduino.

port = "\\\\.\\COM4"
function sysCall_init()
sim = require('sim')
serialHandle = sim.serialOpen(port, 9600)
print(serialHandle)
pivot = sim.getObject ...