Class: HelloServos

Inherits:
ArduinoSketch show all
Defined in:
lib/examples/hello_servos.rb

Instance Attribute Summary

Attributes inherited from ArduinoSketch

#pins

Instance Method Summary collapse

Methods inherited from ArduinoSketch

#add, add_to_setup, #array, #assembler, #comment_box, #compose_setup, #define, #delay, #digitalWrite, #formatted_print, #initialize, #input_pin, #input_pins, output_pin, #output_pin, post_process_ruby_to_c_methods, pre_process, #serial_begin

Methods included from ExternalVariableProcessing

#c_type, #check_variable_type, #post_process_arrays, #post_process_vars, #pre_process_vars, #process_external_vars, #translate_variables

Constructor Details

This class inherits a constructor from ArduinoSketch

Instance Method Details

#aObject



45
46
47
48
49
50
# File 'lib/examples/hello_servos.rb', line 45

def a
  pulse_servo servo_1, 1450
  delay 100
  home servo_1
  delay 20
end

#bObject



52
53
54
55
56
57
# File 'lib/examples/hello_servos.rb', line 52

def b
  pulse_servo servo_1, 1350
  delay 100
  home servo_1
  delay 20
end

#cObject



59
60
61
62
63
64
# File 'lib/examples/hello_servos.rb', line 59

def c
  pulse_servo servo_2, 1450
  delay 100
  home servo_2
  delay 20
end

#dObject



66
67
68
69
70
71
# File 'lib/examples/hello_servos.rb', line 66

def d
  pulse_servo servo_2, 1350
  delay 100
  home servo_2
  delay 20
end

#eObject



73
74
75
76
77
78
# File 'lib/examples/hello_servos.rb', line 73

def e
  pulse_servo servo_3, 1500
  delay 100
  home servo_3
  delay 20
end

#home(s) ⇒ Object

center servos



83
84
85
86
# File 'lib/examples/hello_servos.rb', line 83

def home(s)
  pulse_servo s, 1400
  f = s + 0
end

#loopObject

time to go old school



9
10
11
# File 'lib/examples/hello_servos.rb', line 9

def loop
  song_sheet_two
end

#song_sheet_twoObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/examples/hello_servos.rb', line 13

def song_sheet_two
  e
  d
  e
  d 
  c
  d
  d
  c
  b
  c
  b
  a
  e
  a
  e
  a
  e
  a
  b
  c
  b
  c
  d
  d
  c
  d
  e
  d
  e
end