Help with code type error argument num/types mismatch

My Code

from vex import *


while True:
    if controller_1.buttonX.pressed():
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
        drivetrain.turn_for(RIGHT, 180, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
    if controller_1.buttonA.pressed():
        drivetrain.turn_for(RIGHT, 90, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
        drivetrain.turn_for(RIGHT, 180, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
    if controller_1.buttonY.pressed():
        drivetrain.turn_for(LEFT, 90, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
        drivetrain.turn_for(RIGHT, 180, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
    if controller_1.buttonB.pressed():
        drivetrain.turn_for(LEFT, 180, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
        drivetrain.turn_for(RIGHT, 180, DEGREES)
        wait(5, SECONDS)
        drivetrain.drive_for(FORWARD, 500, MM)
        wait(20, SECONDS)
    wait(5, MSEC)

the code is spaced out right but how do you fix the error
(mods: fixed that for you)

use pressing() not pressed()

pressed would be used to register an event.

4 Likes