Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Raspberry Pi / How to read write the GPIO in AGK2 - raspberry Pi

Author
Message
Jo Bach
2
Years of Service
User Offline
Joined: 22nd Dec 2014
Location:
Posted: 17th Aug 2016 20:53
AGK Runs fine on the PI but...

I can't find a simple example (e.g. turning a led on and off) in the manual and forum about read or writing the GPIO.

I know it with the termial, but I want to do it with AGK2, like pressing a button in AGK2.

Can I do it with the standard basic or do I need C++?

thank you.
BatVink
Moderator
14
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Aug 2016 06:20
You read/write the pins like a file with a special name...

pin1 = OpenToRead("GPIO:1")
in = ReadByte(pin1)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2017-04-24 23:58:32
Your offset time is: 2017-04-24 23:58:32