Sha256: b4495fd33bf942fc920a2ddfe357dfbbc9134d39b6f29f50278cf987aba586b7

Contents?: true

Size: 502 Bytes

Versions: 16

Compression:

Stored size: 502 Bytes

Contents

class FirstSound < ArduinoSketch



output_pin 11, :as => :myTone, :device => :freq_out, :frequency => 100 # frequency required

    def loop
        myTone.disable
        1.upto(400) { |x| tone_out x }   # run up the scale to 4000 Hz in 10 Hz steps
        399.downto(1) { |x| tone_out x } # come back down in 10 Hz steps
        delay 2000
    end

    def tone_out(n)
        myTone.set_frequency 10*n
        myTone.enable
        delay 80
        myTone.disable
        delay 10
    end
    

end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
neo_rad-0.4.0 lib/examples/first_sound.rb
atduskgreg-rad-0.2.5 lib/examples/first_sound.rb
atduskgreg-rad-0.3.0.1 lib/examples/first_sound.rb
atduskgreg-rad-0.3.1 lib/examples/first_sound.rb
madrona-rad-0.2.4 lib/examples/first_sound.rb
madrona-rad-0.2.5 lib/examples/first_sound.rb
madrona-rad-0.2.6 lib/examples/first_sound.rb
madrona-rad-0.2.7 lib/examples/first_sound.rb
madrona-rad-0.3.1.1 lib/examples/first_sound.rb
madrona-rad-0.3.1 lib/examples/first_sound.rb
madrona-rad-0.3.2 lib/examples/first_sound.rb
madrona-rad-0.3.3 lib/examples/first_sound.rb
madrona-rad-0.3.4 lib/examples/first_sound.rb
madrona-rad-0.3.5 lib/examples/first_sound.rb
rad-0.3.0 lib/examples/first_sound.rb
rad-0.2.9 lib/examples/first_sound.rb