LPCXpresso55S69_MRuby/README.md
Yilin Sun f6659c7958 Implemented ADC gem.
Signed-off-by: Yilin Sun <imi415@imi.moe>
2023-03-16 18:42:55 +08:00

674 B

WIP

Implemented features:

# Initialization: Takes a hash with configuration.
led_red   = Machine::GPIO.new(38, {mode: Machine::GPIO::OUTPUT_OD, init: Machine::GPIO::ON})
led_blue  = Machine::GPIO.new(36, {mode: Machine::GPIO::OUTPUT_OD, init: Machine::GPIO::ON})
led_green = Machine::GPIO.new(39, {mode: Machine::GPIO::OUTPUT_OD, init: Machine::GPIO::ON})
led_red.value # Get LED pin input value
led_red.value = Machine::GPIO::OFF # Turn on the LED (Level is reversed)
led_red.off # Same as above
led_red.on # Turn off the LED (Level is reversed)
led_red.toggle # Toggle output
ana_bg = Machine::ADC.new(52) # BandGap
ana_bg.value