Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
Buttons Plugin
Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
Buttons Plugin
This is what I am trying to do. I have created hardware that simply mimics the buttons from a Matrix Orbital lcd. I want to be able to hook these buttons up to the serial port and be able to use them with a parallel HD44780 Display.
I have a few years of C++ experience that may be helpful in writing plugins, however I do not know if a plugin would be possible for this or the right option.
I am trying to get most of the functionality of matrix orbital buttons in lcd smartie, however the backlight option will not work.
Can you point me in the right direction?
Thanks
Jason
I have a few years of C++ experience that may be helpful in writing plugins, however I do not know if a plugin would be possible for this or the right option.
I am trying to get most of the functionality of matrix orbital buttons in lcd smartie, however the backlight option will not work.
Can you point me in the right direction?
Thanks
Jason
-
- Site Admin
- Posts: 104
- Joined: February 13th, 2005, 5:09 pm
- Location: UK
- Contact:
Although the plugin system isn't meant for implementing hardware support, I think it's possible to do what you want.
In LCD Smartie you would usually use $MObutton(X) in the event section to make use of key presses. What you could do is create a plugin that opens the serial port and reads from it (in it's own thread), and instead of using $MObutton, you could use $dll(yourdll,1,X,0) and your plugin could just check if the last key received from the serial port was X and return 1 if it was otherwise 0.
There's a basic sample C++ plugin available for download. On the palmorb site there's some basic serial code available for download.
Chris.
In LCD Smartie you would usually use $MObutton(X) in the event section to make use of key presses. What you could do is create a plugin that opens the serial port and reads from it (in it's own thread), and instead of using $MObutton, you could use $dll(yourdll,1,X,0) and your plugin could just check if the last key received from the serial port was X and return 1 if it was otherwise 0.
There's a basic sample C++ plugin available for download. On the palmorb site there's some basic serial code available for download.
Chris.
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
I get what your saying but, are you saying I can actually use the Actions menu with a dll? I cannot say
if $dll(....) > 1 then Playwinamp
it will not let me enter the dll string right after the if statement.
Can you post some example syntax for the plugin, so I can understand how to construct it.
Jason
if $dll(....) > 1 then Playwinamp
it will not let me enter the dll string right after the if statement.
Can you post some example syntax for the plugin, so I can understand how to construct it.
Jason
-
- Site Admin
- Posts: 104
- Joined: February 13th, 2005, 5:09 pm
- Location: UK
- Contact:
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
-
- Site Admin
- Posts: 104
- Joined: February 13th, 2005, 5:09 pm
- Location: UK
- Contact:
The best method is to do the serial port reading in it's own thread.
A cheap and dirty idea would be to save the last key as a global int variable and look at that when your function1 is called. A better but harder method is to use a global buffer containing unread keypresses, with a critrical section guarding accesses to it.
A cheap and dirty idea would be to save the last key as a global int variable and look at that when your function1 is called. A better but harder method is to use a global buffer containing unread keypresses, with a critrical section guarding accesses to it.
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
-
- Site Admin
- Posts: 104
- Joined: February 13th, 2005, 5:09 pm
- Location: UK
- Contact:
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
Ok I have created a thread that waits for a read of a buttons, if not it will time out after X amount of time. I think this will work, but here is the problem......... I have worked on the code a reguler .exe file and it works fine, however when I converted it to a dll it is giving me errors with functions. For example, I have
function 1 (x,x) (dll function 1, called as function 1 from smartie)
{
void Thread( void* pParams )
{ <-----
}
void main(void)
{ <----
}
}
it is giving me an error where the arrows are at, it is says:
error C2601: 'Thread' : local function definitions are illegal
error C2601: 'main' : local function definitions are illegal
is there a certain way to call function within .dll functions?
any ideas?
Thanks
Jason
function 1 (x,x) (dll function 1, called as function 1 from smartie)
{
void Thread( void* pParams )
{ <-----
}
void main(void)
{ <----
}
}
it is giving me an error where the arrows are at, it is says:
error C2601: 'Thread' : local function definitions are illegal
error C2601: 'main' : local function definitions are illegal
is there a certain way to call function within .dll functions?
any ideas?
Thanks
Jason
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan
-
- Hardware Genie - Plugin Author
- Posts: 374
- Joined: February 16th, 2005, 10:24 pm
- Location: Michigan