10 March 2025

Scaffolding: Progress Review Austin Frunk and Brayan Soto

 We have decided to go with a controller that plays the classic doom game. In the spirit of running doom on anything. Anything less than a creative controller would be not in spirit of doom. Thematically we have decided to go with a skull to fall in align with the graphic nature of the game. We also chose doom due to it being locked on the X and Y axis for aiming. Using a gyroscope for moving and clicking the jaw for shooting and a slider for weapon select. We feel this is the perfect way to really make doom come to life.

Sketch:

Schematic:
Code:
SET THRESHOLD_ACCEL = number
SET THRESHOLD_SOUND = number

SET lastSliderSlot = 0

LOOP:

    READ X and Y from accelerometer

    // Up/Down (Y Axis)
    IF Y > THRESHOLD_ACCEL:
        SEND "Up" arrow key down
    ELSE:
        SEND "Up" arrow key release

    IF Y < -THRESHOLD_ACCEL:
        SEND "Down" arrow key down
    ELSE:
        SEND "Down" arrow key release

    // Left/Right (X Axis)
    IF X > THRESHOLD_ACCEL:
        SEND "Right" arrow key down
    ELSE:
        SEND "Right" arrow key release

    IF X < -THRESHOLD_ACCEL:
        SEND "Left" arrow key down
    ELSE:
        SEND "Left" arrow key release


    READ sound_level from sound sensor

    IF sound_level > THRESHOLD_SOUND:
        SEND "Space" key down
    ELSE:
        SEND "Space" key release


    READ sliderValue from pin as slot

    IF slot != lastSliderSlot:
        // Only send the key press if the slot changed
        SWITCH slot:
            CASE 1: SEND "1" key press, then release
            CASE 2: SEND "2" key press, then release
            CASE 3: SEND "3" key press, then release
            CASE 4: SEND "4" key press, then release
            CASE 5: SEND "5" key press, then release
            CASE 6: SEND "6" key press, then release
            CASE 7: SEND "7" key press, then release
            CASE 8: SEND "8" key press, then release
        END SWITCH

        lastSliderSlot = slot


    READ Jaw value from pin

    IF circuitPinValue == HIGH:
        SEND "Ctrl" key down
    ELSE:
        SEND "Ctrl" key release

No comments:

Post a Comment

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