Closed asanebub closed 4 years ago
First - this program was written more than 4 years ago.\ Many ev3dev versions were released during this period.
Some things (obviously tty paths) changed.
I am assuming you are using the ev3dev-strech.
I have just tested it with ev3dev-strech-2019-10-29.
Initial setup (once after boot)
echo dc-motor > /sys/class/lego-port/port4/mode #for output A, otherwise adjust the port number
dmesg | tail #you can see here which number the dc-motor was created with
cat /sys/class/dc-motor/motorX/address # where X is the motor number, make sure the address matches the port
Controlling the motor
Assuming it is the motor0
echo 44 > /sys/class/dc-motor/motor0/duty_cycle_sp
echo run-direct > /sys/class/dc-motor/motor0/command
If it doesn't spin try with -44.
E.g.
echo -44 > /sys/class/dc-motor/motor0/duty_cycle_sp
echo run-direct > /sys/class/dc-motor/motor0/command
It is critical that the motor spins counter-clockwise.
If it doesn't work make sure it is soldered correctly.
See also #1.
I have also just tested it with ev3dev-strech-2019-10-29.
Yes, obviously you are right.
The notation in ev3dev-stretch is tty_ev3-ports:in1
So it will be:
Once after boot:
echo other-uart > /sys/class/lego-port/port0/mode
And to read from lidar:
./xv11test /dev/tty_ev3-ports\:in1
Note that, for this to work it is critical that motor spins CCW.
It worked with ./xv11test /dev/tty_ev3-ports\:in1
Thank you! :)
Hello @bmegli,
I'm trying to test the xv11 lidar-sensor with ev3, like it's mentioned here: https://www.ev3dev.org/docs/tutorials/using-xv11-lidar/:
When I'm doing:
echo other-uart > /sys/class/lego-port/port0/mode
, then there isn't a folder /dev/tty_in1. I just have: tty_ev3-ports:in1Here you can see the output of the commands:
Additionally the motor is not spinning, when I do:
How can I solve these problems?