The next stage in testing the Primus hardware is to make sure the buttons are working.Building on Primus 1, the button hardware is tested in the simplest possible way. Calling the readButton() function sets a number of exported variables indicating the button status.These are tested inside a loop in the main program. The UP and DN buttons each activate a different lamp while the GO button lights both lamps. The lamps then flash – you will see that it is necessary to call the readButton() function again to update the status of the keyPressed flag.Note that the buttons are connected to analogue input pins on this mouse. These pins need special configuration to ensure that they are treated as digital inputs rather than analogue. The pins chosen might also have been used for a quadrature encoder input which would require the same fixup.The complete project for stage 2 can be downloaded as a single ZIP file.this one seems big because I have added some automatically generated documentation created by Dozygen

197.7 KiB

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.