Sha256: 11c3e1726ace493040ffe150e7beef06016746c419e97f0c08b578854a81efa7
Contents?: true
Size: 395 Bytes
Versions: 48
Compression:
Stored size: 395 Bytes
Contents
# -*- coding: utf-8 -*- require 'smalruby' init_hardware stage1 = Stage.new(color: 'white') stage1.on(:sensor_change, 'A0') do |value| v = sensor('A0').value if 0 <= v && v <= 255 fill(color: 'red') end if 256 <= v && v <= 511 fill(color: 'yellow') end if 512 <= v fill(color: 'blue') end draw_font(string: "センサーの情報:#{v}", color: 'black') end
Version data entries
48 entries across 48 versions & 1 rubygems