Controlling a DC Motor through the Pi

hello, I wanted to see if anyone has tried controlling a DC motor? I know the GPIO library for xojo comes with servo motors and how to control them. But, I am struggling to do it with a DC motor.

GPIO.SetupGPIO

const kServoPin = 24

Dim servo As New GPIO.Servo(kServoPin)
///GPIO.PinMode(kLEDPin, GPIO.OUTPUT)

//While True
//GPIO.DigitalWrite(kLEDPin, GPIO.ON)
//App.DoEvents(500)

If servo.ErrorCode = 0 Then
servo.Neutral
App.DoEvents(500)
servo.Left

End If

GPIO.Cleanup
^^ this is some of the code that I’ve tried

I have changed my code a bit I am not sure if this would work

GPIO.SetupGPIO

const Pin1 = 24
const Pin2 = 23
const Pin3 = 35

GPIO.PinMode(pin1, GPIO.OUTPUT)
GPIO.PinMode(pin2, GPIO.OUTPUT)
GPIO.PinMode(pin3, GPIO.OUTPUT)

GPIO.DigitalWrite(Pin3,GPIO.ON)

GPIO.SoftPwmWrite(Pin3,100)

if Up is pressed
GPIO.DigitalWrite(Pin1,GPIO.HIGH)
GPIO.DigitalWrite(Pin2,GPIO.LOW)
App.DoEvents(500)
End If
GPIO.Cleanup()

Xojo is not the best option to work with GPIO but if you really want to do it, there is a book about this:

you mean a stepping motor?

No, a DC motor.

I’ll take a look into this thank you.