22 October 2023

Five Nights at Freddy's Controller


My controller was designed for the game Five Nights at Freddy's. With this in mind, I didn't make this controller thematic to the series I was more so focused on making the design most efficient for the gameplay and I think this does just that.

First and foremost this controller revolves around using the circuit playground bluefruits accelerometer to move the first person view. By tilting the controller to the left or right it will move the players view towards the left and right doors and leaving the box flat will point the view to the middle of the screen. On top of the box is the PIR motion sensor. Placing your hand above the motion sensor will open and close the door according to whichever direction you are facing. On the side of the box I have the potentiometer which will serve as a light switch for the hallways. This will also depend on whichever direction you are facing to determine which hallway light to turn on. I may move this light to the front of the box for convenience.

Pseudo Code

void setup()

{

Serial.begin(9600);

CircuitPlayground.begin();

}

void loop() 

{

read accelerometer x and y

rotate left = left arrow key

rotate right = right arrow key


Get light sensor reading

if true flip light switch


Get PIR sensor reading

if true flip door switch

}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.