Sha256: 7c3660895d280ccef338f489a560a226d64c882cc4b58a6487e2a4ffe6e5a288

Contents?: true

Size: 580 Bytes

Versions: 22

Compression:

Stored size: 580 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').color = 'red'
    sleep(1)
    rgb_led_cathode('D3').color = 'green'
    sleep(1)
    rgb_led_cathode('D3').color = 'blue'
    sleep(1)
    rgb_led_cathode('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_cathode.rb
smalruby-0.1.11 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.10-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.10 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.9-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.9 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.8-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.8 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.7-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.7 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.6-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.6 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.5-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.5 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.4-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.4 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.3-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.3 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.2-x86-mingw32 samples/hardware_rgb_led_cathode.rb
smalruby-0.1.2 samples/hardware_rgb_led_cathode.rb