Sha256: 1c3cfaad6b94144b562a90b5a65fa72e86819092d97c2a73d8bdd063976ac41a

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

require 'bundler/setup'
require 'wall_e'

WallE::Assembler.build do
  # This example uses a Sparkfun's "Medium" servo.
  # (DGServo S05NF STD http://www.sparkfun.com/products/10333)
  # Using the range 15..170 appears to be the sweet spot for this servo.
  #
  # YMMV especially if you are using a different servo.
  #
  # The Hitec HS-322 (http://amzn.com/B0006O3XEA) has a range of 2..180.
  servo = Servo(9, range: 2..180)
  servo.min

  repeat do

    servo.min if servo.maxed?

    servo.move_to(servo.position + 1)

    delay 0.01
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wall_e-0.1.0 cookbook/Servo/sweep.rb
wall_e-0.0.4 cookbook/Servo/sweep.rb