Sha256: 9aca1f500059f7b13d7c24412083dfcf5d8a5aeb854a1e757b70895bf23487b6

Contents?: true

Size: 584 Bytes

Versions: 48

Compression:

Stored size: 584 Bytes

Contents

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

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

# デジタルの3番、4番、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_cathode('D3').on(color: 'red')
    sleep(1)
    rgb_led_cathode('D3').on(color: 'green')
    sleep(1)
    rgb_led_cathode('D3').on(color: 'blue')
    sleep(1)
    rgb_led_cathode('D3').off
    sleep(1)
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
smalruby-0.1.0-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.0 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.32-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.31-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.31 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.30-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.30 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.29-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.29 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.28-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.28 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.27-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.27 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.26-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.26 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.25-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.25 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.24-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.0.24 samples/hardware_rgb_led_cathode.rb