Python to xojo

Hi All,

Can anyone translate this python code to xojo?

import RPi.GPIO as GPIO
from time import sleep

GPIO.setmode(GPIO.BOARD)

Motor1A = 16
Motor1B = 18
Motor1E = 22

GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1E,GPIO.OUT)

print “Turning motor on”
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
GPIO.output(Motor1E,GPIO.HIGH)

sleep(2)

print “Stopping motor”
GPIO.output(Motor1E,GPIO.LOW)

GPIO.cleanup()

This is what I have tried but does not work,

GPIO.SetupGPIO

Const Motor1A = 16
Const Motor1B = 18
Const Motor1E = 22

’ Set the pin to accept output
GPIO.PinMode(Motor1A, GPIO.OUTPUT)
GPIO.PinMode(Motor1B,GPIO.OUTPUT)
GPIO.PinMode(Motor1E,GPIO.OUTPUT)

GPIO.DigitalWrite(Motor1A, GPIO.HIGH)
GPIO.DigitalWrite(Motor1B, GPIO.LOW)
GPIO.DigitalWrite(Motor1E, GPIO.HIGH)

App.DoEvents(500)

GPIO.Cleanup

Thanks

You should use CODE tags for posting code.

https://documentation.xojo.com/topics/raspberry_pi/gpio.html

https://documentation.xojo.com/topics/raspberry_pi/_making_a_led_light_blink_part_i.html