help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave-Arduino-Servo


From: Vicent
Subject: Octave-Arduino-Servo
Date: Wed, 28 Nov 2018 16:14:42 -0600 (CST)

Hi,everyone.
 I'm trying to control a sd90 servo with arduino using octave, but I don't
now what I'm missing.
I have octave 4.2.2 in Ubuntu.   arduino 1.8.6 but not installed only
downloaded but it works well
package octave- arduino 0.3.0 instrument-control 0.3.1 

I can detect the arduino and put digitals pins to on or off but when I try
to use the servo I only get error messages. I don't know why I can't
initialize the servo object. 
This is my testing program and the result in command window:

#testing program arduino-servo
1  pkg load arduino
2  
3  ar = arduino("/dev/ttyACM0","Uno","Libraries","servo")
4
5  % get the pin names
6  pins = ar.availablepins;
7  writeDigitalPin (ar,  "d13", true);
8  #pause (2)
9  value1 = readDigitalPin (ar,  "d13")
10 writeDigitalPin (ar,  "d13", false);
11 #pause (2)
12 value2 = readDigitalPin (ar,  "d13")
13 value3 = readVoltage (ar,  "a0")
14
15 myServo = servo(ar, "d9", "minpulseduration", 1.0e-3, 
"maxpulseduration", 2e-3);
16
17 writePosition (myServo, 0.5);

----------
Result on Command Window
>> provaArduino

ar =
  arduino object with fields of:
    port = /dev/ttyACM0
    board = uno
    libraries = {
      servo
    }
    availablepins = {
      d0 - d13
      a0 - a5
    }
value1 =  1
value2 = 0
value3 =  2.4536
error: sendCommand: failed err=10: msg=Unknown cmdID
error: called from
    sendCommand at line 72 column 5
    servo at line 119 column 3
    provaArduino at line 15 column 9
>>
-------
Thanks for your help



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]