Sha256: 7ce0f458528fe626caf1e93fc51bf82318a76d84a1f82630524904569692d470

Contents?: true

Size: 591 Bytes

Versions: 22

Compression:

Stored size: 591 Bytes

Contents

# -*- coding: utf-8 -*-

DESCRIPTION = <<EOS
RGB LED(アノードコモン)の色を変化させます
EOS

# デジタルの3番、4番、5番、6番ピンにそれぞれR、コモン、G、Bを接続してく
# ださい。

require 'smalruby'

init_hardware

stage1 = Stage.new(color: 'white')

stage1.on(:start) do
  draw_font(string: DESCRIPTION, color: 'black')

  loop do
    rgb_led_anode('D3').color = 'red'
    sleep(1)
    rgb_led_anode('D3').color = 'green'
    sleep(1)
    rgb_led_anode('D3').color = 'blue'
    sleep(1)
    rgb_led_anode('D3').turn_off
    sleep(1)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
smalruby-0.1.11-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.11 samples/hardware_rgb_led_anode.rb
smalruby-0.1.10-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.10 samples/hardware_rgb_led_anode.rb
smalruby-0.1.9-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.9 samples/hardware_rgb_led_anode.rb
smalruby-0.1.8-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.8 samples/hardware_rgb_led_anode.rb
smalruby-0.1.7-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.7 samples/hardware_rgb_led_anode.rb
smalruby-0.1.6-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.6 samples/hardware_rgb_led_anode.rb
smalruby-0.1.5-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.5 samples/hardware_rgb_led_anode.rb
smalruby-0.1.4-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.4 samples/hardware_rgb_led_anode.rb
smalruby-0.1.3-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.3 samples/hardware_rgb_led_anode.rb
smalruby-0.1.2-x86-mingw32 samples/hardware_rgb_led_anode.rb
smalruby-0.1.2 samples/hardware_rgb_led_anode.rb