xojo / GPIO

A module for accessing the Raspberry Pi GPIO port using the Xojo programming language.
MIT License
14 stars 9 forks source link

i2C usage in Xojo #1

Open madhav1080 opened 8 years ago

madhav1080 commented 8 years ago

When I try using GPIO.i2cSetup, it returns an error, also the only i2cReadReg16, i2cReadReg8 are available, i need to use DS1307 RTC for a file server I am building and have run into the problem.

Similar is the case with GPIO.spiSetup

How can these be initialized in xojo, a sample example would be a great help

paullefebvre commented 8 years ago

What is the error? I don't have any way to test this myself. Are you able to connect manually using wiringPi from the command line? You might also check out the Einhugur Pi examples, which have some enhancements to the Xojo GPIO code (http://blog.xojo.com/more-raspberry-pi-projects).

The methods on the wiringPi site (http://wiringpi.com/reference/i2c-library/) are the ones that are implemented, so I'm not sure what other method you need.

madhav1080 commented 8 years ago

Thank you for the prompt reply, yes WiringPi is working from my other applications like python code for writing bytes & reading them out of FRAM FM24C64 i have connected to the Pi i2c Bus.

GPIO.i2cSetup(10), throws an error, I am trying to set the Device ID,

Cant access the functions such as i2Cwrite, i2Cread, spi

A example for i2c, SPi would be a great help, how do i first setup i2c & spi in Xojo, they are already enable through Rasp-config

Madhav Tenneti

Managing Director

@@@@@@@@@@@@@@@@@@@@@@@@@@

Spectrochem Instruments Pvt. Ltd.

B-23 Huda Complex, Saroornagar

Hyderabad, Andhra Pradesh

India 500 035

Phones: +91 402 420 1570 – 72 (3 Lines)

Fax: +91 402 420 1572

url: www.spectrochemindia.com

@@@@@@@@@@@@@@@@@@@@@@@@@@

Instrumentation Through Innovation

Our Home Automation, A customization of user convenience

On Thu, Dec 17, 2015 at 7:10 PM, Paul Lefebvre notifications@github.com wrote:

What is the error? I don't have any way to test this myself. Are you able to connect manually using wiringPi from the command line? You might also check out the Einhugur Pi examples, which have some enhancements to the Xojo GPIO code (http://blog.xojo.com/more-raspberry-pi-projects).

The methods on the wiringPi site ( http://wiringpi.com/reference/i2c-library/) are the ones that are implemented, so I'm not sure what other method you need.

— Reply to this email directly or view it on GitHub https://github.com/xojo/GPIO/issues/1#issuecomment-165455440.

paullefebvre commented 8 years ago

The Xojo GPIO library looks to me like it is correctly mapping to the wiringPi library calls, but I don't have a way to test it myself. Perhaps you have to run as Sudo?

You might also try asking in the Xojo Raspberry Pi forum to see if anyone else has tried this. https://forum.xojo.com/conversations/raspberry-pi