Pan Controller
So for my strange controller project I wanted to make use of the ultrasonic sensor component that my group had used in our previous project and after looking around my house for something to use with it I decided on using a frying pan. My controller is basically if someone decided to use a frying pan for simple button inputs when the pan is either held up in the air or has been put down. I attached the ultrasonic sensor on the side of the pan so that it can detect its distance from the ground. I put my CPX in the center of the pan and held down the battery pack and alligator clips with some tape. To finish it off I put a plastic sealing wrap over the top of it so that whatever is "cooking" on top of it won't mess with the electronics (In this case I put on a piece of bread).
When it comes to the code I used parts of code I've used for a previous group assignment to get the ultrasonic sensor detecting distance properly. Then I had it setup so that when its either at a close distance it will type in one key, while at a far distance from the ground it types another. When at a certain distance it constantly types in keys that the makeCode arcade uses for controller input. I used the same makeCode arcade game that I submitted for a previous lab to show off the controller working. So when the pan is put down it types in the 'A Button' to shoot, and when held up it types the 'B Button' to do a little dialogue prompt.
Comments
Please log in or sign up to comment.