Hi all .
I have finished a vtft project for stm32 .
It is only one screen and some buttons.
I want to add ir remote control commands via a nec protocol telecontrol.
In main loop i get Ir remote commands . IR is working fine .
I want to link ir command to an onclick event of a button.
How i can do it ?
Ir remote Access to Onclick events
Re: Ir remote Access to Onclick events
You do not say which compiler you are using. I only know how to do it in C.
Let's say that you program is called IRint...
The button should already be associated with an on-click event - that you will have given a name - say Action1
In the file IRint_events_code.c you will find functions for these events something like this:
All you do to simulate button push is call the appropriate function once your IR message is decoded in main program IRint_main.c.
Something like this:
Job done
Let's say that you program is called IRint...
The button should already be associated with an on-click event - that you will have given a name - say Action1
In the file IRint_events_code.c you will find functions for these events something like this:
Code: Select all
#include "IRint_objects.h"
#include "IRint_resources.h"
//--------------------- User code ---------------------//
//----------------- End of User code ------------------//
// Event Handlers
void Action1() {
Button1.Caption[0] = 0x31;
Button1.Caption[1] = 0x20;
DrawButton(&Button1);
}
void Action2() {
Button1.Caption[0] = 0x32;
Button1.Caption[1] = 0x20;
DrawButton(&Button1);
}
All you do to simulate button push is call the appropriate function once your IR message is decoded in main program IRint_main.c.
Something like this:
Code: Select all
// test code only - remove later // volume up on Logik remote
if(ir_cmd == 0xBF40){
Action1();
}
if(ir_cmd == 0xA25D){ // volume down on Logik remote
Action2();
}
Start every day with a smile...... (get it over with)
Re: Ir remote Access to Onclick events
Hi hexreader .
Project is in Mikropascal but I understand your example.
I didnt know that i could call onclick event functions from main program.
Thank you for your help.
Project is in Mikropascal but I understand your example.
I didnt know that i could call onclick event functions from main program.
Thank you for your help.