Kiosk GUI Screens

I got it working. I only added code portion from libgpio manual. Needed more. There were two examples and I assumed wrong.

Found some good tutorials
He says not to use ifdef.

This one says use it....
Oh boy.
 
Just to critique my learning I thought that the statement:

gpio_config_t was sufficent alone.

While the top part of the previous example was needed.

gpio_handle_t handle;
handle = gpio_open(0);

Compiler was complaining about handle undeclared.

In my head I was thinking device does not need to be opened to check config. That's why I ignored the top section of example.
That assumption was wrong.

Code:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <libgpio.h>

    int main(int argc, char **argv)
    {
        gpio_handle_t handle;
        handle = gpio_open(0);
        gpio_config_t cfg;
        cfg.g_pin=31;
        gpio_pin_config(handle, &cfg);
        printf("Pin %d: \"%u\"\n", cfg.g_pin, cfg.g_flags);
};
 
OK now my dumb questions come. From everything I read for each programmatic OPEN you should do a CLOSE operation.

Why is there no gpio_close shown. That should be part of the function for a "One time call" right? If polling you might want to keep it open.
 
A C binding to a C++ library does not make sense imho. It only adds confusion to the project. Object orientation is one of the strengths of C++, and it should not be abandoned.
 
I am sitting here reflecting on my decision to use FLTK or anything not C.
Doing some Hello World with Motif. Playing with Xaw.

I feel like I have the GUI part down and now its meat and potatoes. FLTK meets my needs.
I can make GUI screens just like I could with MS Access but there is no SQL Query builder here.

I have the Community College course book open and looking at the offerings.
CSC 221 teaches with Python.
Ugg.
I do need the structure of a classroom. Dank old books and web pages just are not enough.
 
Back
Top