Skip to content
Snippets Groups Projects
Commit a150bcdb authored by Felix Agner's avatar Felix Agner
Browse files

bug fixes and cleaning

parent 68119166
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,17 @@ for i = 1:100 ...@@ -28,6 +28,17 @@ for i = 1:100
sleep(0.1) sleep(0.1)
end end
close(bot)
```
### Example: Read the maximum set-point for servo speed
```
using Omnibot
ip = ...
bot = connectomnibot(ip)
println(getmaxspeed(bot))
close(bot) close(bot)
``` ```
......
...@@ -5,6 +5,8 @@ export getx ...@@ -5,6 +5,8 @@ export getx
export gety export gety
export getz export getz
export gettheta export gettheta
export getmaxspeed
export setspeed
using Sockets using Sockets
include("connectomnibot.jl") include("connectomnibot.jl")
......
""" """
setspeed(bot::TCPSocket,i::Int,v::Int) setspeed(bot::TCPSocket,i::Int,v::Int)
sets the speed of servo `i` to `v`. sets the speed of servo `i::Int` to `v::Int`, where `i` takes values 1,2,3.
# Arguments
- `bot::TCPSocket`: the socket-connection to the robot.
- `i::Int`: index of the servo, takes values 1-3.
- `v::Int`: integer servo speed set-point.
""" """
function setspeed(bot::TCPSocket,i::Int,v::Int) function setspeed(bot::TCPSocket,i::Int,v::Int)
msg = 'w'*string(i)*string(v) msg = 'w'*string(i)*string(v)
...@@ -20,9 +15,9 @@ return ret ...@@ -20,9 +15,9 @@ return ret
end end
""" """
setspeeds(bot::TCPSocket,v::Vector{Int}) setspeed(bot::TCPSocket,v::Vector{Int})
Set the speed-setpoint of servos to the values in vector v. Also callable with a vector `v`. Then the set-points are set such that servo 1 gets set-point `v[1]` etc.
""" """
function setspeed(bot::TCPSocket,v::Int) function setspeed(bot::TCPSocket,v::Int)
fullret = "" fullret = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment