Skip to content

C++ library for Pine64. Based on the work of Eric Ptak (@thortex) , Stefan Mavrodiev (@StefanMavrodiev), Kamil Trzcinski (@ayufan-pine64)

Notifications You must be signed in to change notification settings

databit/Pine64-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pine64-CPP

C++ library for Pine64. Based on the work of Eric Ptak <trouch@trouch.com>, Stefan Mavrodiev <support@olimex.com>, Kamil Trzcinski <ayufan@ayufan.eu>

Pine64-CPP is object oriented library for access to GPIO, I2C and SPI. Moreover all GPIO pin is mapped.

Example

#include "pinout.h"
#include "gpio.h"

using namespace std;
using namespace Pine64;

int main (void) {
  GPIO* man = new GPIO();

  if (man->setup()) {
    cout << "Failed to configure GPIO\n" << endl;
    return 1;
  }

  cout << " Set GPIO pin directions" << endl;
  man->pinMode(PI_GPIO_18, OUTPUT);

  for(int i = 0; i < 20; i++) {
    cout << " Turn Led ON" << endl;
    man->digitalWrite(PI_GPIO_18, HIGH);
    man->delay(1000);
    cout << " Turn Led OFF" << endl;
    man->digitalWrite(PI_GPIO_18, LOW);
    man->delay(1000);
  }

  cout << "Exiting....." << endl;
  return 0;
}

About

C++ library for Pine64. Based on the work of Eric Ptak (@thortex) , Stefan Mavrodiev (@StefanMavrodiev), Kamil Trzcinski (@ayufan-pine64)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published