Hello,
I am confused as to how the 4D button works in "both" mode. I have searched through all the 4D systems pdf files and googled it but I am coming up blank. I can see it function correctly in the GTX tool but that does not seem to be how it works in the arduino code. Maybe I am missing something.
I have 4DButton7 setup as "both" and "Report Message" and what I am expecting is that my code shown below would turn "on" the built in Arduino LED while the button was pressed and turn it "off" when released. However, what I am seeing is that it turns on and stays on. It is as if it is not capturing the "00" when the button is released.
I have also attached a screen shot of the display settings. Any ideas?
void myGenieEventHandler(void) // Interface with screen
{
genieFrame Event;
genie.DequeueEvent(&Event); // Remove the next queued event from the buffer, and process it below
if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
{
if (Event.reportObject.object == GENIE_OBJ_4DBUTTON)
{
if (Event.reportObject.index == 7)
{
storeButton1 = genie.GetEventData(&Event);
while(storeButton1 == 1) {digitalWrite(LED_BUILTIN, HIGH);}
digitalWrite(LED_BUILTIN, LOW);
}
}
}
}

Thanks for any help,
-Erik
I am confused as to how the 4D button works in "both" mode. I have searched through all the 4D systems pdf files and googled it but I am coming up blank. I can see it function correctly in the GTX tool but that does not seem to be how it works in the arduino code. Maybe I am missing something.
I have 4DButton7 setup as "both" and "Report Message" and what I am expecting is that my code shown below would turn "on" the built in Arduino LED while the button was pressed and turn it "off" when released. However, what I am seeing is that it turns on and stays on. It is as if it is not capturing the "00" when the button is released.
I have also attached a screen shot of the display settings. Any ideas?
void myGenieEventHandler(void) // Interface with screen
{
genieFrame Event;
genie.DequeueEvent(&Event); // Remove the next queued event from the buffer, and process it below
if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
{
if (Event.reportObject.object == GENIE_OBJ_4DBUTTON)
{
if (Event.reportObject.index == 7)
{
storeButton1 = genie.GetEventData(&Event);
while(storeButton1 == 1) {digitalWrite(LED_BUILTIN, HIGH);}
digitalWrite(LED_BUILTIN, LOW);
}
}
}
}
Thanks for any help,
-Erik
Comment