I am trying to program a "one armed bandit" slot machine using the bare metal approach in Arduino. I am struggling with the "load credit part" The system’s orientation must change from flat to left and back to flat for the credit to increase by one and I don't want the credit to be able to go above 15. Then when the orientation goes from flat to right back to flat I want to be able to "take the winnings and set the credit back to 0.The reason I'm finding it so difficult is because I have never used the bare metal approach before and I cannot use PinMode or digitalWrite. The main part I am struggling with is getting the seven segment display to increment its displayed value by 1 each time a credit is "added" using the accelerometer. I am using a seven segment display is anyone able to help?
Any help is appreciated
What I have tried:
float AccX, AccY, AccZ;
float GyroX, GyroY, GyroZ;