Giter Club home page Giter Club logo

ofxgpio's Introduction

ofxGPIO

A small library in C++ for the use of GPIO raspberrypi (A/B/2/3/Zero) orangepi (one/zero/plus) this library is compatible with the toolkit for creative coding Openframeworks. Interface GPIO: SPI (Serial Peripheral Interface), I2C (Inter Integrated Circuit), IO Pin read/write. With utilities such as: graphical gui (Gtk+ / Zenity) and TCP Unix socket implementation.

Documentation

/* define for activated more functionality */

-D COMPILE_WITHOUT_OPENFRAMEWORKS /* if = 1 work pure c++ without openframeworks toolkit */
-D GTK_UI 			  /* if = 1 activated c++ simple bridge for UI gtk+ */
-D ENABLE_BCM2835		  /* if = 1 activated c header BCM2835 */
-D ENABLE_ZENITY                  /* if = 1 activated zenity for UI debug */

Sample simple syntax ofxGPIO I/O

#include <iostream>
#include "ofxGPIO.h"

int main() 
{
        GPIO gpio;
        string state;
        int i = 0;

        gpio.setup(GPIO17,OUT,LOW);

        while(i<100)
        {
            gpio.set(HIGH);
            state = "State pin17: "+to_string(gpio.get());
            Log(state,FG_RED,BG_WHITE) <<"\n";
            sleep(2);

            gpio.set(LOW);
            state = "State pin17: "+to_string(gpio.get());
            Log(state,FG_BLUE,BG_WHITE) <<"\n";
            sleep(2);

            i++;
        }

        gpio.close();
        return 0;
}

GPIO support

Simple Gtk+ UI Utility

Sample syntax ofxGPIO i2c

I2c * bus;

bus = new I2c("/dev/i2c-1");
bus->addressSet(0x04);

while(1) 
{
	bus->writeByte(0x04,1);
	usleep(500000);
	bus->writeByte(0x04,0);
	usleep(500000);
}

Zenity UI Utility

Sample

Sample syntax ofxGPIO SPI

SPI2 spi;
char data[2];

data[0] = 1;
data[1] = 2;

spi.setup("/dev/spidev0.0",1000000);
spi.readWrite(1, (unsigned char *)data, 2);

Example ofxGPIO

Example scanner with nRF24L01:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • nRF24L01
fritzing example:

alt tag

Example simple Button Read state:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • Button
fritzing example:

alt tag

Example simple Led Blink:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • Led
fritzing example:

alt tag

Example simple Relay on / off Light:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • Relay 5v
  • Lamp
fritzing example:

alt tag

Example GPS UART: http://aprs.gids.nl/nmea/

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • GPS breakout v3
fritzing example:

alt tag

Example i2c multiple byte read MPU6050:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • MPU6050
fritzing example:

alt tag

Example Led Matrix8x8:

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • Led Matrix
fritzing example:

alt tag

Example Servo motor(Attention raspberry not to have pin PWM, for this we use a CLK pin, advice integrated pwm):

  • Raspberry pi (2/3/Zero/A/A+/B+)
  • Servo Motor
fritzing example:

alt tag

Example GPIO read/write stepper rotation:

  • Raspberry PI
  • Stepper Motor bipolar
  • sn754410ne H-Bridge
  • Button
  • wiring

fritzing example:

alt tag

sn754410ne H-Bridge:

alt tag


video: http://www.youtube.com/watch?v=lwRd5D9EuU0 video

Example GPIO I2C communication:

  • Raspberry PI
  • Arduino
  • LED
  • Resistor 75 ohm
  • wiring

fritzing example:

alt tag


video: http://www.youtube.com/watch?v=SRz750EdjfY video

Example GPIO SPI add Analog pin MCP3008 potentiometer:

  • Raspberry
  • MCP3008
  • Potentiometer
  • wiring

fritzing example:

alt tag

MCP3008 8-Channel 10-Bit ADC

alt tag


video: http://www.youtube.com/watch?v=PkDkCJyZ2go video


for i2c and SPI configuration visit this page:

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-spi
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c



Datasheet integrated list:

Drive motor:
http://www.ti.com/lit/ds/symlink/l293.pdf
http://www.ti.com/lit/ds/symlink/sn754410.pdf
http://www.ti.com/lit/ds/symlink/uln2003a.pdf
http://www.st.com/content/ccc/resource/technical/document/datasheet/f3/6e/c8/64/4d/b3/4e/38/CD00001244.pdf/files/CD00001244.pdf/jcr:content/translations/en.CD00001244.pdf

Motor stepper Bipolar / Unipolar:
http://motion.schneider-electric.com/downloads/datasheets/14_mtr.pdf
http://www.mitsumi.co.jp/latest/Catalog/pdf/motor_m35sp_9_e.pdf

A/D Converters:
https://cdn-shop.adafruit.com/datasheets/MCP3008.pdf
http://ww1.microchip.com/downloads/en/DeviceDoc/21295C.pdf

ATmega48A/PA/88A/PA/168A/PA/328/P:
http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf

MPU-6000 / MPU-6050:
https://www.cdiweb.com/datasheets/invensense/MPU-6050_DataSheet_V3%204.pdf

Adafruit Ultimate GPS:
https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ultimate-gps.pdf

Adafruit LED Backpacks:
https://cdn-learn.adafruit.com/downloads/pdf/adafruit-led-backpack.pdf

EEPROM
http://www.bucek.name/pdf/24c16.pdf http://www.st.com/content/ccc/resource/technical/document/datasheet/5c/df/52/a5/15/f2/48/bd/CD00259166.pdf/files/CD00259166.pdf/jcr:content/translations/en.CD00259166.pdf

ofxgpio's People

Contributors

gitbruno avatar joernroeder avatar kashimastro avatar npisanti avatar sourya-sen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxgpio's Issues

SPI not working in of093 and RPi2

Hi tested the spi example with the connection to the adc3008 shown in the readme but i always get the error "Problem transmitting spi data..ioctl". I tried the button example and this is working fine.

Thanks in advance.

Problem example-i2c-scanner

I try to compile "example-i2c-scanner"

In file included from ../src/ofxGPIO.h:44:0,
from src/main.cpp:2:
../src/readata.h: In member function ‘void ReadRawData::update()’:
../src/readata.h:353:23: warning: unused variable ‘ok’ [-Wunused-variable]
char ok= -1;

Simulate GPIO

I'm currently developing an application using this addon and it an the RPI it works fine. But as soon, as I add the addon, I can't compile my app on my notebook (Arch) anymore, which makes sense, as it has no GPIO pins..

I didn't dig to deep into your code yet, but would it make sense to simulate the pins, if not available?
I was thinking similar to this solution for the python implementation.

Not sure, if it really makes sense, just throwing the idea out there.

Cannot make SPI work

Hello,

I am trying to use the SPI with MCP23S08 (IO Expander).
I tried with Arduino before to make sure my code works and I read/write the correct registers but I cannot make it work with the RPI.

I connected the chip as follow:

  • MOSI pin 19
  • MISO pin 21
  • SCLK pin 23
  • CS pin 24

I also power the chip with +3.3V (pin 1)

Here is my code, can you spot something I am doing wrong?

SPI2 _spi;

//--------------------------------------------------------------
void ofApp::setup(){
	// Setup our chip on SPI 0
	_spi.setup("/dev/spidev0.0", 0, 1000000);
	
	// Configure chip: set all GPIO as input
	char data[3];
	data[0] = 0x40;		// Opcode
	data[1] = 0x00;		// IODIR - I/O Direction register
	data[2] = 0xff;		// all GPIO pins are inputs

	// Write the 3 data bits on channel 0
	_spi.readWrite(0, (unsigned char *)data, 3);
}

//--------------------------------------------------------------
void ofApp::update(){
	// Read all 8 IO expander inputs
	char data[3];
	data[0] = 0x41;		// Opcode
	data[1] = 0x09;		// GPIO - I/O port register address
	data[2] = 0x00;		// Dummy to read the value

	// Write the 3 data bits on channel 0
	val = _spi.readWrite(0, (unsigned char *)data, 3);
	
	ofLogVerbose() << "Val = " << val;
}

only works with delay after export_gpio()

while trying to get the simple led example to work on rpi3 i found i need to add a ofSleepMillis(100); after gpio17.export_gpio();.

otherwise the pin does not react.

Can't write to pins on RPI Zero

Running the example-simple-led produces no change in voltage on GPIO 17. When I change this pin in the code, there is still no voltage output (it stays at Ground).

However, reading the state of a digital pin does work, using example-simple-button.

I'm using a Raspberry Pi Zero with Rasbian Jessie Lite.

Can't compare ofstream or ifstream to int in gpio.cpp

Dear KashimAstro,

I've already use your addon with success on a PI3 but this time it doesn't compile.
I use the i2c example.
I've install evrything yesterday (last Rasbian, last stable of, ...)
The errors are about ofstream or ifstream that can't be compared in the gpio.cpp
I'm giving you all the errors and hope it helps.

/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:20: error: no match for ‘operator<’ (operand types are ‘std::ofstream {aka std::basic_ofstream}’ and ‘int’)
if (exportgpio < 0){
~~~~~~~~~~~^~~
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:20: note: candidate: operator<(int, int)
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:20: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘int’
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::pair<_T1, _T2>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: candidate: template bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5150:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5150:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5163:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5163:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5175:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5175:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:28:22: note: mismatched types ‘const _CharT*’ and ‘std::basic_ofstream’
if (exportgpio < 0){
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/system_error:200:3: note: candidate: bool std::operator<(const std::error_code&, const std::error_code&)
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/include/c++/6/system_error:200:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/include/c++/6/system_error:274:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_condition&’
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp: In member function ‘int GPIO::unexport_gpio()’:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:22: error: no match for ‘operator<’ (operand types are ‘std::ofstream {aka std::basic_ofstream}’ and ‘int’)
if (unexportgpio < 0){
~~~~~~~~~~~~~^~~
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:22: note: candidate: operator<(int, int)
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:22: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘int’
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::pair<_T1, _T2>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: candidate: template bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5150:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5150:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5163:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5163:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5175:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5175:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:42:24: note: mismatched types ‘const _CharT*’ and ‘std::basic_ofstream’
if (unexportgpio < 0){
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/system_error:200:3: note: candidate: bool std::operator<(const std::error_code&, const std::error_code&)
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/include/c++/6/system_error:200:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/include/c++/6/system_error:274:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_condition&’
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp: In member function ‘int GPIO::setdir_gpio(std::__cxx11::string)’:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:24: error: no match for ‘operator<’ (operand types are ‘std::ofstream {aka std::basic_ofstream}’ and ‘int’)
if (setdirgpio < 0){
~~~~~~~~~~~^~~
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:24: note: candidate: operator<(int, int)
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:24: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘int’
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::pair<_T1, _T2>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: candidate: template bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5150:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5150:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5163:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5163:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5175:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5175:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:57:26: note: mismatched types ‘const _CharT*’ and ‘std::basic_ofstream’
if (setdirgpio < 0){
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/system_error:200:3: note: candidate: bool std::operator<(const std::error_code&, const std::error_code&)
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/include/c++/6/system_error:200:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/include/c++/6/system_error:274:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_condition&’
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp: In member function ‘int GPIO::setval_gpio(std::__cxx11::string)’:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:24: error: no match for ‘operator<’ (operand types are ‘std::ofstream {aka std::basic_ofstream}’ and ‘int’)
if (setvalgpio < 0){
~~~~~~~~~~~^~~
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:24: note: candidate: operator<(int, int)
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:24: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘int’
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::pair<_T1, _T2>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: candidate: template bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5150:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5150:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5163:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5163:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: ‘std::ofstream {aka std::basic_ofstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5175:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5175:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:72:26: note: mismatched types ‘const _CharT*’ and ‘std::basic_ofstream’
if (setvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/system_error:200:3: note: candidate: bool std::operator<(const std::error_code&, const std::error_code&)
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/include/c++/6/system_error:200:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/include/c++/6/system_error:274:3: note: no known conversion for argument 1 from ‘std::ofstream {aka std::basic_ofstream}’ to ‘const std::error_condition&’
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp: In member function ‘int GPIO::getval_gpio(std::__cxx11::string&)’:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:20: error: no match for ‘operator<’ (operand types are ‘std::ifstream {aka std::basic_ifstream}’ and ‘int’)
if (getvalgpio < 0){
~~~~~~~~~~~^~~
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:20: note: candidate: operator<(int, int)
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:20: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream}’ to ‘int’
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::pair<_T1, _T2>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
operator<(const reverse_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
operator<(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::reverse_iterator<_Iterator>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
operator<(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: candidate: template bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
operator<(const move_iterator<_Iterator>& __x,
^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1143:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::move_iterator<_IteratorL>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5150:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5150:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5163:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5163:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: ‘std::ifstream {aka std::basic_ifstream}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5175:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<(const _CharT* __lhs,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5175:5: note: template argument deduction/substitution failed:
/home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:86:22: note: mismatched types ‘const _CharT*’ and ‘std::basic_ifstream’
if (getvalgpio < 0){
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/istream:38,
from /usr/include/c++/6/fstream:38,
from /home/pi/openframeworks/addons/ofxGPIO/src/gpio.cpp:1:
/usr/include/c++/6/system_error:200:3: note: candidate: bool std::operator<(const std::error_code&, const std::error_code&)
operator<(const error_code& __lhs, const error_code& __rhs) noexcept
^~~~~~~~
/usr/include/c++/6/system_error:200:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream}’ to ‘const std::error_code&’
/usr/include/c++/6/system_error:274:3: note: candidate: bool std::operator<(const std::error_condition&, const std::error_condition&)
operator<(const error_condition& __lhs,
^~~~~~~~
/usr/include/c++/6/system_error:274:3: note: no known conversion for argument 1 from ‘std::ifstream {aka std::basic_ifstream}’ to ‘const std::error_condition&’

error open frameworks compiling with window

i have this error when i compile simple button example with windows

obj/linuxarmv6l/Release/src/ofApp.o:(.data+0x0): multiple definition of `OLEDFont'
obj/linuxarmv6l/Release/src/main.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status

example-apa102-ledstrip not lighting leds with Stretch

The example compiles, and when it runs a terminal message indicates the SPI setup was successful. This happens whether the example is run with sudo or without. The example lights up the leds with Jessie and the same hardware.

Gpio io

I have a strange issue, I am running my app with elevated (Sudo) permissions. I don't get any response from a simple push button until I run node red to test the setup. Then my OF app will run perfectly until a reboot.

The only obvious difference I see is node red has a checkbox for setting pull up and pull down states for input pins. Is this function available in ofxgpio or is there something deeper at play.

I am using the latest OF and stretch install.

12c examples

Hi, there are some errors in the 12C examples, for the I2C scanner the OF version is actually without OF and throws, no rule to make target run

The straight 12c examples bails on the make.

I am trying to use an LIS3DH adafruit accelerometer, but I want to check the connection first...

Use SPI1 for APA102

Hello,
Can I use SPI1 and pins 20,21 for driving APA102?
I tried to change the port on setupAPA102 but didn't worked because there is a bug in the led.h at the setAPA102 (spi.readWrite selects always 0)
spi.readWrite(0, (unsigned char*)buffer0, 1)

But even after change this to 1, still cannot use pin 20 and 21.

Do you have any recommendation?

thank you

Issue with a raspberry 3 B+

Hello,

I've tried some of the examples of the ofxgpio and I have some issues with the simple ones.
I'm using a raspberry 3 B+ with of 0.9.3.
It compiles very well.
The simple button example runs perfectly.
But None of the simple led or the relay example.
When I check the tension between the gpio pin and the ground it stays at 0V.

Actually I managed to blink a led with command line I found at
http://www.blaess.fr/christophe/2012/11/26/les-gpio-du-raspberry-pi/
Here is the result in the terminal
2016-06-13-194431_1824x984_scrot
I'm a beginner, but it seems to be the same code as in the addon.
Did I miss something ?

Adapting read-write example to distance sensor

I'm trying to adapt the read-write example to a distance sensor (HC-SR04), sending a Trigger and getting the Echo result. I'd be glad if I get help with this not working code :

#include "ofMain.h"
#include "ofAppNoWindow.h"
#include "ofxGPIO.h"

class noWin : public ofBaseApp{
        public:
		GPIO* gpio17;
                 GPIO* gpio39;
                 GPIO* gpio40;

		string state_button, echo;

   void setup(){
      gpio17  = new GPIO("17");
      gpio39  = new GPIO("39"); // Trigger (out)
      gpio40  = new GPIO("40"); // Echo (in)

      gpio17->export_gpio();
      gpio39->export_gpio();
      gpio40->export_gpio();

      gpio17->setdir_gpio("in"); // State
      gpio39->setdir_gpio("out"); // Trigger
      gpio40->setdir_gpio("in"); // Echo

		}

void update(){
      if(state_button == "1"){
          gpio39->setval_gpio("1");
          usleep(10);
          gpio40->getval_gpio(echo);
          ofLog()<< echo;
          }
      if(state_button == "0"){
          gpio39->setval_gpio("0");
          usleep(5000);
          }
       }

   void exit(){
      gpio17->unexport_gpio();
      gpio39->unexport_gpio();
      gpio40->unexport_gpio();
     }
};

int main( ){
  ofAppNoWindow window;
	ofSetupOpenGL(&window, 0,0, OF_WINDOW);
	ofRunApp( new noWin() );
}

unable to set direction of gpio

When I run the example-simple-led program I get the following

OPERATION FAILED: Unable to set direction of GPIO2
OPERATION FAILED: Unable to set value of GPIO2

using spi1 with MCP

hello, i am trying to read from a MCP3008 on the spi1 port of a raspberry pi3. (spi1 has been enabled in the config.txt)

in openframeworks if i setup my a2d like this:

a2d.setup("/dev/spidev0.0", SPI_MODE_O, 1000000, 8)

then it works perfectly for the pin-setup :

MISO -> BCM 9
MOSI -> BCM 10
CLK -> BCM 11
CS -> BCM 8

however i already have a screen attached to the spi0 pins, which is interfaced with python.

what i had hoped is that if i setup my a2d with spi1 like this :

a2d.setup("/dev/spidev1.0", SPI_MODE_O, 1000000, 8)

then i could wire my a2d like this:

MISO -> BCM 19
MOSI -> BCM 20
CLK -> BCM 21
CS -> BCM 18

however this does not work. in fact it still correctly reads from spi0 if as wired before (and messes with my screen on spi0 when that is wired in)

is it currently possible to switch this in ofxGPIO ? i can correctly set my display to use spi1 with a code change but have already ordered pcbs with it this way round.

thanks !

[ error ] Problem transmitting spi data..ioctl

hi!
i have this problem when try to compiling with of OF 0.9.3 on raspberry pi 1 b+
i try to fix this with add memset(&spi,0,sizeof spi); after struct spi_ioc_transfer spi[length] defined
and and/or add memset(&spi[i], 0, sizeof (spi[i])); inside the for loop. but this not work.
any idea?

https://bugs.launchpad.net/raspbian/+bug/1419113
http://www.raspberry-projects.com/pi/programming-in-c/spi/using-the-spi-interface

sorry for my inglish.
thanks for share!

ADS1015 GPIO

You have examples using I2C y SPI, but I can use one of this using the ADS1015 12-Bit ADC - 4 Channel with Programmable Gain Amplifier.

Issues with using input and output and startup.

I am having some strange issues, I need to autostart my app, I am using ofxGPIO for input, output, SPI and i2c on a raspberry pi 2b+ with bullseye.

Most of the time the code runs well, at first with a fresh install I could net get GPIO access but after running the user permission changes in this post https://forum.openframeworks.cc/t/ofxgpio-update-debian-stretch/28430/4?u=kashim
I can get input and output - most of the time.
Now I have a strange issue where sometimes on boot the return from my input (just a simple button) is 1, whereas usually it is 0 - I have a state machine to allow for different commands: double presses, triple presses and long presses. When the app starts up with the output inverted my long presses are triggered automatically. Obviously this is not desirable.

Is there a change for the permsision setup for bulleye? Is there an order i need to initialise my pins?

PI2

would your addon work on the PI2 with OF 0.9.0 ?
thanks.

servo example on rpi 2 - no movement

hi,
first of all thank you for you extraordinary work!

can you give me some hint why my servo isn't moving. your example code compiles without errors, runs without errors. but servo stands still. when i try to move the servo with python code it works fine, so its no power or current issue or general I/O issue. it's a small sg90 servo. Do you have an idea where i can start to investigate?

Greetings

how do i add ofxGPIO to an existing project?

im a bit confused about how to use ofxGPIO with the other examples that come with ofx. i've got the example-simple-led working and flashing. i've got the colorExample (inside graphicss examples) working on the screen. how do I combine the two?

perhaps you could show me some files which have all the ofapp.cpp, ofapp.h and main.cpp?

any help would be great. cheers =)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.