Code Monkey home page Code Monkey logo

Comments (9)

dlech avatar dlech commented on July 30, 2024

The ms-8ch-servo device in /sys/class/lego-sensors/ is the controller itself. And yes the only useful thing there is the battery voltage.

There should also be 8 devices in /sys/class/servo-motor/. These are are used to actually control the motors.

I don't know if the demo has anything implemented for the servo-motor class or not.

from ev3dev-lang.

cho934 avatar cho934 commented on July 30, 2024

I don't see anything.
Thanks for the quick answer. It works like a charm using /sys/class/servo-motor/

For information, we need to use 2 servos and try to finish to build our secondary robot this week-end. The French cup of robotic will occure in mid-May, and I will promote ev3dev ;)

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

There is a servo motor test in ev3dev-lang-test.cpp. It does not do much, just dumps the motor's properties. Does it work for you?

from ev3dev-lang.

cho934 avatar cho934 commented on July 30, 2024

Yes, it works and it shows information about connected servomotors. I'm going to work now on our program in C++ using ev3dev.cpp and I will check if I can add a test to move servos in ev3dev-lang-demo.

from ev3dev-lang.

cho934 avatar cho934 commented on July 30, 2024

I did'nt succeed to drive several servos using ev3dev.h. The code from ev3dev-lang-test just detected only the first servo.
Have you got a small test to show me how to control several servos using ev3dev.h ?
For information, servos are working using shell command on /sys/class/servo-motor/.

from ev3dev-lang.

ddemidov avatar ddemidov commented on July 30, 2024

I don't have any experience with servo motors, but the code in the demo does not specify an output port to use. So its happy with the first servo motor it sees. Did you try to specify an output port, as in

m1 = servo_motor(OUTPUT_A);
m2 = servo_motor(OUTPUT_B);

?

from ev3dev-lang.

cho934 avatar cho934 commented on July 30, 2024

I use January version of ev3dev.
In fact, servo_motor() don't take OUTPUT_X, but the id (0 to 7) of the servo, but it doesn't work.

from ev3dev-lang.

dlech avatar dlech commented on July 30, 2024

The argument for servo_motor is the port name. You can find the port name by reading the port_name attribute. It should be something like in1:mux1.

from ev3dev-lang.

cho934 avatar cho934 commented on July 30, 2024

It's working ! with in[ev3port_name 1-4]:sv[servo ID 1-8]
Example :

servo_motor m_;
m_ = servo_motor("in3:sv1");
m_.set_position(50);

from ev3dev-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.