2014年7月8日 星期二

LiveCode + Raspberry Pi - Light up a LED

Recently I bought a Raspberry Pi.
And I noticed that LiveCode has a RPi version installer on the download page.
so, I install LiveCode on my Rasberry Pi.
Write an external on LiveCode with C to control the GPIO.

Finally I can use a simple LiveCode Script to light the LED.
And event blinking an LED.
Here's what I wrote in LiveCode script


    haogpiosetup()
    repeat with x = 1 to 10
        put haogpiowrite(4,true)
        wait 1 sec
        put haogpiowrite(4,false)
        wait 1 sec
    end repeat

I use function instead of command just in case that I can be sure whether my external code are wrong.
If everything go well, my function will return "OK" 


I'll post my work here constantly.
If you're interesting in what I am doing. Please leave a message and let me know. :)

沒有留言:

張貼留言