denko 0.13.1 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build_avr.yml +2 -4
- data/.github/workflows/build_esp32.yml +2 -3
- data/.github/workflows/build_esp8266.yml +2 -3
- data/.github/workflows/build_megaavr.yml +3 -5
- data/.github/workflows/build_ra4m1.yml +57 -0
- data/.github/workflows/build_rp2040.yml +2 -4
- data/.github/workflows/build_sam3x.yml +1 -3
- data/.github/workflows/build_samd.yml +2 -4
- data/CHANGELOG.md +100 -0
- data/DEPS_CLI.md +13 -6
- data/DEPS_IDE.md +14 -7
- data/HARDWARE.md +104 -80
- data/README.md +19 -28
- data/benchmarks/i2c_ssd1306_refresh.rb +79 -0
- data/examples/analog_io/ads1115.rb +57 -0
- data/examples/analog_io/ads1118.rb +8 -9
- data/examples/analog_io/dac_loopback.rb +6 -4
- data/examples/analog_io/input.rb +39 -36
- data/examples/connection/tcp.rb +1 -1
- data/examples/display/hd44780.rb +3 -3
- data/examples/display/ssd1306.rb +1 -1
- data/lib/denko/analog_io/ads1115.rb +61 -0
- data/lib/denko/analog_io/ads1118.rb +10 -120
- data/lib/denko/analog_io/ads111x.rb +123 -0
- data/lib/denko/analog_io/output.rb +2 -1
- data/lib/denko/analog_io.rb +2 -0
- data/lib/denko/behaviors/reader.rb +14 -13
- data/lib/denko/behaviors/subcomponents.rb +2 -2
- data/lib/denko/board/core.rb +1 -1
- data/lib/denko/board/i2c.rb +1 -4
- data/lib/denko/board/led_array.rb +3 -6
- data/lib/denko/board/map.rb +9 -0
- data/lib/denko/board/servo.rb +2 -6
- data/lib/denko/board.rb +32 -20
- data/lib/denko/connection/board_uart.rb +3 -3
- data/lib/denko/connection/flow_control.rb +10 -2
- data/lib/denko/digital_io/output.rb +1 -1
- data/lib/denko/display/hd44780.rb +18 -18
- data/lib/denko/led/seven_segment.rb +18 -19
- data/lib/denko/message.rb +7 -15
- data/lib/denko/pulse_io/ir_transmitter.rb +1 -2
- data/lib/denko/version.rb +1 -1
- data/lib/denko_cli/packages.rb +7 -1
- data/lib/denko_cli/targets.rb +8 -5
- data/lib/denko_cli/usage.txt +8 -4
- data/src/denko_ethernet.ino +15 -23
- data/src/denko_serial.ino +3 -14
- data/src/denko_wifi.ino +72 -52
- data/src/lib/Denko.cpp +14 -6
- data/src/lib/Denko.h +6 -17
- data/src/lib/DenkoCoreIO.cpp +3 -3
- data/src/lib/DenkoDefines.h +73 -19
- data/src/lib/DenkoEEPROM.cpp +9 -1
- data/src/lib/DenkoI2C.cpp +11 -9
- data/src/lib/DenkoLEDArray.cpp +5 -11
- data/test/analog_io/input_test.rb +3 -3
- data/test/analog_io/output_test.rb +1 -1
- data/test/analog_io/potentiometer_test.rb +2 -2
- data/test/behaviors/bus_peripheral_addressed.rb +1 -1
- data/test/behaviors/bus_peripheral_test.rb +1 -1
- data/test/behaviors/callbacks_test.rb +4 -4
- data/test/behaviors/component_test.rb +2 -2
- data/test/behaviors/listener_test.rb +3 -3
- data/test/behaviors/poller_test.rb +3 -3
- data/test/behaviors/reader_test.rb +11 -4
- data/test/behaviors/subcomponents_test.rb +1 -1
- data/test/behaviors/threaded_test.rb +7 -7
- data/test/board/board_test.rb +8 -8
- data/test/board/core_test.rb +12 -12
- data/test/board/eeprom_test.rb +2 -2
- data/test/board/helper_test.rb +0 -4
- data/test/board/i2c_test.rb +5 -5
- data/test/board/infrared_test.rb +1 -1
- data/test/board/message_test.rb +1 -1
- data/test/board/one_wire_test.rb +4 -4
- data/test/board/pulse_test.rb +2 -2
- data/test/board/servo_test.rb +3 -3
- data/test/board/spi_test.rb +3 -3
- data/test/board/tone_test.rb +2 -2
- data/test/connection/serial_test.rb +13 -13
- data/test/digital_io/input_test.rb +7 -7
- data/test/digital_io/output_test.rb +5 -5
- data/test/digital_io/rotary_encoder_test.rb +4 -4
- data/test/display/hd44780_test.rb +11 -1
- data/test/eeprom/built_in_test.rb +1 -1
- data/test/i2c/bus_test.rb +5 -5
- data/test/i2c/peripheral_test.rb +4 -4
- data/test/led/base_test.rb +2 -2
- data/test/led/rgb_test.rb +6 -6
- data/test/led/seven_segment_test.rb +36 -14
- data/test/motor/servo_test.rb +6 -6
- data/test/motor/stepper_test.rb +5 -5
- data/test/one_wire/bus_test.rb +9 -9
- data/test/one_wire/peripheral_test.rb +17 -17
- data/test/pulse_io/buzzer_test.rb +4 -4
- data/test/pulse_io/ir_transmitter_test.rb +2 -2
- data/test/pulse_io/pwm_output_test.rb +4 -4
- data/test/rtc/ds3231_test.rb +4 -4
- data/test/sensor/dht_test.rb +3 -3
- data/test/sensor/ds18b20_test.rb +9 -9
- data/test/spi/bus_test.rb +4 -4
- data/test/spi/input_register_test.rb +8 -8
- data/test/spi/output_register_test.rb +4 -4
- data/test/test_helper.rb +17 -2
- data/test/uart/bitbang_test.rb +3 -3
- metadata +7 -350
- data/vendor/board-maps/.gitignore +0 -56
- data/vendor/board-maps/.gitmodules +0 -21
- data/vendor/board-maps/BoardMap.h +0 -1364
- data/vendor/board-maps/README.md +0 -51
- data/vendor/board-maps/lib/boards_parser.rb +0 -66
- data/vendor/board-maps/lib/header_parser.rb +0 -164
- data/vendor/board-maps/run.rb +0 -47
- data/vendor/board-maps/yaml/0XCB_HELIOS.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S2_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3.yml +0 -29
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_NOPSRAM.yml +0 -29
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_REVTFT.yml +0 -25
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32S3_TFT.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_ESP32_V2.yml +0 -30
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_CAN.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_DVI.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_PROP_MAKER.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_RFM.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_SCORPIO.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_THINKINK.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_FEATHER_RP2040_USB_HOST.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_ESP32.yml +0 -24
- data/vendor/board-maps/yaml/ADAFRUIT_ITSYBITSY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_KB2040_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MACROPAD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_MATRIXPORTAL_ESP32S3.yml +0 -16
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32C3.yml +0 -12
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32S3_NOPSRAM.yml +0 -20
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_ESP32_PICO.yml +0 -27
- data/vendor/board-maps/yaml/ADAFRUIT_QTPY_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_STEMMAFRIEND_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ADAFRUIT_TRINKEYQT_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/ALKS.yml +0 -34
- data/vendor/board-maps/yaml/AMPERKA_WIFI_SLOT.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ADK.yml +0 -24
- data/vendor/board-maps/yaml/AVR_BT.yml +0 -16
- data/vendor/board-maps/yaml/AVR_CIRCUITPLAY.yml +0 -14
- data/vendor/board-maps/yaml/AVR_DUEMILANOVE.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ESPLORA.yml +0 -20
- data/vendor/board-maps/yaml/AVR_ETHERNET.yml +0 -16
- data/vendor/board-maps/yaml/AVR_FIO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_GEMMA.yml +0 -6
- data/vendor/board-maps/yaml/AVR_INDUSTRIAL101.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LEONARDO_ETH.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LILYPAD.yml +0 -16
- data/vendor/board-maps/yaml/AVR_LILYPAD_USB.yml +0 -20
- data/vendor/board-maps/yaml/AVR_LININO_ONE.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MEGA.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MEGA2560.yml +0 -24
- data/vendor/board-maps/yaml/AVR_MICRO.yml +0 -20
- data/vendor/board-maps/yaml/AVR_MINI.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_NANO_EVERY.yml +0 -22
- data/vendor/board-maps/yaml/AVR_NG.yml +0 -16
- data/vendor/board-maps/yaml/AVR_PRO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_ROBOT_CONTROL.yml +0 -22
- data/vendor/board-maps/yaml/AVR_ROBOT_MOTOR.yml +0 -19
- data/vendor/board-maps/yaml/AVR_UNO.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_DEV_ED.yml +0 -16
- data/vendor/board-maps/yaml/AVR_UNO_WIFI_REV2.yml +0 -22
- data/vendor/board-maps/yaml/AVR_YUN.yml +0 -20
- data/vendor/board-maps/yaml/AVR_YUNMINI.yml +0 -20
- data/vendor/board-maps/yaml/AirM2M_CORE_ESP32C3.yml +0 -14
- data/vendor/board-maps/yaml/BEE_DATA_LOGGER.yml +0 -39
- data/vendor/board-maps/yaml/BPI_BIT.yml +0 -9
- data/vendor/board-maps/yaml/BPI_LEAF_S3.yml +0 -31
- data/vendor/board-maps/yaml/BRIDGETEK_IDM2040-7A.yml +0 -48
- data/vendor/board-maps/yaml/BeeMotionS3.yml +0 -40
- data/vendor/board-maps/yaml/Bee_Motion.yml +0 -27
- data/vendor/board-maps/yaml/Bee_Motion_Mini.yml +0 -1
- data/vendor/board-maps/yaml/Bee_S3.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_LORA_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_LTE_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_2040_NFC_RP2040.yml +0 -32
- data/vendor/board-maps/yaml/CHALLENGER_2040_SDRTC_RP2040.yml +0 -36
- data/vendor/board-maps/yaml/CHALLENGER_2040_SUBGHZ_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_UWB_RP2040.yml +0 -39
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_BLE_RP2040.yml +0 -42
- data/vendor/board-maps/yaml/CHALLENGER_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CHALLENGER_NB_2040_WIFI_RP2040.yml +0 -38
- data/vendor/board-maps/yaml/CRABIK_SLOT_ESP32_S3.yml +0 -19
- data/vendor/board-maps/yaml/CYTRON_MAKER_FEATHER_AIOT_S3.yml +0 -26
- data/vendor/board-maps/yaml/CYTRON_MAKER_NANO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CYTRON_MAKER_PI_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/CoreESP32.yml +0 -49
- data/vendor/board-maps/yaml/D1_MINI32.yml +0 -36
- data/vendor/board-maps/yaml/D1_UNO32.yml +0 -28
- data/vendor/board-maps/yaml/DATANOISETV_PICOADK.yml +0 -48
- data/vendor/board-maps/yaml/DENKY.yml +0 -26
- data/vendor/board-maps/yaml/DENKY_PICOV3.yml +0 -26
- data/vendor/board-maps/yaml/DENKY_WROOM32.yml +0 -26
- data/vendor/board-maps/yaml/DEPARTMENT_OF_ALCHEMY_MINIMAIN_ESP32S2.yml +0 -26
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_ESP32_C3.yml +0 -14
- data/vendor/board-maps/yaml/DFROBOT_BEETLE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32E.yml +0 -44
- data/vendor/board-maps/yaml/DFROBOT_FIREBEETLE_2_ESP32S3.yml +0 -38
- data/vendor/board-maps/yaml/DFROBOT_ROMEO_ESP32S3.yml +0 -7
- data/vendor/board-maps/yaml/DPU_ESP32.yml +0 -26
- data/vendor/board-maps/yaml/DYDK.yml +0 -38
- data/vendor/board-maps/yaml/DYDK1A.yml +0 -37
- data/vendor/board-maps/yaml/DYDK1Av2.yml +0 -45
- data/vendor/board-maps/yaml/DYG.yml +0 -20
- data/vendor/board-maps/yaml/DYM.yml +0 -40
- data/vendor/board-maps/yaml/DYMv2.yml +0 -39
- data/vendor/board-maps/yaml/D_Duino_32.yml +0 -29
- data/vendor/board-maps/yaml/ELECTRONICCATS_HUNTERCAT_NFC.yml +0 -44
- data/vendor/board-maps/yaml/ESP320.yml +0 -8
- data/vendor/board-maps/yaml/ESP32C3_DEV.yml +0 -14
- data/vendor/board-maps/yaml/ESP32C3_M1_I_KIT.yml +0 -13
- data/vendor/board-maps/yaml/ESP32S2_DEV.yml +0 -33
- data/vendor/board-maps/yaml/ESP32S2_THING_PLUS.yml +0 -34
- data/vendor/board-maps/yaml/ESP32S2_USB.yml +0 -33
- data/vendor/board-maps/yaml/ESP32S3_CAM_LCD.yml +0 -7
- data/vendor/board-maps/yaml/ESP32S3_DEV.yml +0 -38
- data/vendor/board-maps/yaml/ESP32_DEV.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_DEVKIT_LIPO.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_EVB.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_GATEWAY.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_C.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_E.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_GATEWAY_F.yml +0 -13
- data/vendor/board-maps/yaml/ESP32_IOT_REDBOARD.yml +0 -27
- data/vendor/board-maps/yaml/ESP32_MICROMOD.yml +0 -24
- data/vendor/board-maps/yaml/ESP32_PICO.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_POE.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_POE_ISO.yml +0 -7
- data/vendor/board-maps/yaml/ESP32_S3_BOX.yml +0 -16
- data/vendor/board-maps/yaml/ESP32_S3_USB_OTG.yml +0 -11
- data/vendor/board-maps/yaml/ESP32_THING.yml +0 -27
- data/vendor/board-maps/yaml/ESP32_THING_PLUS.yml +0 -30
- data/vendor/board-maps/yaml/ESP32_THING_PLUS_C.yml +0 -30
- data/vendor/board-maps/yaml/ESP32_WROOM_DA.yml +0 -26
- data/vendor/board-maps/yaml/ESP32_WROVER_KIT.yml +0 -26
- data/vendor/board-maps/yaml/ESP8266_ADAFRUIT_HUZZAH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_AGRUMINO_LEMON_V4.yml +0 -8
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_PRIMO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_STAR_OTTO.yml +0 -7
- data/vendor/board-maps/yaml/ESP8266_ARDUINO_UNOWIFI.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP01.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESP07.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_ESP13.yml +0 -17
- data/vendor/board-maps/yaml/ESP8266_ESP210.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPECTRO_CORE.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP12.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPINO_ESP13.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_ESPRESSO_LITE_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_GENERIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_INVENT_ONE.yml +0 -22
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_NODEMCU_ESP12E.yml +0 -20
- data/vendor/board-maps/yaml/ESP8266_OAK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V1.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_PHOENIX_V2.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SCHIRMILABS_EDUINO_WIFI.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_SONOFF_BASIC.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_S20.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_SV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_SONOFF_TH.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_THING_DEV.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINI.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINILITE.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1MINIPRO.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1R1.yml +0 -25
- data/vendor/board-maps/yaml/ESP8266_WEMOS_D1WROOM02.yml +0 -18
- data/vendor/board-maps/yaml/ESP8266_WIO_LINK.yml +0 -9
- data/vendor/board-maps/yaml/ESP8266_XINABOX_CW01.yml +0 -9
- data/vendor/board-maps/yaml/ESPECTRO32.yml +0 -27
- data/vendor/board-maps/yaml/ESPea32.yml +0 -27
- data/vendor/board-maps/yaml/ESPino32.yml +0 -27
- data/vendor/board-maps/yaml/ET-Board.yml +0 -26
- data/vendor/board-maps/yaml/EXTREMEELEXTRONICS_RC2040.yml +0 -46
- data/vendor/board-maps/yaml/Edgebox-ESP-100.yml +0 -7
- data/vendor/board-maps/yaml/FEATHERS2.yml +0 -33
- data/vendor/board-maps/yaml/FEATHERS2NEO.yml +0 -30
- data/vendor/board-maps/yaml/FEATHERS3.yml +0 -29
- data/vendor/board-maps/yaml/FEATHER_ESP32.yml +0 -28
- data/vendor/board-maps/yaml/FLYBOARD2040_CORE.yml +0 -48
- data/vendor/board-maps/yaml/FRANZININHO_WIFI.yml +0 -33
- data/vendor/board-maps/yaml/FRANZININHO_WIFI_MSC.yml +0 -33
- data/vendor/board-maps/yaml/FROG_ESP32.yml +0 -26
- data/vendor/board-maps/yaml/FUNHOUSE_ESP32S2.yml +0 -22
- data/vendor/board-maps/yaml/GEN4_IOD.yml +0 -9
- data/vendor/board-maps/yaml/GENERIC_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/HEALTHYPI_4.yml +0 -27
- data/vendor/board-maps/yaml/HONEYLEMON.yml +0 -27
- data/vendor/board-maps/yaml/HORNBILL_ESP32_DEV.yml +0 -27
- data/vendor/board-maps/yaml/HORNBILL_ESP32_MINIMA.yml +0 -16
- data/vendor/board-maps/yaml/ILABS_2040_RPICO32_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/IMBRIOS_LOGSENS_V1P1.yml +0 -19
- data/vendor/board-maps/yaml/INTOROBOT_ESP32_DEV.yml +0 -34
- data/vendor/board-maps/yaml/LILYGO_T_DISPLAY_S3.yml +0 -26
- data/vendor/board-maps/yaml/LOLIN32.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN32_LITE.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_C3_MINI.yml +0 -14
- data/vendor/board-maps/yaml/LOLIN_D32.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_D32_PRO.yml +0 -27
- data/vendor/board-maps/yaml/LOLIN_S2_MINI.yml +0 -34
- data/vendor/board-maps/yaml/LOLIN_S2_PICO.yml +0 -34
- data/vendor/board-maps/yaml/LOLIN_S3.yml +0 -32
- data/vendor/board-maps/yaml/LOLIN_S3_MINI.yml +0 -32
- data/vendor/board-maps/yaml/LOLIN_S3_PRO.yml +0 -32
- data/vendor/board-maps/yaml/Lion_Bit_Dev_Board.yml +0 -18
- data/vendor/board-maps/yaml/LoPy.yml +0 -27
- data/vendor/board-maps/yaml/LoPy4.yml +0 -27
- data/vendor/board-maps/yaml/M5STACK_CORES3.yml +0 -8
- data/vendor/board-maps/yaml/M5STACK_Core2.yml +0 -9
- data/vendor/board-maps/yaml/M5STACK_FIRE.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack-Timer-CAM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOM.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_ATOMS3.yml +0 -7
- data/vendor/board-maps/yaml/M5Stack_CoreInk.yml +0 -9
- data/vendor/board-maps/yaml/M5Stack_Core_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/M5Stack_Station.yml +0 -10
- data/vendor/board-maps/yaml/M5Stick_C.yml +0 -10
- data/vendor/board-maps/yaml/MAGTAG29_ESP32S2.yml +0 -21
- data/vendor/board-maps/yaml/MELOPERO_COOKIE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/MELOPERO_SHAKE_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/METRO_ESP32S2.yml +0 -34
- data/vendor/board-maps/yaml/MGBOT_IOTIK32A.yml +0 -27
- data/vendor/board-maps/yaml/MGBOT_IOTIK32B.yml +0 -27
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32DEVKIT.yml +0 -27
- data/vendor/board-maps/yaml/MH_ET_LIVE_ESP32MINIKIT.yml +0 -27
- data/vendor/board-maps/yaml/MICROS2.yml +0 -34
- data/vendor/board-maps/yaml/MOD_WIFI_ESP8266.yml +0 -9
- data/vendor/board-maps/yaml/Metro.yml +0 -8
- data/vendor/board-maps/yaml/NANO32.yml +0 -27
- data/vendor/board-maps/yaml/NANO_RP2040_CONNECT.yml +0 -35
- data/vendor/board-maps/yaml/NEBULAS3.yml +0 -33
- data/vendor/board-maps/yaml/NEKOSYSTEMS_BL2040_MINI.yml +0 -48
- data/vendor/board-maps/yaml/NULLBITS_BIT_C_PRO.yml +0 -48
- data/vendor/board-maps/yaml/Node32s.yml +0 -27
- data/vendor/board-maps/yaml/NodeMCU_32S.yml +0 -27
- data/vendor/board-maps/yaml/ODROID_ESP32.yml +0 -10
- data/vendor/board-maps/yaml/ONEHORSE_ESP32_DEV.yml +0 -24
- data/vendor/board-maps/yaml/OROCA_EDUBOT.yml +0 -33
- data/vendor/board-maps/yaml/PIMORONI_PGA2040.yml +0 -48
- data/vendor/board-maps/yaml/PROS3.yml +0 -28
- data/vendor/board-maps/yaml/PYCOM_GPY.yml +0 -27
- data/vendor/board-maps/yaml/Piranha.yml +0 -16
- data/vendor/board-maps/yaml/Pocket32.yml +0 -27
- data/vendor/board-maps/yaml/QUANTUM.yml +0 -26
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO.yml +0 -48
- data/vendor/board-maps/yaml/RASPBERRY_PI_PICO_W.yml +0 -48
- data/vendor/board-maps/yaml/REDPILL_ESP32S3.yml +0 -32
- data/vendor/board-maps/yaml/RMP.yml +0 -33
- data/vendor/board-maps/yaml/SAMD_CIRCUITPLAYGROUND_EXPRESS.yml +0 -12
- data/vendor/board-maps/yaml/SAMD_MKR1000.yml +0 -20
- data/vendor/board-maps/yaml/SAMD_MKRFox1200.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRGSM1400.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRNB1500.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_MKRVIDOR4000.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRWAN1300.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWAN1310.yml +0 -18
- data/vendor/board-maps/yaml/SAMD_MKRWIFI1010.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_MKRZERO.yml +0 -19
- data/vendor/board-maps/yaml/SAMD_NANO_33_IOT.yml +0 -13
- data/vendor/board-maps/yaml/SAMD_TIAN.yml +0 -15
- data/vendor/board-maps/yaml/SAMD_ZERO.yml +0 -14
- data/vendor/board-maps/yaml/SAM_DUE.yml +0 -26
- data/vendor/board-maps/yaml/SAM_ZERO.yml +0 -15
- data/vendor/board-maps/yaml/SEEED_INDICATOR_RP2040.yml +0 -47
- data/vendor/board-maps/yaml/SEEED_XIAO_RP2040.yml +0 -29
- data/vendor/board-maps/yaml/SOLDERPARTY_RP2040_STAMP.yml +0 -48
- data/vendor/board-maps/yaml/SONOFF_DUALR3.yml +0 -26
- data/vendor/board-maps/yaml/SPARKFUN_PROMICRO_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/SPARKFUN_THINGPLUS_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/STAMP_S3.yml +0 -4
- data/vendor/board-maps/yaml/TAMC_TERMOD_S3.yml +0 -31
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1262.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1268.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1276.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1278.yml +0 -23
- data/vendor/board-maps/yaml/TBEAM_USE_RADIO_SX1280.yml +0 -23
- data/vendor/board-maps/yaml/TBeam.yml +0 -23
- data/vendor/board-maps/yaml/TINYPICO.yml +0 -26
- data/vendor/board-maps/yaml/TINYS2.yml +0 -33
- data/vendor/board-maps/yaml/TINYS3.yml +0 -25
- data/vendor/board-maps/yaml/TTGO-T-OI-PLUS_DEV.yml +0 -11
- data/vendor/board-maps/yaml/TTGO_LoRa32_V1.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_LoRa32_V2.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_LoRa32_v21new.yml +0 -28
- data/vendor/board-maps/yaml/TTGO_T1.yml +0 -27
- data/vendor/board-maps/yaml/TTGO_T7_V13_Mini32.yml +0 -27
- data/vendor/board-maps/yaml/TTGO_T7_V14_Mini32.yml +0 -27
- data/vendor/board-maps/yaml/TWATCH_2020_V1.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_2020_V2.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_2020_V3.yml +0 -10
- data/vendor/board-maps/yaml/TWATCH_BASE.yml +0 -10
- data/vendor/board-maps/yaml/TWatch.yml +0 -10
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver.yml +0 -18
- data/vendor/board-maps/yaml/Trueverit_ESP32_Universal_IoT_Driver_MK_II.yml +0 -18
- data/vendor/board-maps/yaml/UBLOX_NINA_W10.yml +0 -48
- data/vendor/board-maps/yaml/UBLOX_NORA_W10.yml +0 -43
- data/vendor/board-maps/yaml/UPESY_RP2040_DEVKIT.yml +0 -48
- data/vendor/board-maps/yaml/VALTRACK_V4_MFW_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VALTRACK_V4_VTS_ESP32_C3.yml +0 -23
- data/vendor/board-maps/yaml/VIYALAB_MIZU_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/WATCHY.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V10.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V15.yml +0 -7
- data/vendor/board-maps/yaml/WATCHY_V20.yml +0 -7
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_0_96.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_LCD_1_28.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ONE.yml +0 -47
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_PLUS.yml +0 -48
- data/vendor/board-maps/yaml/WAVESHARE_RP2040_ZERO.yml +0 -47
- data/vendor/board-maps/yaml/WESP32.yml +0 -17
- data/vendor/board-maps/yaml/WIDORA_AIR.yml +0 -34
- data/vendor/board-maps/yaml/WIFIDUINO_ESP8266.yml +0 -23
- data/vendor/board-maps/yaml/WIFINFO.yml +0 -20
- data/vendor/board-maps/yaml/WIPY3.yml +0 -27
- data/vendor/board-maps/yaml/WIZNET_5100S_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_5500_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WIZNET_WIZFI360_EVB_PICO.yml +0 -48
- data/vendor/board-maps/yaml/WT32_ETH01.yml +0 -8
- data/vendor/board-maps/yaml/WiFiduino32S3.yml +0 -27
- data/vendor/board-maps/yaml/WiFiduinoV2.yml +0 -27
- data/vendor/board-maps/yaml/Wifiduino32.yml +0 -40
- data/vendor/board-maps/yaml/XIAO_ESP32C3.yml +0 -22
- data/vendor/board-maps/yaml/XIAO_ESP32S3.yml +0 -36
- data/vendor/board-maps/yaml/YD_RP2040.yml +0 -48
- data/vendor/board-maps/yaml/atmegazero_esp32s2.yml +0 -30
- data/vendor/board-maps/yaml/connaxio_espoir.yml +0 -18
- data/vendor/board-maps/yaml/esp32vn_iot_uno.yml +0 -22
- data/vendor/board-maps/yaml/fm_devkit.yml +0 -15
- data/vendor/board-maps/yaml/heltec_wifi_32_lora_V3.yml +0 -31
- data/vendor/board-maps/yaml/heltec_wifi_kit_32.yml +0 -28
- data/vendor/board-maps/yaml/heltec_wifi_kit_32_V3.yml +0 -32
- data/vendor/board-maps/yaml/heltec_wifi_lora_32.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wifi_lora_32_V2.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wireless_stick.yml +0 -27
- data/vendor/board-maps/yaml/heltec_wireless_stick_LITE.yml +0 -27
- data/vendor/board-maps/yaml/openkb.yml +0 -27
- data/vendor/board-maps/yaml/roboheart_hercules.yml +0 -17
- data/vendor/board-maps/yaml/sensesiot_weizen.yml +0 -26
- data/vendor/board-maps/yaml/uPesy_WROOM.yml +0 -27
- data/vendor/board-maps/yaml/uPesy_WROVER.yml +0 -27
- data/vendor/board-maps/yaml/unphone8.yml +0 -32
- data/vendor/board-maps/yaml/unphone9.yml +0 -32
- data/vendor/board-maps/yaml/wifi_kit_8.yml +0 -15
data/HARDWARE.md
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
:green_heart: Full support :yellow_heart: Partial support :heart: Planned. No support yet :question: Works in theory. Untested in real hardware.
|
4
4
|
|
5
|
-
### AVR/MegaAVR Based
|
6
|
-
[![AVR Build Status](https://github.com/denko-rb/denko/actions/workflows/build_avr.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_avr.yml)
|
5
|
+
### AVR/MegaAVR Based Arduino Products (and Clones)
|
6
|
+
[![AVR Build Status](https://github.com/denko-rb/denko/actions/workflows/build_avr.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_avr.yml)
|
7
|
+
[![MegaAVR Build Status](https://github.com/denko-rb/denko/actions/workflows/build_megaavr.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_megaavr.yml)
|
7
8
|
|
8
9
|
| Chip | Status | Products | Notes |
|
9
10
|
| :-------- | :------: | :--------------- |------ |
|
@@ -12,29 +13,33 @@
|
|
12
13
|
| ATmega32u4 | :green_heart: | Leonardo, Micro, Leonardo ETH, Esplora, LilyPad USB |
|
13
14
|
| ATmega1280 | :green_heart: | Mega |
|
14
15
|
| ATmega2560 | :green_heart: | Mega2560, Arduino Mega ADK |
|
15
|
-
| ATmega4809 | :
|
16
|
+
| ATmega4809 | :green_heart: | Nano Every, Uno WiFi Rev2 |
|
16
17
|
|
17
18
|
**Note:** Only USB boards listed. Any board with a supported chip should work, once you can flash it and connect to serial.
|
18
19
|
|
19
20
|
### ARM Based Arduino Products (and Clones)
|
20
|
-
[![SAM3X Build Satus](https://github.com/denko-rb/denko/actions/workflows/build_sam3x.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_sam3x.yml)
|
21
|
+
[![SAM3X Build Satus](https://github.com/denko-rb/denko/actions/workflows/build_sam3x.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_sam3x.yml)
|
22
|
+
[![SAMD Build Satus](https://github.com/denko-rb/denko/actions/workflows/build_samd.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_samd.yml)
|
23
|
+
[![RA4M1 Build Satus](https://github.com/denko-rb/denko/actions/workflows/build_ra4m1.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_ra4m1.yml)
|
21
24
|
|
22
25
|
| Chip | Status | Products | Notes |
|
23
26
|
| :-------- | :------: | :--------------- |------ |
|
24
27
|
| ATSAM3X8E | :yellow_heart: | Due | Native USB port. Tone, and IR Out don't work.
|
25
|
-
| ATSAMD21 | :green_heart: | Zero, M0,
|
26
|
-
| RA4M1 | :
|
28
|
+
| ATSAMD21 | :green_heart: | Zero, M0 Series, Nano 33 IOT, MKR WiFi 1010 | Native USB
|
29
|
+
| RA4M1 | :yellow_heart: | Uno R4 Minima, Uno R4 WiFi | IR and WS2812 libraries don't support this yet
|
27
30
|
|
28
|
-
### Arduino
|
31
|
+
### Arduino Networking
|
29
32
|
|
30
|
-
| Chip | Status |
|
33
|
+
| Chip | Status | Products | Notes |
|
31
34
|
| :-------- | :------: | :--------------- |------ |
|
32
35
|
| Wiznet W5100/5500 | :green_heart: | Ethernet Shield | Wired Ethernet for Uno/Mega pin-compatibles
|
33
|
-
| HDG204 + AT32UC3 | :question: | WiFi Shield |
|
34
|
-
| ATWINC1500 | :
|
36
|
+
| HDG204 + AT32UC3 | :question: | WiFi Shield | Compiles, but no hardware
|
37
|
+
| ATWINC1500 | :green_heart: | MKR1000, WiFi Shield 101 | #define WIFI_101 for shield. Automatic for MKR1000
|
38
|
+
| u-blox NINA-W102 | :question: | Uno WiFi Rev 2, MKR WiFi 1010, Nano 33 IOT | Should work. No hardware
|
35
39
|
|
36
|
-
### Espressif Chips with Built-In
|
37
|
-
[![ESP8266 Build Status](https://github.com/denko-rb/denko/actions/workflows/build_esp8266.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_esp8266.yml)
|
40
|
+
### Espressif Chips with Built-In Wi-Fi
|
41
|
+
[![ESP8266 Build Status](https://github.com/denko-rb/denko/actions/workflows/build_esp8266.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_esp8266.yml)
|
42
|
+
[![ESP32 Build Status](https://github.com/denko-rb/denko/actions/workflows/build_esp32.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/build_esp32.yml)
|
38
43
|
|
39
44
|
| Chip | Status | Board Tested | Notes |
|
40
45
|
| :-------- | :------: | :--------------- |------ |
|
@@ -52,12 +57,12 @@
|
|
52
57
|
|
53
58
|
| Chip | Status | Board Tested | Notes |
|
54
59
|
| :-------- | :------: | :--------------- |------ |
|
55
|
-
|
|
60
|
+
| RP2040 | :green_heart: | Raspberry Pi Pico (W) | WiFi only on W version. No WS1812 LED support.
|
56
61
|
|
57
62
|
# Single Board Computers
|
58
63
|
|
59
64
|
### Raspberry Pi Single Board Computers
|
60
|
-
**Note:** See the [denko-piboard](https://github.com/denko-rb/denko-piboard) extension to this gem. It uses the peripheral classes from this gem, but swaps out `Board` for `PiBoard`, which uses the Raspberry Pi's built-in
|
65
|
+
**Note:** See the [denko-piboard](https://github.com/denko-rb/denko-piboard) extension to this gem. It uses the peripheral classes from this gem, but swaps out `Board` for `PiBoard`, which uses the Raspberry Pi's built-in GPIO interface. This is still a work-in-progress.
|
61
66
|
|
62
67
|
| Chip | Status | Products | Notes |
|
63
68
|
| :-------- | :------: | :--------------- |------ |
|
@@ -71,114 +76,125 @@
|
|
71
76
|
|
72
77
|
:green_heart: Full support :yellow_heart: Partial support :heart: Planned. No support yet
|
73
78
|
|
74
|
-
###
|
75
|
-
|
76
|
-
| Name | Status | Component Class
|
77
|
-
| :--------------- | :------: |
|
78
|
-
| Digital
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| Analog Out (DAC) | :green_heart: | `AnalogIO::Output`
|
82
|
-
|
|
83
|
-
|
|
79
|
+
### Interfaces
|
80
|
+
|
81
|
+
| Name | Status | HW/SW | Component Class | Notes |
|
82
|
+
| :--------------- | :------: | :--- | :-------------- | :---- |
|
83
|
+
| Digital In | :green_heart: | H | `DigitalIO::Input` | 1ms - 128ms (4ms default) listen, poll, or read
|
84
|
+
| Analog In (ADC) | :green_heart: | H | `AnalogIO::Input` | 1ms - 128ms (16ms default) listen, poll, or read
|
85
|
+
| Digital Out | :green_heart: | H | `DigitalIO::Output` |
|
86
|
+
| Analog Out (DAC) | :green_heart: | H | `AnalogIO::Output` | Only SAM3X, SAMD21, RA4M1, ESP32, ESP32-S2
|
87
|
+
| PWM Out | :green_heart: | H | `PulseIO::PWMOutput` |
|
88
|
+
| Servo/ESC PWM | :green_heart: | H | See Motor table | Uses PWM
|
89
|
+
| Tone Out (Square Wave)| :green_heart: | H | `PulseIO::Buzzer` | Except SAM3X. Uses PWM
|
90
|
+
| I2C | :green_heart: | H | `I2C::Bus` | Predetermined pins from IDE
|
91
|
+
| I2C Bit Bang | :heart: | S | `I2C::BitBang` | Any pins
|
92
|
+
| SPI | :green_heart: | H | `SPI::Bus` | Predetermined pins from IDE
|
93
|
+
| SPI Bit Bang | :green_heart: | S | `SPI::BitBang` | Any pins
|
94
|
+
| UART | :green_heart: | H | `UART::Hardware` | Except Atmega328, ATmega168
|
95
|
+
| UART Bit Bang | :green_heart: | S | `UART::BitBang` | Only ATmega328, ATmega168
|
96
|
+
| Maxim OneWire | :green_heart: | S | `OneWire::Bus` | No overdrive
|
97
|
+
| Infrared Emitter | :green_heart: | S | `PulseIO::IRTransmitter` | Except SAM3X, RA4M1
|
98
|
+
| Infrared Receiver | :heart: | S | `PulseIO::IRReceiver` | Doable with existing library
|
99
|
+
| WS2812 | :green_heart: | S | See LED table | Except RP2040, RA4M1
|
100
|
+
| ESP32-PCNT | :heart: | H | - | Only ESP32. Pulse counter (for encoders)
|
101
|
+
| ESP32-MCPWM | :heart: | H | - | Only ESP32. Motor control PWM
|
84
102
|
|
85
103
|
**Note:** When listening, the board checks the pin's value every **_2^n_** milliseconds (**_n_** from **_0_** to **_7_**), without further commands.
|
86
104
|
Polling and reading follow a call and response pattern.
|
87
105
|
|
88
|
-
###
|
89
|
-
|
90
|
-
| Name | Status | SW/HW | Component Class | Notes |
|
91
|
-
| :--------------- | :------: | :-------- | :--------------- |------ |
|
92
|
-
| I2C | :green_heart: | Hardware | `I2C::Bus` | Hardware I2C on predefined pins
|
93
|
-
| SPI | :green_heart: | Hardware | `SPI::Bus` | Hardware SPI on prefedined pins
|
94
|
-
| SPI Bit Bang | :green_heart: | Software | `SPI::BitBang` | Bit Bang SPI on any pins
|
95
|
-
| UART | :green_heart: | Hardware | `UART::Hardware` | R/W support for UART1..3 when available
|
96
|
-
| UART Bit Bang | :green_heart: | Software | `UART::BitBang` | R/W support for a single UART. Only ATmega chips
|
97
|
-
| Maxim OneWire | :green_heart: | Software | `OneWire::Bus` | No overdrive support
|
98
|
-
| Infrared Emitter | :green_heart: | Software | `PulseIO::IRTransmitter` | Library on Board
|
99
|
-
| Infrared Receiver| :heart: | Software | `PulseIO::IRReceiver` | Doable with existing library
|
100
|
-
|
101
|
-
### Generic Peripherals
|
106
|
+
### Basic Input/Output
|
102
107
|
|
103
108
|
| Name | Status | Interface | Component Class | Notes |
|
104
109
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
105
|
-
| Board EEPROM | :green_heart: | Built-In | `EEPROM::BuiltIn` | Not all boards have EEPROM
|
106
|
-
| Led | :green_heart: | Digi/Ana Out | `LED::Base` |
|
107
|
-
| RGBLed | :green_heart: | Digi/Ana Out | `LED::RGB` |
|
108
|
-
| Relay | :green_heart: | Digital Out | `DigitalIO::Relay` |
|
109
|
-
| 7 Segment Display| :yellow_heart: | Digital Out | `LED::SevenSegment` | No decimal point
|
110
110
|
| Button | :green_heart: | Digital In | `DigitalIO::Button` |
|
111
111
|
| Rotary Encoder | :green_heart: | Digital In | `DigitalIO::RotaryEncoder` | Listens every 1ms
|
112
|
-
| PIR Sensor | :yellow_heart: | Digital In | `DigitalIO::Input` | Needs class. HC-SR501
|
113
|
-
| Analog Sensor | :green_heart: | Analog In | `AnalogIO::Sensor` |
|
114
112
|
| Potentiometer | :green_heart: | Analog In | `AnalogIO::Potentiometer` | Smoothing on by default
|
115
|
-
|
|
116
|
-
| Input Register | :green_heart: | SPI | `SPI::InputRegister` | Tested on CD4021B
|
117
|
-
| Output Register | :green_heart: | SPI | `SPI::OutputRegister` | Tested on 74HC595
|
118
|
-
|
119
|
-
**Note:** Most Digital In and Out peripherals can be used seamlessley through Input and Output Registers respectively.
|
113
|
+
| Relay | :green_heart: | Digital Out | `DigitalIO::Relay` |
|
120
114
|
|
121
|
-
###
|
115
|
+
### LEDs
|
122
116
|
|
123
|
-
| Name
|
124
|
-
| :---------------
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
| Name | Status | Interface | Component Class | Notes |
|
118
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
119
|
+
| LED | :green_heart: | Digi/Ana Out | `LED::Base` |
|
120
|
+
| RGB LED | :green_heart: | Digi/Ana Out | `LED::RGB` |
|
121
|
+
| 7 Segment Display | :yellow_heart: | Digital Out | `LED::SevenSegment` | No decimal point
|
122
|
+
| TM1637 | :heart: | BitBang SPI | `LED::TM1637` | 4x 7 Segment + Colon
|
123
|
+
| Neopixel / WS2812B | :yellow_heart: | Adafruit Library | `LED::WS2812` | Not working on RP2040
|
124
|
+
| Dotstar / APA102 | :green_heart: | SPI | `LED::APA102` |
|
129
125
|
|
130
126
|
### Displays
|
131
127
|
|
132
128
|
| Name | Status | Interface | Component Class | Notes |
|
133
129
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
134
|
-
| HD44780 LCD | :green_heart: | Digital Out, Output Register | `Display::HD44780` |
|
130
|
+
| HD44780 LCD | :green_heart: | Digital Out, Output Register | `Display::HD44780` |
|
135
131
|
| SSD1306 OLED | :yellow_heart: | I2C | `Display::SSD1306` | 1 font, some graphics
|
136
132
|
|
137
|
-
###
|
133
|
+
### Sound
|
134
|
+
|
135
|
+
| Name | Status | Interface | Component Class | Notes |
|
136
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
137
|
+
| Piezo Buzzer | :green_heart: | Tone Out | `PulseIO::Buzzer` | Frequency > 30Hz
|
138
|
+
|
139
|
+
### Motors / Motor Drivers
|
138
140
|
|
139
|
-
| Name
|
140
|
-
| :---------------
|
141
|
-
|
|
142
|
-
|
|
141
|
+
| Name | Status | Interface | Component Class | Notes |
|
142
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
143
|
+
| Generic Hobby Servo | :green_heart: | Servo/ESC PWM | `Motor::Servo` | Max depends on PWM channel count
|
144
|
+
| Generic ESC | :yellow_heart: | Servo/ESC PWM | `Motor::Servo` | Works. Needs its own class.
|
145
|
+
| PCA9685 | :heart: | I2C | `PulseIO::PCA9685` | 16ch 12-bit PWM for servo or LED
|
146
|
+
| L298N | :green_heart: | Digi + PWM Out | `Motor::L298` | H-Bridge DC motor driver
|
147
|
+
| A3967 | :green_heart: | Digital Out | `Motor::Stepper` | 1ch microstepper (EasyDriver)
|
148
|
+
| TMC2209 | :heart: | - | - | 1ch silent stepper driver
|
143
149
|
|
144
150
|
### I/O Expansion
|
145
151
|
|
146
152
|
| Name | Status | Interface | Component Class | Notes |
|
147
153
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
154
|
+
| Input Register | :green_heart: | SPI | `SPI::InputRegister` | Tested on CD4021B
|
155
|
+
| Output Register | :green_heart: | SPI | `SPI::OutputRegister`| Tested on 74HC595
|
148
156
|
| PCF8574 Expander | :heart: | I2C | `DigitalIO::PCF8574` | 8ch bi-directional digital I/O
|
149
|
-
|
|
150
|
-
|
|
157
|
+
| ADS1100 ADC | :heart: | I2C | `AnalogIO::ADS1100` | 15-bit +/- 1ch ADC
|
158
|
+
| ADS1115 ADC | :green_heart: | I2C | `AnalogIO::ADS1115` | 15-bit +/- 4ch ADC. Comparator not implemented.
|
159
|
+
| ADS1118 ADC | :green_heart: | SPI | `AnalogIO::ADS1118` | 15-bit +/- 4ch ADC + temperature
|
151
160
|
| PCF8591 ADC/DAC | :heart: | I2C | `AnalogIO::PCF8591` | 4ch ADC + 1ch DAC, 8-bit resolution
|
161
|
+
| MCP4725 DAC | :heart: | I2C | `AnalogIO::MCP4275` | 1ch 12-bit DAC
|
152
162
|
|
153
163
|
### Environmental Sensors
|
154
164
|
|
155
165
|
| Name | Status | Interface | Component Class | Notes |
|
156
166
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
157
|
-
| DHT 11/21/22 | :green_heart: | Digi In/Out | `Sensor::DHT` | Temp/RH
|
158
167
|
| DS18B20 | :green_heart: | OneWire | `Sensor::DS18B20` | Temp
|
168
|
+
| DHT 11/21/22 | :green_heart: | Digi In/Out | `Sensor::DHT` | Temp/RH
|
169
|
+
| SHT30 | :heart: | I2C | `Sensor::SHT30` | Temp/RH
|
170
|
+
| QMP6988 | :heart: | I2C | `Sensor::QMP6988` | Pressure
|
159
171
|
| BME280 | :green_heart: | I2C | `Sensor::BME280` | Temp/RH/Press
|
160
172
|
| BMP280 | :green_heart: | I2C | `Sensor::BMP280` | Temp/Press
|
161
|
-
| HTU21D | :green_heart: | I2C | `Sensor::HTU21D` | Temp/RH.
|
162
|
-
| HTU31D | :
|
173
|
+
| HTU21D | :green_heart: | I2C | `Sensor::HTU21D` | Temp/RH. User register read not implemented.
|
174
|
+
| HTU31D | :green_heart: | I2C | `Sensor::HTU31D` | Temp/RH. Diagnostic read not implemented.
|
163
175
|
| AHT10/15 | :green_heart: | I2C | `Sensor::AHT10` | Temp/RH. Always uses calibrated mode.
|
164
|
-
| AHT20/21/25 | :green_heart: | I2C | `Sensor::AHT20` | Temp/RH. Always uses calibrated mode
|
165
|
-
| MAX31850 | :heart: | OneWire | `Sensor::MAX31850` | Thermocouple Amplifier
|
176
|
+
| AHT20/21/25 | :green_heart: | I2C | `Sensor::AHT20` | Temp/RH. Always uses calibrated mode + CRC.
|
166
177
|
| ENS160 | :heart: | I2C | `Sensor::ENS160` | CO2e/TVOC/AQI
|
167
178
|
| AGS02MA | :heart: | I2C | `Sensor::AGS02MA` | TVOC
|
179
|
+
| MAX31850 | :heart: | OneWire | `Sensor::MAX31850` | Thermocouple Amplifier
|
168
180
|
|
169
181
|
### Light Sensors
|
170
182
|
|
171
|
-
| Name | Status | Interface
|
172
|
-
| :--------------- | :------: | :--------
|
173
|
-
|
|
183
|
+
| Name | Status | Interface | Component Class | Notes |
|
184
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
185
|
+
| BH1750 | :heart: | Digital In | `Sensor::BH1750` | Ambient Light
|
186
|
+
| HC-SR501 | :yellow_heart: | Digital In | `DigitalIO::Input` | PIR. Needs class: `Sensor::HC-SR501`
|
187
|
+
| AS312 | :heart: | I2C | `Sensor::AS312` | PIR
|
188
|
+
| APDS9960 | :heart: | I2C | `Sensor::APDS9960` | Proximity, RGB, Gesture
|
174
189
|
|
175
190
|
### Distance Sensors
|
176
191
|
|
177
|
-
| Name | Status | Interface
|
178
|
-
| :--------------- | :------: | :--------
|
179
|
-
| HC-SR04 | :heart: |
|
180
|
-
|
|
181
|
-
|
|
192
|
+
| Name | Status | Interface | Component Class | Notes |
|
193
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
194
|
+
| HC-SR04 | :heart: | Digi In/Out | `Sensor::HCSR04` | Ultrasonic, 20-4000mm
|
195
|
+
| RCWL-9620 | :heart: | I2C | `Sensor::RCWL9260` | Ultrasonic, 20-4500mm
|
196
|
+
| VL53L0X | :heart: | I2C | `Sensor::VL53L0X` | Laser, 30 - 1000mm
|
197
|
+
| GP2Y0E03 | :heart: | I2C | `Sensor::GP2Y0E03` | Infrared, 40 - 500mm
|
182
198
|
|
183
199
|
### Motion Sensors
|
184
200
|
|
@@ -187,16 +203,24 @@ Polling and reading follow a call and response pattern.
|
|
187
203
|
| ADXL345 | :heart: | I2C | `Sensor::ADXL345` | 3-axis Accelerometer
|
188
204
|
| IT3205 | :heart: | I2C | `Sensor::IT3205` | 3-axis Gyroscope
|
189
205
|
| HMC5883L | :heart: | I2C | `Sensor::HMC5883L` | 3-axis Compass
|
206
|
+
| MPU6886 | :heart: | I2C | `Sensor::MPU6886` | 3-axis Gyro + Accel
|
190
207
|
|
191
|
-
### Real Time
|
208
|
+
### Real Time Clocks
|
192
209
|
|
193
210
|
| Name | Status | Interface | Component Class | Notes |
|
194
211
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
195
212
|
| DS1302 | :heart: | I2C | `RTC::DS1302` |
|
196
|
-
|
|
213
|
+
| DS3231 | :green_heart: | I2C | `RTC::DS3231` | Alarms not implemented
|
214
|
+
|
215
|
+
### GPS
|
216
|
+
|
217
|
+
| Name | Status | Interface | Component Class | Notes |
|
218
|
+
| :--------------- | :------: | :-------- | :--------------- |------ |
|
219
|
+
| GT-U7 | :heart: | UART | - |
|
197
220
|
|
198
221
|
### Miscellaneous
|
199
222
|
|
200
223
|
| Name | Status | Interface | Component Class | Notes |
|
201
224
|
| :--------------- | :------: | :-------- | :--------------- |------ |
|
225
|
+
| Board EEPROM | :green_heart: | Built-In | `EEPROM::BuiltIn` | Arduino ARM boards have no EEPROM
|
202
226
|
| MFRC522 | :heart: | SPI/I2C | `DigitalIO::MFRC522` | RFID tag reader / writer
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Denko 0.13.
|
1
|
+
# Denko 0.13.3 [![Test Status](https://github.com/denko-rb/denko/actions/workflows/ruby.yml/badge.svg)](https://github.com/denko-rb/denko/actions/workflows/ruby.yml)
|
2
2
|
### Ruby Meets Microcontrollers
|
3
3
|
Denko gives you a high-level Ruby interface to low-level hardware, without writing microcontroller code. Use LEDs, buttons, sensors and more, just as easily as any Ruby object:
|
4
4
|
|
@@ -14,35 +14,31 @@ button.down do
|
|
14
14
|
end
|
15
15
|
```
|
16
16
|
|
17
|
-
Denko doesn't run Ruby on the microcontroller (see [mruby-denko](#mruby-denko)
|
17
|
+
Denko doesn't run Ruby on the microcontroller (see [mruby-denko](#mruby-denko)). It runs custom Arduino firmware to expose its I/O interfaces over a socket. You run Ruby on your computer and talk to it. The microcontroller, and anything connected to it, map directly to Ruby objects. You get to think about your hardware and appplication logic, not everything in between.
|
18
18
|
|
19
|
-
High-level abstraction in Ruby makes hardware classes easy to implement, with intuitive interfaces. They multitask a single core microcontroller, with thread-safe state, and callbacks for inputs
|
20
|
-
|
21
|
-
Each peripheral connected to your microcontroller(s) maps to a Ruby object you can use directly. You get to think about your hardware and appplication logic, not everything in between.
|
19
|
+
High-level abstraction in Ruby makes hardware classes easy to implement, with intuitive interfaces. They multitask a single core microcontroller, with thread-safe state, and callbacks for inputs. If you need more I/O, integration is seamless; connect another board and instantiate it in Ruby.
|
22
20
|
|
23
21
|
### Supported Hardware
|
24
22
|
|
25
23
|
Full list of supported mircocontroller platforms, interfaces, and peripherals is located [here](HARDWARE.md).
|
26
24
|
|
27
25
|
##### denko-piboard
|
28
|
-
There's an add-on
|
26
|
+
There's an add-on in development, [denko-piboard](https://github.com/denko-rb/denko-piboard), which supports the Raspberry Pi's built in GPIO pins, as `Denko::PiBoard`, class-compatible with `Denko::Board`. Connect peripherals directly to the Pi, with no microcontroller between, then use the peripheral classes from this gem.
|
29
27
|
|
30
28
|
##### mruby-denko
|
31
29
|
A solo Raspberry Pi (or other small SBC + microcontroller) is a great standalone setup if your project needs the compute power anyway, but what if you don't? Why not run Ruby on the microcontroller itself?
|
32
30
|
|
33
|
-
That's the goal of [mruby-denko](https://github.com/denko-rb/mruby-denko)
|
31
|
+
That's the goal of [mruby-denko](https://github.com/denko-rb/mruby-denko): write mruby on the ESP32, using peripheral classes as close to this gem as possible. Still early in development, so limited features, but already usable.
|
34
32
|
|
35
33
|
## Getting Started
|
36
34
|
|
37
|
-
**Note:** If using
|
35
|
+
**Note:** If using Windows, you can follow the Mac/Linux instructions in WSL, but it is not recommended. Serial (COM port) forwarding isn't working on WSL2, which means you can't communicate with the board. There are workarounds, and it might work on WSL1, but the [RubyInstaller for Windows](https://rubyinstaller.org/) and Arduino IDE are recommended instead. A Linux virtual machine with USB passthrough works too.
|
38
36
|
|
39
37
|
#### 1. Install the Gem
|
40
38
|
```shell
|
41
39
|
gem install denko
|
42
40
|
```
|
43
41
|
|
44
|
-
Before using the microcontroller in Ruby, we need to flash it with the denko firmware (or "sketch" in Arduino lingo). This is needed **once** for each board, but future versions may need reflashing to add functionality.
|
45
|
-
|
46
42
|
#### 2. Install the Arduino IDE OR CLI
|
47
43
|
|
48
44
|
Get the Arduino IDE [here](http://arduino.cc/en/Main/Software) for a graphical interface (recommended for Windows), or use the command line interface from [here](https://github.com/arduino/arduino-cli/releases), or Homebrew.
|
@@ -54,30 +50,22 @@ brew install arduino-cli
|
|
54
50
|
```
|
55
51
|
|
56
52
|
#### 3. Install Arduino Dependencies
|
57
|
-
Denko uses Arduino cores, which
|
53
|
+
Denko uses Arduino cores, which support different microcontrollers, and a few libraries. Install only the ones for your microcontroller, or install everything. There are no conflcits. Instructions:
|
58
54
|
* [Install Dependencies in IDE](DEPS_IDE.md)
|
59
55
|
* [Install Dependencies in CLI](DEPS_CLI.md)
|
60
56
|
|
61
57
|
#### 4. Generate the Arduino Sketch
|
62
58
|
The `denko` command is included with the gem. It will make the Arduino sketch folder for you, and configure it.
|
63
59
|
|
64
|
-
**
|
65
|
-
```shell
|
66
|
-
denko sketch serial
|
67
|
-
```
|
68
|
-
|
69
|
-
**For ESP8266, Serial over USB:**
|
60
|
+
**Example for ESP32 target on both serial and Wi-Fi:**
|
70
61
|
```shell
|
71
|
-
denko sketch serial --target
|
72
|
-
```
|
73
|
-
|
74
|
-
**For ESP8266 or ESP32 over WiFi (2.4Ghz and DHCP Only):**
|
75
|
-
```shell
|
76
|
-
denko sketch wifi --target esp8266 --ssid YOUR_SSID --password YOUR_PASSWORD
|
62
|
+
denko sketch serial --target esp32
|
77
63
|
denko sketch wifi --target esp32 --ssid YOUR_SSID --password YOUR_PASSWORD
|
78
|
-
```
|
79
64
|
|
80
|
-
|
65
|
+
# For more options
|
66
|
+
denko targets
|
67
|
+
```
|
68
|
+
**Note:** Boards flashed with a Wi-Fi or Ethernet sketch will [listen for a TCP connection](examples/connection/tcp.rb), but fall back to Serial when there is none active.
|
81
69
|
|
82
70
|
#### 5a. IDE Flashing
|
83
71
|
|
@@ -89,6 +77,7 @@ denko sketch wifi --target esp32 --ssid YOUR_SSID --password YOUR_PASSWORD
|
|
89
77
|
**Troubleshooting:**
|
90
78
|
* If your serial port is in the list, but the board is wrong, select the serial port anyway, then you will be asked to manually select a board.
|
91
79
|
* If your board doesn't show up at all, make sure it is connected properly. Try disconnecting and reconnecting, use a different USB port or cable, or press the reset button after plugging it in.
|
80
|
+
* Some boards may be in a state where you have to hold their "boot" button while cycling power (reconnect or reset) for them to enter firmware update mode. Eg. Raspberry Pi Pico, ESP32-S2/S3.
|
92
81
|
|
93
82
|
#### 5b. CLI Flashing
|
94
83
|
|
@@ -139,9 +128,11 @@ Most boards have a regular LED on-board. Test it with the [blink](examples/led/b
|
|
139
128
|
|
140
129
|
#### More Examples
|
141
130
|
|
142
|
-
|
143
|
-
|
144
|
-
-
|
131
|
+
**Note:** This gem was renamed from `dino` to `denko`. Some of these examples use the old name.
|
132
|
+
|
133
|
+
- Try [Getting Started with Arduino and Dino](http://tutorials.jumpstartlab.com/projects/arduino/introducing_arduino.html) from [Jumpstart Lab](http://jumpstartlab.com) (_ignore old install instructions_).
|
134
|
+
- An example [rails app](https://github.com/austinbv/dino_rails_example) using Dino and Pusher.
|
135
|
+
- For a Sinatra example, look at the [site](https://github.com/austinbv/dino_cannon) used to shoot the cannon at RubyConf2012.
|
145
136
|
|
146
137
|
## Explanatory Talks
|
147
138
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#
|
2
|
+
# Repeatedly writes filled and empty frames to the OLED
|
3
|
+
# Calculates frames per second. Higher is better.
|
4
|
+
#
|
5
|
+
# RESULTS:
|
6
|
+
# July 6 2023 | i7 8700k CPU | CRuby 3.2.1 | 100 frames | 1 Mhz I2C frequency | Average of 3 runs
|
7
|
+
#
|
8
|
+
# Arduino Uno R3 : 5.3 fps (ATmega16u2 UART bridge @ 115200, no I2C level shifter)
|
9
|
+
# Arduino Uno R3 : 7.1 fps (ATmega16u2 UART bridge @ 230400, no I2C level shifter)
|
10
|
+
# Arduino Leonardo : 12.9 fps (native USB, no I2C level shifter)
|
11
|
+
# Arduino Due : 43.0 fps (native USB)
|
12
|
+
# Arduino Due : 7.9 fps (programming USB @ 115200)
|
13
|
+
# Arduino Zero : 28.6 fps (native USB)
|
14
|
+
# Arduino Zero : 9.4 fps (programming USB @ 115200)
|
15
|
+
# Arduino Zero : 13.6 fps (programming USB @ 230400)
|
16
|
+
# ESP8266 (Node MCU) : 9.9 fps (Silicon Labs UART bridge @ 115200)
|
17
|
+
# ESP8266 (Node MCU) : 19.7 fps (Silicon Labs UART bridge @ 230400)
|
18
|
+
# ESP32 V1 : 9.8 fps (Silicon Labs UART bridge @ 115200)
|
19
|
+
# ESP32 V1 : 19.4 fps (Silicon Labs UART bridge @ 230400)
|
20
|
+
# ESP32-S3 : 58.8 fps (native USB)
|
21
|
+
# Raspberry Pi Pico W : 36.4 fps (native USB)
|
22
|
+
#
|
23
|
+
# July 15 2023 | i7 8700k CPU | CRuby 3.2.1 | 100 frames | 1 Mhz I2C frequency | Average of 3 runs
|
24
|
+
#
|
25
|
+
# Arduino Uno R4 WiFi : 7.5 fps (USB through ESP32-S3 @ 115200, 32-byte I2C limit, no I2C level shifter)
|
26
|
+
# Arduino Uno R4 WiFi : 7.8 fps (USB through ESP32-S3 @ 230400, 32-byte I2C limit, no I2C level shifter)
|
27
|
+
#
|
28
|
+
# August 13 2023 | i7 8700k CPU | CRuby 3.2.1 | 100 frames | 1 Mhz I2C frequency | Average of 3 runs
|
29
|
+
#
|
30
|
+
# Arduino Nano Every : 9.2 fps (USB through ATSAMD11 @ 115200, 128-byte I2C limit, no I2C level shifter)
|
31
|
+
# Arduino Nano Every : 13.0 fps (USB through ATSAMD11 @ 230400, 128-byte I2C limit, no I2C level shifter)
|
32
|
+
#
|
33
|
+
require 'bundler/setup'
|
34
|
+
require 'denko'
|
35
|
+
|
36
|
+
# Settings
|
37
|
+
# Must match speed in the sketch for UART briges. Doesn't matter for native USB.
|
38
|
+
BAUD_RATE = 115_200
|
39
|
+
FRAME_COUNT = 100
|
40
|
+
# Request 1 Mhz I2C frequency. Wire libraries will fall back to fastest available speed.
|
41
|
+
I2C_FREQUENCY = 1_000_000
|
42
|
+
# Use :SDA0 for RP2040
|
43
|
+
I2C_PIN = :SDA
|
44
|
+
|
45
|
+
# Setup
|
46
|
+
board = Denko::Board.new(Denko::Connection::Serial.new(baud: BAUD_RATE))
|
47
|
+
bus = Denko::I2C::Bus.new(board: board, pin: I2C_PIN)
|
48
|
+
oled = Denko::Display::SSD1306.new(bus: bus, rotate: true, i2c_frequency: I2C_FREQUENCY)
|
49
|
+
canvas = oled.canvas
|
50
|
+
|
51
|
+
# Intro
|
52
|
+
canvas.print "SSD1306 Benchmark"
|
53
|
+
oled.draw
|
54
|
+
sleep 1
|
55
|
+
|
56
|
+
# Run
|
57
|
+
start = Time.now
|
58
|
+
(FRAME_COUNT / 2).times do
|
59
|
+
canvas.fill
|
60
|
+
oled.draw
|
61
|
+
canvas.clear
|
62
|
+
oled.draw
|
63
|
+
end
|
64
|
+
board.finish_write
|
65
|
+
finish = Time.now
|
66
|
+
|
67
|
+
# Calculate results
|
68
|
+
fps = FRAME_COUNT / (finish - start)
|
69
|
+
|
70
|
+
# Print to terminal
|
71
|
+
puts "SSD1306 benchmark result: #{fps.round(2)} fps"
|
72
|
+
puts
|
73
|
+
|
74
|
+
# Print to screen
|
75
|
+
canvas.clear
|
76
|
+
canvas.text_cursor = [0,0]
|
77
|
+
canvas.print "#{fps.round(2)} fps"
|
78
|
+
oled.draw
|
79
|
+
board.finish_write
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#
|
2
|
+
# Example using an ADS1115 ADC over the I2C bus.
|
3
|
+
#
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'denko'
|
6
|
+
|
7
|
+
board = Denko::Board.new(Denko::Connection::Serial.new)
|
8
|
+
bus = Denko::I2C::Bus.new(board: board, pin: :SDA)
|
9
|
+
ads = Denko::AnalogIO::ADS1115.new(bus: bus)
|
10
|
+
|
11
|
+
# Helper method so readings look nice.
|
12
|
+
def print_reading(name, raw, voltage)
|
13
|
+
print "#{Time.now.strftime '%Y-%m-%d %H:%M:%S'} - "
|
14
|
+
print "#{name.rjust(18, " ")} | "
|
15
|
+
print "Raw: #{raw.to_s.rjust(6, " ")} | "
|
16
|
+
print "Voltage: "
|
17
|
+
print ("%.10f" % voltage).rjust(13, " ")
|
18
|
+
puts " V"
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Use the ADS1115 directly by writing values to its config registers.
|
23
|
+
# ADS1115#read automatically waits for conversion time and gets the 16-bit reading.
|
24
|
+
# See datasheet for register bitmaps.
|
25
|
+
#
|
26
|
+
# Note: This is the only way to use continuous mode. Subcomponents always use one-shot.
|
27
|
+
#
|
28
|
+
ads.read([0b11000001, 0b10001011]) do |reading|
|
29
|
+
voltage = reading * 0.0001875
|
30
|
+
print_reading("Direct", reading, voltage)
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# Or use its BoardProxy interface, adding subcomponents as if it were a Board.
|
35
|
+
# The key adc: can substitute for board: when intializing AnalogIO::Input.
|
36
|
+
# Gain and sample rate bitmasks can be found in the datasheet.
|
37
|
+
#
|
38
|
+
# Input on pin 0, with pin 1 as differential negative input, and 6.144 V full range.
|
39
|
+
diff_input = Denko::AnalogIO::Input.new(adc: ads, pin: 0, negative_pin: 1, gain: 0b000)
|
40
|
+
|
41
|
+
# Input on pin 2 with no negative input (single ended), and 1.024V full range.
|
42
|
+
# Ths one uses a 8 SPS rate, essentially 16x oversampling compared to the default 128.
|
43
|
+
single_input = Denko::AnalogIO::Input.new(adc: ads, pin: 2, gain: 0b011, sample_rate: 0b000)
|
44
|
+
|
45
|
+
# Poll the differential input every second.
|
46
|
+
diff_input.poll(1) do |reading|
|
47
|
+
voltage = reading * diff_input.volts_per_bit
|
48
|
+
print_reading("Differential A1-A0", reading, voltage)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Poll the single ended input every 2 seconds.
|
52
|
+
single_input.poll(2) do |reading|
|
53
|
+
voltage = reading * single_input.volts_per_bit
|
54
|
+
print_reading("Single A2-GN", reading, voltage)
|
55
|
+
end
|
56
|
+
|
57
|
+
sleep
|
@@ -14,12 +14,12 @@ bus = Denko::SPI::Bus.new(board: board)
|
|
14
14
|
# bus = Denko::SPI::BitBang.new(board: board, pins: SPI_BIT_BANG_PINS)
|
15
15
|
|
16
16
|
# Connect chip select/enable pin of the ADS1118 to pin 9.
|
17
|
-
|
17
|
+
ads = Denko::AnalogIO::ADS1118.new(bus: bus, pin: 9)
|
18
18
|
|
19
19
|
# Helper method so readings look nice.
|
20
20
|
def print_reading(name, raw, voltage)
|
21
21
|
print "#{Time.now.strftime '%Y-%m-%d %H:%M:%S'} - "
|
22
|
-
print "#{name.rjust(
|
22
|
+
print "#{name.rjust(18, " ")} | "
|
23
23
|
print "Raw: #{raw.to_s.rjust(6, " ")} | "
|
24
24
|
print "Voltage: "
|
25
25
|
print ("%.10f" % voltage).rjust(13, " ")
|
@@ -30,7 +30,7 @@ end
|
|
30
30
|
# Read the ADS1118 internal temperature sensor.
|
31
31
|
# This always uses the 128 SPS mode, and there is no polling method for it.
|
32
32
|
#
|
33
|
-
temperature =
|
33
|
+
temperature = ads.temperature_read
|
34
34
|
puts "ADS1118 Temperature: #{temperature} \xC2\xB0C"
|
35
35
|
puts
|
36
36
|
|
@@ -41,7 +41,7 @@ puts
|
|
41
41
|
#
|
42
42
|
# Note: This is the only way to use continuous mode. Subcomponents always use one-shot.
|
43
43
|
#
|
44
|
-
|
44
|
+
ads.read([0b10000001, 0b10001011]) do |reading|
|
45
45
|
voltage = reading * 0.0001875
|
46
46
|
print_reading("Direct", reading, voltage)
|
47
47
|
end
|
@@ -49,26 +49,25 @@ end
|
|
49
49
|
#
|
50
50
|
# Or use its BoardProxy interface, adding subcomponents as if it were a Board.
|
51
51
|
# The key adc: can substitute for board: when intializing AnalogIO::Input.
|
52
|
-
#
|
53
52
|
# Gain and sample rate bitmasks can be found in the datasheet.
|
54
53
|
#
|
55
54
|
# Input on pin 0, with pin 1 as differential negative input, and 6.144 V full range.
|
56
|
-
diff_input = Denko::AnalogIO::Input.new(adc:
|
55
|
+
diff_input = Denko::AnalogIO::Input.new(adc: ads, pin: 0, negative_pin: 1, gain: 0b000)
|
57
56
|
|
58
57
|
# Input on pin 2 with no negative input (single ended), and 1.024V full range.
|
59
58
|
# Ths one uses a 8 SPS rate, essentially 16x oversampling compared to the default 128.
|
60
|
-
single_input = Denko::AnalogIO::Input.new(adc:
|
59
|
+
single_input = Denko::AnalogIO::Input.new(adc: ads, pin: 2, gain: 0b011, sample_rate: 0b000)
|
61
60
|
|
62
61
|
# Poll the differential input every second.
|
63
62
|
diff_input.poll(1) do |reading|
|
64
63
|
voltage = reading * diff_input.volts_per_bit
|
65
|
-
print_reading("Differential", reading, voltage)
|
64
|
+
print_reading("Differential A1-A0", reading, voltage)
|
66
65
|
end
|
67
66
|
|
68
67
|
# Poll the single ended input every 2 seconds.
|
69
68
|
single_input.poll(2) do |reading|
|
70
69
|
voltage = reading * single_input.volts_per_bit
|
71
|
-
print_reading("Single", reading, voltage)
|
70
|
+
print_reading("Single A2-GN", reading, voltage)
|
72
71
|
end
|
73
72
|
|
74
73
|
sleep
|
@@ -5,13 +5,15 @@ require 'bundler/setup'
|
|
5
5
|
require 'denko'
|
6
6
|
|
7
7
|
#
|
8
|
-
#
|
9
|
-
#
|
8
|
+
# Arduino Zero: :DAC0 is :A0 is GPIO14
|
9
|
+
# Arduino UNO R4: :DAC is :A0 is GPIO14
|
10
|
+
# ESP32 V1: :DAC0 is GPIO25, :DAC1 is GPIO26, :A4 is GPIO32
|
11
|
+
# ESP32-S2: :DAC0 is GPIO17, :DAC1 is GPIO18, :A4 is GPIO5
|
10
12
|
#
|
11
13
|
# Connect DAC_PIN TO ADC_PIN with a jumper to test.
|
12
14
|
#
|
13
|
-
DAC_PIN =
|
14
|
-
ADC_PIN =
|
15
|
+
DAC_PIN = :DAC0
|
16
|
+
ADC_PIN = :A4
|
15
17
|
|
16
18
|
board = Denko::Board.new(Denko::Connection::Serial.new)
|
17
19
|
dac = Denko::AnalogIO::Output.new(pin: DAC_PIN, board: board)
|