Sha256: e6f21c7787d646ce2ee696f1b24216ec8db638a57544b0cc5916d5035198509e

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 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: 15..170)
  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.0.3 cookbook/Servo/sweep.rb
wall_e-0.0.2 cookbook/Servo/sweep.rb