Hi.
I built on the Xojo’s sample project “LED Blink for Raspberry Pi”. Build was successful, and I send a directory to Raspberry Pi using SCP. And I was install “Wiring Pi”.
If that looks ok, add a few print commands to your app that give you a clue where the app fails, if it does so.
And make sure you got the wiring set according to the selected pin in your app. Check the LED to see if it will light up at all.
$ cat ~/test.py
#!/usr/bin/env python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
while True:
GPIO.output(11, True)
time.sleep(2)
GPIO.output(11, False)
time.sleep(2)
$ gpio -v
gpio version: 2.32
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Raspberry Pi Details:
Type: Model B+, Revision: 02, Memory: 512MB, Maker: Sony
* Device tree is enabled.
* This Raspberry Pi supports user-level GPIO access.
-> See the man-page for more details
-> ie. export WIRINGPI_GPIOMEM=1
My Xojo’s source file is like below. I tryed to any GPIO pin numbers such as 0, 11, 4 or something.
System.DebugLog("Test")
GPIO.SetupGPIO
Const kLEDPin = 0 // "#4" on the pinout
// Set the pin to accept output
GPIO.PinMode(kLEDPin, GPIO.OUTPUT)
// Blink LED every 1/2 second
While True
// Turn the pin on (give it power)
GPIO.DigitalWrite(kLEDPin, GPIO.ON)
App.DoEvents(500)
// Turn the pin off (no power)
GPIO.DigitalWrite(kLEDPin, GPIO.OFF)
App.DoEvents(500)
Wend
Build is fine, but excute finished soon and no display any debug message.
Thank you guys!
I’m fine by changing Raspberry Pi 2 Model B.
My code is below.
System.DebugLog("Test")
GPIO.SetupGPIO
Const kLEDPin = 4 // "#4" on the pinout
// Set the pin to accept output
GPIO.PinMode(kLEDPin, GPIO.OUTPUT)
Dim status as Boolean
// Blink LED every 1/2 second
While True
// Turn the pin on (give it power)
if status = True then
GPIO.DigitalWrite(kLEDPin, GPIO.ON)
Else
GPIO.DigitalWrite(kLEDPin, GPIO.OFF)
end if
App.DoEvents(500)
status = Not(status)
Wend