Jump to content

Larry Bank

Members
  • Posts

    161
  • Joined

  • Last visited

Posts posted by Larry Bank

  1. From my brief look at Cron scripts (I've never used them), it looks like it will just fire off events at fixed times. This means you'll need to dynamically adjust the script to follow the changing daylight times. This sounds like a lot more effort than just adding a light sensor. Is the time to develop the software really that much cheaper than adding a $2 sensor to each kiosk?

  2. 5 minutes ago, TonyMac32 said:

    2x16 I2C interface?  Interesting.  I was confused until I saw the picture, the HD44780 interface for those now has a kernel driver.  :D  I need to look at it and see if it can be run in 4-bit mode or if it has to go 8-bits wide.  I've been lazy, I have a drawer full of the parallel displays...  (good and cheap, and I'm usually using Cypress PSoC 5 controllers with tons of I/O)

    All of the ones I've been able to find on eBay and Aliexpress have the HD44780 paired with a simple I2C I/O expander. It just acts as a shift register and passes every write straight through to 8 data pins. The LCD can operate in 4-bit mode by sending a command of 2Xh - bit 4 sets the data bus width (see here https://learningmsp430.wordpress.com/2013/11/16/16x2-lcd-interfacing-in-4-bit-mode/). It allows having just the upper 4 data bits connected and the lower 4 bits from the I/O expander are used as control lines.

  3. This may be useful to some of you. I wrote some C code to talk to those common 2x16 LCD displays that are available in various colors from various vendors. My purpose in writing the code was to learn about the device and help document it better for other people to have an easier time using it. In my search for info, I only found poorly documented Python and Arduino code, so I thought I would write a C version and make it easy to read. You can find the code here:

     

    https://github.com/bitbank2/LCD1602

     

    lcd1602.jpg

  4. You still haven't shared enough info to help you decide how to proceed. Using composite video is fine, but do you want the user to interact with a mouse and manipulate a windowed GUI or would you prefer simple graphics without much of a UI. If you boot Linux without a desktop on the composite video out, you'll get a framebuffer with no OS support for drawing. This is easy to work with if you don't mind drawing everything explicitly with your own code. If you want a system with overlapping sizable windows and easy to use controls, then you'll probably want to use an X11 based desktop with GTK+.

  5. 20 minutes ago, Hikmet TEKIN said:

    Larry Bank,

    I am planning to use SPI LCD.  I ordered this LCD 3.5" SPI TFT. But I need 5 inch display but I only found Video Input Display. If you suggest me a good 5" SPI TFT I can use it too. As a result, I will use both SPI TFT and Video Out.

     

    I will going to program all the things in C. 

     

    How can I install librarys and I can start programming some little stuffs and go further. 

     

    Thanks

    It appears that the display you chose is supported by my SPI_LCD library. The refresh rate will be slow (at best maybe 9 FPS). I haven't seen any larger SPI LCD displays because the interface isn't fast enough to make them practical. The AllWinner SoCs max out at around 33Mhz as a functional SPI speed. At that speed, you need to divide it by 16 (bits per pixel) and then a bit more due to the command/data overhead of working with these displays. That makes it impractical to use SPI for a display larger than 320x480.

     

    As far as installing things, my SPI_LCD library is probably the easiest place to start. you would do the following to get it going:

     

    git clone https://github.com/bitbank2/SPI_LCD

    make

    make -f make_sample

    sudo ./lcd

     

    Before you build the library, you need to edit spi_lcd.c and uncomment the #USE_GENERIC and the board you're using (#USE_ORANGEPIZERO) and comment out the other choices. This will enable the correct pin->GPIO translation table for your board.

     

    Before you build the sample, you need to edit main.c and change the values in the spilcdInit() statement to work for your specific display type and the pins used to connect it. The correct SPI channel for RPI0 should be 1. The pin numbers for the D/C, RST and LED pins are dependent on how you connected the display to the board.

     

  6. You say that you have the Orange Pi Zero, but it only has composite video out. What type of display will you use? SPI LCD? composite video?

     

    Once you specify that, I can help you with choices for how to do it. If you're using a Linux Desktop, you can use GTK+ to do the windowing and graphics. It has "low speed" pixel level access to the display. If you plan to do video/animation then you can make use of SDL2. Here is a simple project I wrote which displays the tags in TIFF files using GTK+:

     

    https://github.com/bitbank2/tifftool

     

    I've also written a "bare metal" library for drawing on RGB565 framebuffers (e.g. inexpensive LCD display):

     

    https://github.com/bitbank2/bbgfx

     

    More info once you clarify what you want to do

     

  7. 1 hour ago, arox said:

    Interesting ! I will have a look at it. But you know, temperature rarely change very much every ten seconds !

    This is a first pass at the project. The reason for recording the values every ten seconds is because I wanted to see the effect of the air conditioner and it only cycles for a couple of minutes (I live in Florida and the air conditioner runs 365 days a year). I will also add a time stamp to the CSV output when I get some time. I wanted to graph the air quality changes due to 3 bodies sleeping in the same room.

  8. I just released the source code to a very simple weather monitoring app. I wrote it to run on my Orange Pi Zero and make use of a few environmental sensors (Bosch BME280 and AMS CCS811), along with a SSD1306 OLED. It records the data every ten seconds into a CSV text file.

     

    https://github.com/bitbank2/weather_mon

     

    It's just a simple idea that I had to monitor the conditions overnight in my kids' bedroom since our place doesn't heat/cool evenly.

    proto.jpg

  9. 1 minute ago, martinayotte said:

    I see that you are using /sys/class/gpio to access GPIOs.

    But other libraries are using /dev/mem to do a "mmap" directly to SoC registers located at 0x01C20800, which is faster and allows also to access to Pn_PUL0/Pn_PUL1 registers at offset 0x1c and 0x20 respectively.

    Maybe you can take a look at this library : https://github.com/duxingkei33/orangepi_PC_gpio_pyH3

     

    I know there are direct means to access GPIOs, but then I would need to write code unique to each CPU. If Armbian only supported AllWinner H3 devices, it would be an easy decision. For now, I think it's best to keep the code simpler and support all SoCs.

     

    I'm not sure where this project is headed. I don't have the time to turn it into a support-everything/do-everything library. I saw a need and I put together a simple solution. It would be great if this was given the "blessing" of Armbian and turned into a real community effort.

     

  10. Must it be H3? How about H5? For me, the best board for the money is the Orange Pi Zero Plus 2 H5. It's the fastest of the bunch and has on board HDMI and eMMC. If you want to start with the least expensive board and don't need HDMI out, then the Orange Pi Zero is a good choice ($7).

  11. I first noticed this on my Orange Pi Zero. The latest Armbian releases (4.13.x) have some kind of gap between bytes when transmitting over SPI. I have an SPI performance test built into my SPI_LCD code:

     

    https://github.com/bitbank2/SPI_LCD

     

    If you run the demo program, it measures how many frames per second it can write to an SPI-connected LCD. On older Armbian builds with kernel version 3.x, it would usually get 27-33FPS on the H2/H3 boards. With the mainline kernel builds and running the same code, I'm seeing 9-17FPS (depending on the board). The H5 doesn't seem to be affected (I'm using an Orange Pi Zero +2 H5 for testing also). Anyone else seeing this? Any simple solution?

     

    The people at FriendlyArm are also affected by this. I've been testing the NanoPi Duo using their 4.11 build and I get 3 FPS! The NanoPi Duo nightly build of Armbian gets 9 FPS on the same setup. I'm using SPI LCD displays for gaming and 30FPS gives a good experience, but 10 doesn't.

     

    Update: The NanoPi NEO running Armbian kernel 4.13.12 shows 28.5 FPS (which is normal/good). So, why does the OPZ and NanoPi-Duo show such slow throughput when they have the same CPU?

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines