Sha256: 398940260281c92318c2b15ad5128997180afadbd94de314f15552d7e5258334
Contents?: true
Size: 411 Bytes
Versions: 22
Compression:
Stored size: 411 Bytes
Contents
# -*- coding: utf-8 -*- require 'smalruby' init_hardware stage1 = Stage.new(color: 'white') stage1.on(:start) do loop do 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 end
Version data entries
22 entries across 22 versions & 1 rubygems