How to use Interrupts with an onscreen button on NHD-RTP-4.3FT800 Arduino Shield Display
Hello!
I have been writing a code following a motor moving a platform back to a "home location" using an optical limiter. I would like to use a button on the screen during this movement to be able to cancel the motion if anything goes wrong, but because I don't know how to set a button to interrupt the process, powering the motor is extremely slow due to having to refresh the screen everytime the loop is made (it goes until the optical limiter sees it). I think adding this button to an ISR would work great because then I would only need to power the motor and not have my microcontroller process the screen data and then take another step on the stepper motor I am using. Could someone show me an example of an onscreen button being used as an interrupt? Thanks in advance.
-
Hello CuriousEngineer,
Thank you for your interest in Newhaven Display!
Can you provide more information on the software used to drive the display?
Are you using a library or your own code to drive the FT800 IC?
If you have any questions, don't hesitate to ask.
Best Regards,
Cody Johnson
0 -
Hey Cody!
Thanks for the reply! I only just saw this, so sorry for the late response. I am using a github library (linked below) that I found from the Newhaven website for this screen. I am using Arduino language to program the screen and for my particular problem, I want to have a motor run while a button is displayed on the screen to stop the motor. I did this and the way I had programmed it, the motor would run really slowly because the display was refreshed during every loop the motor is runs. This is because it needs to be refreshed to see if the button is pressed. The motor runs excruciatingly slow so I'd like to find a way to make the motor run correctly while the button is refreshed in the background, either that or the opposite (whichever works right). Thanks!
Github Link: https://github.com/NewhavenDisplay/FTDI_FT801
0 -
Hello CuriousEngineer,
Thank you for the detailed explanation.
I recommend taking a look at this example program, specifically at the function at line 115. This function implementation may be a good reference when considering critical button inputs.
If you have any questions, don't hesitate to ask.
Best Regards,
Cody J.
0 -
Thanks so much, Cody!
I looked at that example and I didn't see that thanks so much!! I'll definitely ask here if I have any further problems.
Thankful and,
Staying Curious :)
0
Please sign in to leave a comment.
Comments
4 comments