Skip to content

GREYFOXRGR/pcduino8_uno_lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libarduino_uno

Arduino lib for pcDuino 8 UNO. Based on pcDuino c_environment.

Verified Functions

  • GPIO 0~13 (Linker LED + Linker Base)
  • ADC 0~5 (AD7997 adapter + Linker Potentiometer + Linker Base)
  • I2C (Linker RTC + wires, and Linker Base doesn't work with it)

TODOs

  • SPI not tested.
  • PWM not implemented.

How-to

Installation

Additional package(s) are needed before using libarduino:

sudo apt-get install libi2c-dev i2c-tools

Clean and Compile:

make clean
make

Create new test program

Create new .c files in sample folder and modify Makefile to compile it. For example I want to create helloLibArduino.c to control the LED1 on GPIO13.

#include <core.h>
int led_pin = 1;

void setup()
{
  pinMode(led_pin, OUTPUT);
}

void loop()
{
  digitalWrite(led_pin, HIGH); // Turn the LED on
  delay(1000); // Wait for a second
  digitalWrite(led_pin, LOW); // Turn the LED off
  delay(1000); // Wait for a second
}

Add a line after OBJS=... and add the name of your program (without .c).

OBJS = i2c_rtc_test spi_nfc_test adc_test led_test
OBJS += helloLibArduino

Compile and run:

make
sudo output/helloLibArduino

Enjoy it!

About

Arduino lib for pcDuino 8 UNO.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 73.9%
  • C 24.8%
  • Makefile 1.3%