Skip to content

larsimmisch/arduino--

This branch is 26 commits ahead of benlaurie/arduino--:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a967a11 · Jun 9, 2023
Apr 28, 2023
Oct 21, 2012
Apr 8, 2018
Apr 28, 2023
Apr 28, 2023
May 16, 2019
Apr 28, 2023
May 16, 2019
Apr 28, 2023
Dec 29, 2011
Dec 18, 2018
Feb 24, 2014
Feb 24, 2014
Feb 24, 2014
Oct 7, 2012
Apr 8, 2018
Feb 9, 2012
Dec 21, 2012
Feb 26, 2013
Dec 25, 2011
Mar 11, 2012
Apr 28, 2023
May 19, 2013
Jun 9, 2023
Apr 8, 2018
Mar 11, 2012
Oct 21, 2012
Mar 5, 2012
Oct 20, 2012
Apr 8, 2018
Oct 13, 2012
Nov 26, 2014
Oct 21, 2012
Dec 21, 2012
Dec 21, 2012

Repository files navigation

arduino--

arduino-- is a C++ library for AVR microcontrollers.

The project got kicked off by this blog post by Ben Laurie, Grown-up Arduino programming.

In a nutshell, the idea is to move as much work as possible into the compilation phase via C++ templates, and have a system where toggling an output pin in C++ compiles down to a single assembler instruction, while still having an abstraction layer that is at least very similar between devices.

This is what hello world - blinking an LED - looks like:

/*
 The hello world of arduino--, a C++ take on the Arduino libraries.

 Blinks an LED connected to digital pin 13 (which is connected to an LED
 on all Arduino variants that we know of).
 */

#include "arduino--.h"
#include <avr/sleep.h>

int main(void)
    {
    // Arduino Pin D13 is an output
    Arduino::D13::modeOutput();

    while(true)
        {
        // toggle the pin
        Arduino::D13::toggle();
        // wait
        _delay_ms(2000);
        }

    return 0;
    }

Getting started

Prerequisites

  • avrdude
  • avr-gcc
  • avr-binutils
  • avr-libc
  • perl
  • python

On a Mac, installation via Homebrew is recommended:

brew tap osx-cross/avr
brew install avr-gcc

This will automatically install avr-binutils and avr-libs, too.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 45.1%
  • C++ 44.6%
  • C 4.6%
  • Python 4.4%
  • Makefile 1.2%
  • SWIG 0.1%