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
sleep(0.1)
end
close(bot)
```
### Example: Read the maximum set-point for servo speed
```
using Omnibot
ip = ...
bot = connectomnibot(ip)
println(getmaxspeed(bot))
close(bot)
```
......
......@@ -5,6 +5,8 @@ export getx
export gety
export getz
export gettheta
export getmaxspeed
export setspeed
using Sockets
include("connectomnibot.jl")
......
"""
setspeed(bot::TCPSocket,i::Int,v::Int)
sets the speed of servo `i` to `v`.
# 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.
sets the speed of servo `i::Int` to `v::Int`, where `i` takes values 1,2,3.
"""
function setspeed(bot::TCPSocket,i::Int,v::Int)
msg = 'w'*string(i)*string(v)
......@@ -20,9 +15,9 @@ return ret
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)
fullret = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment