Page 1 of 1
I2C Keyboard 8x8 device
Posted: Wed Dec 13, 2017 4:39 pm
by johnsondav
Hi everyone
I am working on a prototype device which, will scan a keyboard ( will be up to a full 80 plus keys) and send the key pressed to your project, using the I2C protocol. This device is independent to your project, therefore, it requires a FC7 component to communicate with it.
Everything is working well so far, but I need to be able to get the graphic the way I want it for the FC7 component. This is what it looks like so far:
- FC7_keyboard.jpg (27.24 KiB) Viewed 6883 times
Q. How do I get a suitable graphic of a keyboard to display correctly within FC7. When I put a jpeg file attachment to the component is only shows a white square.
I am hoping to get the device along with the tutorial guide on how to build it and the FC7 component, ready for early in the new year.
Regards
Dave
Re: I2C Keyboard 8x8 device
Posted: Wed Dec 13, 2017 7:51 pm
by LeighM
Hi Dave,
Sounds good
You could try adding the image as a resource, via the export component properties menu,
Then add a rectangle object and add the resource to the image property of the rectangle
Re: I2C Keyboard 8x8 device
Posted: Wed Dec 13, 2017 9:23 pm
by johnsondav
Hi LeighM
Thanks you for suggestion. This is what is displayed within the component build:
This is what is displayed when the component is placed in a project:
There is a small red exclamation mark next to the image file, not sure what it means.
Regards
Dave
Re: I2C Keyboard 8x8 device
Posted: Thu Dec 14, 2017 10:56 am
by LeighM
Thanks, yes, there is something odd here, I'm investigating...
Re: I2C Keyboard 8x8 device
Posted: Thu Dec 14, 2017 3:14 pm
by LeighM
Hi Dave
Well it looks like you have identified a recently introduced bug in the component resource feature, which is inhibiting their selection as an image to a drawing primitive.
The exported component will need the resource feature to work for images to be visible to component users. So it’s something that we have raised here as needing fixing in the Flowcode executable.
As a temporary workaround, using the absolute path, rather than relative, to the image for the image property should enable the image to be seen in the exported component. But only on your PC that has access to the image. Hopefully that will allow you to continue working on the component.
Regards,
Leigh
Re: I2C Keyboard 8x8 device
Posted: Thu Dec 14, 2017 3:41 pm
by johnsondav
Hi Leigh
Very much appreciate your help. However, putting the full extension details in has not solved the problem.
No matter, it will not prevent me from continuing to developing this component until such time the issue can be resolved.
Regards
Dave
Re: I2C Keyboard 8x8 device
Posted: Fri Dec 15, 2017 4:38 pm
by Benj
Hi Dave,
I've found a workaround using the Component -> Initialise event.
You add the image to the resource manager as usual.
Then enable the Initialise event and assign a macro.
Inside the event macro use the File.AbsPath function to get a path to the file as a string.
You can then assign this to the "Image" property of the component.
This seems to work well but obviously is not as cool as being able to load the image directly.
Here is a demo you can follow.
- v7.fcfx
- (8.24 KiB) Downloaded 273 times
Let us know how you get on.
Re: I2C Keyboard 8x8 device
Posted: Fri Dec 15, 2017 8:24 pm
by johnsondav
Hi Ben & Leigh
You guys are brilliant. Solved.
- Component1.jpg (81.11 KiB) Viewed 6819 times
Hope you both and your families have a wonderful christmas.
★˛˚˛*˛°.˛*.˛°˛.*★˚˛*˛°.˛*.˛°˛.*★Merry*★* 。*˛.
˛°_██_*.。*./ ♥ \ .˛* .˛。.˛.*.★* Christmas*★ 。*
˛. (´• ̮•)*.。*/♫.♫\*˛.* ˛_Π_____.♥Everyone ♥ ˛* ˛*
.°( . • . ) ˛°./• '♫ ' •\.˛*./______/~\*. ˛*.。˛* ˛.*。
*(...'•'.. ) *˛╬╬╬╬╬˛°.|田田 |門|╬╬╬╬╬*˚ .˛ ...
Regards
Dave
Re: I2C Keyboard 8x8 device
Posted: Fri Dec 29, 2017 8:33 pm
by johnsondav
Hi Everyone
The project to build this device is now available here:
viewtopic.php?f=66&t=19658
Here is the Keyboard/Pad component for you to place in your own component library:
Here is project that makes the keyboard component:
You will need this image file for the above project to create the component correctly:
- Keypad 4x4 copy.jpg (37.52 KiB) Viewed 6532 times
Right click and save the image to the same folder as the project.
Full construction details are provided for this project if you follow the above link.
Regards
Dave
Re: I2C Keyboard 8x8 device
Posted: Sat Jan 13, 2018 5:22 pm
by johnsondav
Hi Everyone
You may wish to experiment with using this component. Here is an example of how the keyboard component is used:
All the information required to follow this project is available using the above link.
Regards
Dave