STM32H750VB_MRB/example/boot.rb

28 lines
514 B
Ruby

i = 0
puts "mRuby v#{RUBY_VERSION} on STM32!\r\n"
2.times do
puts "Hello world #{i}\r\n"
i += 1
puts "MRB Heap usage: #{OSUtil.heap_usage.to_s}\r\n"
OSUtil.sleep_ms(500)
end
begin
puts "#{Gpio}\r\n"
pin = Gpio::Pin.new({:port => 0, :pin => 16}, {:mode => 0, :pull => 0})
puts "#{pin}\r\n"
puts "#{Gpio::Port::A}\r\n"
rescue Exception => e
puts "Exception: #{e.inspect}\r\n"
end
puts "MRB Heap usage: #{OSUtil.heap_usage.to_s}\r\n"
puts "Main script ended.\r\n"