Code Monkey home page Code Monkey logo

rpi-hw's People

Contributors

schlumpf avatar vehagn avatar wicker25 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

Watchers

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

rpi-hw's Issues

Raspberry pi 3 (raspbian Debian Jessie) -> FTC_SBitCache_Lookup failed

I am getting the following crash when running the pcd8544 test with either the rpi-hw that came from apk and from a manually built one:

terminate called after throwing an instance of 'rpihw::exception_class'
what(): /home/pi/rpihw/Rpi-hw/src/font/freetype.cpp:112:
(Fatal) freetype->getSBitChar: FTC_SBitCache_Lookup failed with /usr/share/fonts/truetype/droid/DroidSerif-Bold.ttf

Edit: FTC_SBitCache_Lookup return error code 6 ("Invalid argument")

Edit 2: Some tests have shown that glyph_index is not a positive value which might pose an issue according to http://www.sivachandran.in/2009/04/freetype-2-caching.html
This is as far as I can go as I have no real experience with freetype...

HD44780 display not displaying text

By following your tutorial and successfully installing Rpi-hw, I tried to hook up my HD44780 display (20x4) to my Rpi. No result came out of it, no error and no output on the console or on the display. First I thought something was wrong in the wiring, nope. I triple checked every single wire. Then I tried the 8-bit initialization instead of the 4-bit. And still no result, trying some stuff with the init method (20,4 and 20,2 not working). The last thing that I thought, was that the library wasn't installed correctly. So I checked by blinking an LED, which worked. So what am I doing wrong here or is the display I'm using not supported?
Link to the HD44780 display.

Compile command:

g++ `pkg-config --libs --cflags rpi-hw` main.cpp -o result

Code: (debug gets outputted correctly)

// Include Rpi-hw headers
#include <rpi-hw.hpp>
#include <rpi-hw/display/hd44780.hpp>

// Use Rpi-hw namespace
using namespace rpihw;
using namespace std;

int main(int argc, char *args[]) {
    cout << \"This is the main integer." << endl;

    // Create display controller
    display::hd44780 dev(14, 18, 23, 24, 2, 3, 4, 17, 21, 22); //   Doesn't work
    //display::hd44780 dev(14, 18, 4, 17, 21, 22);                  Doesn't work either

    // Initialize 20x4 display
    dev.init(20, 4);

    // Move the cursor position
    dev.move(2, 0);

    // Write a string at cursor position
    dev.write("Hello world!");

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

EDIT: WIRING WAS WRONG, FIXED NOW

Compile error

I tried to build the library with

cmake . -DCMAKE_INSTALL_PREFIX=/usr  -DUSE_FREETYPE=OFF -DUSE_MAGICK=OFF
make

but it won't compile.

Scanning dependencies of target rpihw
[  3%] Building CXX object CMakeFiles/rpihw.dir/src/utils.cpp.o
[  6%] Building CXX object CMakeFiles/rpihw.dir/src/time.cpp.o
[  9%] Building CXX object CMakeFiles/rpihw.dir/src/gpio.cpp.o
[ 12%] Building CXX object CMakeFiles/rpihw.dir/src/driver/bcm2835.cpp.o
[ 15%] Building CXX object CMakeFiles/rpihw.dir/src/driver/spi.cpp.o
[ 18%] Building CXX object CMakeFiles/rpihw.dir/src/driver/i2c.cpp.o
In file included from /home/pi/libs/Rpi-hw/include/rpi-hw/driver/i2c.hpp:29:0,
                 from /home/pi/libs/Rpi-hw/src/driver/i2c.cpp:25:
/usr/include/linux/i2c-dev.h:37:8: error: redefinition of ‘struct i2c_msg’
 struct i2c_msg {
        ^
In file included from /home/pi/libs/Rpi-hw/include/rpi-hw/driver/i2c.hpp:28:0,
                 from /home/pi/libs/Rpi-hw/src/driver/i2c.cpp:25:
/usr/include/linux/i2c.h:68:8: error: previous definition of ‘struct i2c_msg’
 struct i2c_msg {
        ^
In file included from /home/pi/libs/Rpi-hw/include/rpi-hw/driver/i2c.hpp:29:0,
                 from /home/pi/libs/Rpi-hw/src/driver/i2c.cpp:25:
/usr/include/linux/i2c-dev.h:89:7: error: redefinition of ‘union i2c_smbus_data’
 union i2c_smbus_data {
       ^
In file included from /home/pi/libs/Rpi-hw/include/rpi-hw/driver/i2c.hpp:28:0,
                 from /home/pi/libs/Rpi-hw/src/driver/i2c.cpp:25:
/usr/include/linux/i2c.h:128:7: error: previous definition of ‘union i2c_smbus_data’
 union i2c_smbus_data {
       ^
CMakeFiles/rpihw.dir/build.make:182: recipe for target 'CMakeFiles/rpihw.dir/src/driver/i2c.cpp.o' failed
make[2]: *** [CMakeFiles/rpihw.dir/src/driver/i2c.cpp.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/rpihw.dir/all' failed
make[1]: *** [CMakeFiles/rpihw.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Raspberry Pi image from 2017-01-11, using g++4.7, last commit db4d9c0

Raspberry pi 2

Hello,
I really love your library. I using it with lcd pcd8544 display and it great, but now i start using raspberry pi 2 and on this new raspberry it doesn't work so i tried to change (in this file https://github.com/Wicker25/Rpi-hw/blob/master/include/rpi-hw/driver/bcm2835.hpp ) bcm peri base to this #define BCM2708_PERI_BASE 0x3F000000 and it work but it work bad, there are lots of bug in communication (i think) because the picture isn't consistent. So don't you now how to run it properly on the raspberry pi 2.
Thank you for your answers.

Improving Hitachi HD44780 LCD controller

  1. Adding a function to set the typing delay between individual characters (for typewriter animation).
  2. Adding a text flags parameter to the method write.
  3. Cleaning the code!

raspberry Pi 2 Compability

compiled rpi-hw code on raspberry B+ works for the keypad example but not on raspberry pi 2. We connected all the pins same as on B+ but not worked on pi2.
Any ideas?

Keypad Set bounce and debounce

Hi,

I'm having a issue using a long (0.5m to 1m) cable, the values that I get are all mix up!
Is it possible to set the bounce and debounce of the keypad?

source build problem

Hi,

Trying build the master using:

cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_FREETYPE=OFF -DUSE_MAGICK=OFF
makeinstall

but I am stacked on:

cc1plus: error: unrecognized command line option ‘-std=c++11’

any ideas ??

Sure did not:

apt-get install g++-4.7 cmake libfreetype6-dev libgraphicsmagick++1-dev doxygen

but have the compiler and cmake and disabled the rest (I hope)

Using with Qt

Hi, is it possible to use this awesome library with qt or any example about that?

Compiler and library support for the ISO C++ 2011 standard

I succesfully compiled and installed the Rpi-hw in my Raspbery pi board. And I tried to use Rpi-hw library with my Qt 4.8.

But when I try to include this in my Qt. Got the following errors.

/usr/include/c++/4.7/bits/c++0x_warning.h:32: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
/usr/include/rpi-hw.hpp:159: In file included from /usr/include/rpi-hw.hpp:159Blush | :O ,
/home/pi/untitled/main.cpp:2: from ../untitled/main.cpp:2:
/usr/include/rpi-hw/types.hpp:32: error: 'std::int8_t' has not been declared
/usr/include/rpi-hw/types.hpp:33: error: 'std::int16_t' has not been declared
/usr/include/rpi-hw/types.hpp:34: error: 'std::int32_t' has not been declared
/usr/include/rpi-hw/types.hpp:35: error: 'std::int64_t' has not been declared
/usr/include/rpi-hw/types.hpp:37: error: 'std::uint8_t' has not been declared

Do you know how I can fix this from my Qt creator.

cmake . -DCMAKE_INSTALL_PREFIX=/usr

When I run sudo cmake . I have an error below.

pi@raspberrypi /home/Rpi-hw/examples $ sudo cmake .
-- Could NOT find Freetype (missing: FREETYPE_INCLUDE_DIRS)
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find Freetype (missing: FREETYPE_INCLUDE_DIRS)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindFreetype.cmake:106 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:17 (find_package)

-- Configuring incomplete, errors occurred!
pi@raspberrypi /home/Rpi-hw/examples $

Bashfile Installer?

I'm curious why you don't have some sort of bashfile installer for this to make it easier for newer users. Would you accept a PR for this?

For example, this could be done:

#!/bin/bash
sudo apt-get install g++-4.7 cmake libfreetype6-dev libgraphicsmagick++1-dev -y
wget https://github.com/Wicker25/Rpi-hw/archive/master.tar.gz -O rpi-hw.tar.gz
tar -zxvf rpi-hw.tar.gz
cd Rpi-hw*
cmake . -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
cd ../
sudo rm -rf Rpi-hw
rm rpi-hw.tar.gz

Haven't tested it yet and I probably missed something there, but it took me literally 2 minutes to copy and paste that from the install page.

Wiki not set-up well

I get the following error when trying to access the generic interfaces in the wiki documentation:

You do not have permission to update this wiki.

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.