Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Arduino bindings for Nim
https://github.com/markspanbroek/nim-arduino

Last synced: about 2 months ago
JSON representation

Arduino bindings for Nim

Awesome Lists containing this project

README

        

Arduino for Nim
===============

Provides [Nim][1] bindings for most [Arduino functions][2].

Installation
------------

Can only be used in an environment where the `` C++ header is
available, for instance [PlatformIO][3] with the [Nim plugin][4].

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

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

Example
-------

`src/main.nim`:

```nim
import pkg/nim-arduino/arduino

setup:
pinMode(LED_BUILTIN, OUTPUT)

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

[1]: https://nim-lang.org
[2]: https://arduino.cc/reference
[3]: https://platformio.org
[4]: https://github.com/markspanbroek/nim-platformio