Example: print digital and analog inputs. More...
#include "stdio.h"
#include <termios.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include "../c_wrapper/pruio_c_wrapper.h"
#include "../c_wrapper/pruio_pins.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE 1 |
Functions | |
int | isleep (unsigned int mseconds) |
wait for keystroke or timeout More... | |
int | main (int argc, char **argv) |
Example: print digital and analog inputs.
This file contains an example on how to use libpruio to print out the state of the digital GPIOs and the analog input lines.
Licence: GPLv3
Copyright 2014 by Thomas{ dOt ]Freiherr[ At ]gmx[ DoT }net
Compile by:
gcc -Wall -o io_input io_input.c /usr/local/lib/freebasic/fbrt0.o -lpruio -L"/usr/local/lib/freebasic/" -lfb -lpthread -lprussdrv -ltermcap -lsupc++ -Wno-unused-variable
Definition in file io_input.c.
#define _GNU_SOURCE 1 |
Definition at line 19 of file io_input.c.
int isleep | ( | unsigned int | mseconds) |
wait for keystroke or timeout
mseconds | timeout value in milliseconds |
Wait for a keystroke or timeout and return which of the events happened.
Definition at line 38 of file io_input.c.
int main | ( | int | argc, |
char ** | argv | ||
) |