pi4j-v1 icon indicating copy to clipboard operation
pi4j-v1 copied to clipboard

LCD: draw points/lines/ and other geometrical forms

Open radut opened this issue 11 years ago • 14 comments

Hi, What about improving the pi4j lcd library with the posibility to draw points, lines and base geometric forms ?

radut avatar May 17 '14 22:05 radut

Lcd library uses WiringPi Lcd Library (http://wiringpi.com/dev-lib/lcd-library/). I dont know if are possible changes at points level

SrMouraSilva avatar Jan 07 '16 01:01 SrMouraSilva

Yes, it's possible

https://github.com/noxo/SnakePI4J https://github.com/noxo/SnakePI4J/blob/master/src/org/noxo/devices/driver/JPCD8544.java

SrMouraSilva avatar Jan 07 '16 01:01 SrMouraSilva

LOL - you got me with 'awt' part of your post! but seriously, I don't think it would be too hard to have Swing draw on any framebuffer. It is not 'implementation' (of current OS) specific and theoretically easy to be used anywhere...

natdan avatar Jan 07 '16 08:01 natdan

"LOL - you got me with 'awt' part of your post!" I'm sorry!

But...

"THE EMBEDDED WINDOW TOOLKIT Porting Java’s AWT to an Embedded System"

http://alumni.soe.ucsc.edu/~wholt/thesis.pdf

SrMouraSilva avatar Jan 07 '16 11:01 SrMouraSilva

I do not know, but I think Pi4j do not support Displays graphics

João Sombra has ported a python port of a C implementation of PCD8544 (of a arduino implementation...)

(Reference: https://www.youtube.com/watch?v=LLt9q1CAxRs)

The C implementation has a comment in your github project

"This driver uses 5 GPIOs on target board with a bit-bang SPI implementation (hence, may not be as fast but seems fast enough)."

João Sombra answered my question in your demo video "Funcionou mas o desempenho ficou bem a desejar." (Google translated: It worked but the performance was much to be desired.)

I need work with PCD8544, then I will test. If has a success, I will pull request then

SrMouraSilva avatar Jan 11 '16 12:01 SrMouraSilva

Exists a cool c++ lib with PCD8544 support: Rpi-hw

I'm putting some links in here for future reference

  • Code to port: https://github.com/Wicker25/Rpi-hw/blob/master/src/display/pcd8544.cpp
  • Display in Raspberry 2 support: Wicker25/Rpi-hw#15 https://github.com/Wicker25/Rpi-hw/issues/15

SrMouraSilva avatar Jan 11 '16 12:01 SrMouraSilva

@natdan, I added a support for Java Graphics for display

If AWT uses Graphics2D, maybe it's possible portable it for display

I added a initial support for PCD8544 (Nokia 5110) (not based in I2C data communication

Test example, it's possible:

In future, port Display2D also is a good idea, I think

SrMouraSilva avatar Jan 18 '16 02:01 SrMouraSilva

Yes! That is the way to do it! Graphics (Graphics2D) is class to implement and everything else should use it! Now - do you want to contribute your impl. to pi4j project, maybe? Looking at your code I think we should have whole section for displays over here.

natdan avatar Jan 18 '16 08:01 natdan

@natdan , it's my clain :smile:

A rapid test https://www.youtube.com/watch?v=olnMZMNEJqk

I will implement the Graphics2D and forked the... What's the branch?

(I'm sorry by my bad english :no_mouth:)

SrMouraSilva avatar Jan 18 '16 11:01 SrMouraSilva

Let me know when you fork it. I've just procured i2c 128x64 bw display and I am happy to help - give you a hand. So if/when you fork it send me a pm or write here if you want some help.

natdan avatar Jan 19 '16 17:01 natdan

@natdan I'm preparing the code for fork and pull request :smiley: https://github.com/SrMouraSilva/JavaPedalMIDI/commit/21b58e22ec0a3a698643c6376711f37ae017fc07

SrMouraSilva avatar Jan 21 '16 02:01 SrMouraSilva

Thanks. BTW Forgot to say - it looks great! :)

natdan avatar Jan 23 '16 08:01 natdan

:)

SrMouraSilva avatar Jan 23 '16 17:01 SrMouraSilva

@savageautomate, please add RELEASE 2.0 to this because my pull request #84 use Java 8

SrMouraSilva avatar Mar 30 '16 21:03 SrMouraSilva