We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 162f84e commit e94e5dbCopy full SHA for e94e5db
components/mruby_component/esp32_build_config.rb
@@ -70,6 +70,7 @@
70
conf.gem :github => "mruby-esp32/mruby-esp32-mqtt"
71
72
conf.gem :github => "mruby-esp32/mruby-esp32-gpio"
73
+ conf.gem :github => "mruby-esp32/mruby-esp32-adc"
74
conf.gem :github => "mruby-esp32/mruby-esp32-ledc"
75
conf.gem :github => "mruby-esp32/mruby-esp32-spi"
76
end
main/examples/adc.rb
@@ -0,0 +1,12 @@
1
+adc1 = ADC.new(ADC::CHANNEL_0, unit: ADC::UNIT_1)
2
+adc2 = ADC.new(ADC::CHANNEL_3, unit: ADC::UNIT_1)
3
+
4
+loop do
5
+ value = adc1.read_raw
6
+ puts "ADC1: #{value}"
7
8
+ value = adc2.read_raw
9
+ puts "ADC2: #{value}"
10
11
+ ESP32::System.delay(1000)
12
+end
0 commit comments