pi4j-v1
                                
                                 pi4j-v1 copied to clipboard
                                
                                    pi4j-v1 copied to clipboard
                            
                            
                            
                        LCD: draw points/lines/ and other geometrical forms
Hi, What about improving the pi4j lcd library with the posibility to draw points, lines and base geometric forms ?
Lcd library uses WiringPi Lcd Library (http://wiringpi.com/dev-lib/lcd-library/). I dont know if are possible changes at points level
Yes, it's possible
https://github.com/noxo/SnakePI4J https://github.com/noxo/SnakePI4J/blob/master/src/org/noxo/devices/driver/JPCD8544.java
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...
"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
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
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
@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:
- Write text
- Set the font
- Draw image
- Draw lines
- Draw rects
- Fill rects
- Draw circle
- (Maybe) all of graphics features (i'm not tested all)
In future, port Display2D also is a good idea, I think
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 , 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:)
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 I'm preparing the code for fork and pull request :smiley: https://github.com/SrMouraSilva/JavaPedalMIDI/commit/21b58e22ec0a3a698643c6376711f37ae017fc07
Thanks. BTW Forgot to say - it looks great! :)
:)
@savageautomate, please add RELEASE 2.0 to this because my pull request #84 use Java 8