No description
Find a file
Mark Spanbroek ea798d16d0 version 0.3.0
2021-05-28 11:16:01 +02:00
arduino.nim Export setup() and loop() for C++ linkage 2021-05-28 11:11:06 +02:00
arduino.nimble version 0.3.0 2021-05-28 11:16:01 +02:00
library.json version 0.3.0 2021-05-28 11:16:01 +02:00
readme.md Add readme 2021-01-23 14:40:08 +01:00

Arduino for Nim

Provides Nim bindings for most Arduino functions.

Installation

Can only be used in an environment where the <Arduino.h> C++ header is available, for instance PlatformIO with the Nim plugin.

Use the following snippet in platformio.ini to add the Nim bindings for Arduino to PlatformIO:

lib_deps =
  https://github.com/markspanbroek/nim-arduino

Example

src/main.nim:

import pkg/nim-arduino/arduino

setup:
  pinMode(LED_BUILTIN, OUTPUT)

loop:
  digitalWrite(LED_BUILTIN, HIGH)
  delay(1000)
  digitalWrite(LED_BUILTIN, LOW)
  delay(1000)