Hello, I am new to programming and I have been working on a game that involves several arduinos that communicate to each other via a HC12 433hrz module. I now want to attach one of these modules to a raspberry pi and build a user interface for the game in Xojo. I have been watching a bunch of tutorials including the one on making a Serial port dropdown menu which was very helpful but I still need a bit of assistance as I am getting error messages with anything that I write.
Ok so I found a serial controller that I named thisSerial and I figured some code would go in there like a DataAvailable event handler etc. What I am attempting to achieve is to…
- first off select the serial port (already accomplished by the tutorial).
- Set the baud rate perminataly to 9600
- Look for any data in the serial buffer and read it.
–prabably use MsgBox to display this so I can check the data is an integer between 1 and 63
- Save that data in a variable called ID (this should be an integer between 1 and 63)
I have two Canvas drawn on my window. This will be score counters for a player one and a player 2 and depending on what number ID is will determine what canvas is updated. So I need each canvas to display 0 to begin with…
- and then
a) if ID is between 1-5 add 1 to (player 1 Score canvas)
b) if ID is between 6 -10 add 1 to (player 2 score canvas)
That is essentially it so any help with this would be greatly appreciated. I want to add more features later like a
- reset button to reset the scores.
- A save button that will save the players score to a score board that can later be saved to a document
- an ability to add more players an assign them to ID numbers etc