It’s been a hot minute since I’ve actually had to perform any coding, but if I know that what I’m trying to accomplish will actually work, it’s a worthwhile uphill battle. The Xbee can receive input as UART, SPI, regular GPIO, and it even has analog input as well. The plan was to figure out how the proffie is reading the angular data and just pass it along to the xbee. Soldering will probably have to happen eventually, but I will of course do that once I have a saber of my own. For now, I’ll see if I can make do with jumper cables and a breadboard.
When I say “angular position”, what I mean is that I need to be able to sense if the player is literally tilting the saber towards the left or right, a.k.a raw x/y/z values. My “neutral” position would be if the saber was sticking straight-up, perpendicular to the ground (0,0,0). So the left/right position would be relative to the user (i.e. if you’re facing the machine and you angle the saber to the left, the left flipper would activate and remain active until it’s returned to the upright position). The player should always be facing the machine, and the orientation of the saber should always be the same (the “on” button on the hilt always faces the player, it never rotates in-hand). And it’s important for me to measure position and not velocity/force, because if the player holds the saber in a 45-degree angle tilting left (I’ll play around with the appropriate angle to trigger a flip, this is just an example), it needs to consistently send those x/y/z values so that the flipper remains active. If I were to measure the velocity/force, it would trigger the flipper upon the initial movement, but stop triggering the moment they try to hold that position. This is where I was worried it would be difficult, because playing around with the saber I can tell that force is tracked and different sounds are played depending on how hard I swing. One thing that gives me hope though is that when I hit the “blaster” effect, depending on the orientation of the saber, a certain point on the blade lights up. Holding the saber straight up lights the “blaster” effect near the hilt, and pointing it straight down lights it up near the tip. So I know that there’s some sensor able to track it’s vertical position and change where to light up the blaster on the blade. I tried left and right and it just lit near the center-ish, so whatever sensor that is might not be tracking that particular axis.
In terms of the code, I believe you’re on the right track on how I need to be constantly calling for Fusor (or whatever the relevant library will be) and relaying that to the other radio module. Xbees merely help establish a wireless connection where there currently isn’t one. They come with Micropython nowadays so I don’t even need a separate microcontroller. I could just read in the x/y/z values, pump them into Micropython, and depending on the values I can send high/low data signals to the flippers. So the proffie board itself doesn’t need to necessarily know if left is left and right is right, it just needs to be able to tell me the current x/y/z values the accelerometer is reading, and a Micropython program will determine what those values represent.
I would absolutely accept assistance in any fields dealing with the intricacies of the Proffie board. I’m trying to merge two worlds that I have very little experience in. Again, this seems like it’ll hopefully be a painless effort, assuming I’m relaying my goal accurately. I’m not doing any major modification of any kind (or any modification, really), I’m just trying to read data from a sensor and play some pinball using the force!