summaryrefslogtreecommitdiff
path: root/julia-arduino-master/tools/functions/ServoAttach.jl
blob: a61194f0e64939811f4f1137c16af39816d5a69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
using SerialPorts

function ServoAttach(file_des::SerialPorts.SerialPort, servo_no::Int64)
  println("Initializing servo")
  if servo_no == 1             # for servomotor attached to digital pin 9
    pin = "Sa1"
    write(file_des,pin)
  elseif servo_no == 2         # for servomotor attached to digital pin 10
    pin = "Sa2"
    write(file_des,pin)
  else
    println("Error")
  end
end                            # end function