Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12c examples #19

Open
fred-dev opened this issue Apr 17, 2018 · 9 comments
Open

12c examples #19

fred-dev opened this issue Apr 17, 2018 · 9 comments
Labels

Comments

@fred-dev
Copy link

fred-dev commented Apr 17, 2018

Hi, there are some errors in the 12C examples, for the I2C scanner the OF version is actually without OF and throws, no rule to make target run

The straight 12c examples bails on the make.

I am trying to use an LIS3DH adafruit accelerometer, but I want to check the connection first...

@kashimAstro
Copy link
Owner

an anomaly has been reported to me with i2c on debian stretch.

what operating system are you working on?
you can pass me a: uname -a ?

now i'm traveling, in a few days i go back to the laboratory and try to understand the problem!

thanks!

@fred-dev
Copy link
Author

Hey, I get this:
Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux
I am also trying to get SPI for an MCP3008, I don't manage to get any input (I have used the chip before). In the meantime can you recommend a version of OF and the stretch/or previous OS for linux that will function?

@kashimAstro
Copy link
Owner

Hi @fred-dev ,

I just fixed the examples for the i2c bus scanner, now you should see the addresses on the bus!

the example for the openframeworks scanner wired the path to the device: /dev/i2c-1 in the code
you can modify it as you wish.

regarding SPI there should not be any problem, both the example i2c and SPI must be executed with a user who can access you device, you can check if your user belongs to the i2c group and spi with command: id or run the example with sudo.

you can also refer to this issues:
#18

for some additions made to the SPI class.
make sure the MCP example points to the right path for the SPI device you are using.

try to look at this example that takes the path of the spi device as a parameter in the setup method
https://github.com/kashimAstro/ofxGPIO/blob/master/example-mcp-simple-syntax/src/main.cpp

please let me know
Greetings

@fred-dev
Copy link
Author

fred-dev commented Apr 19, 2018 via email

@kashimAstro
Copy link
Owner

Hi, thanks for feedback!

unfortunately, I can only reach a remote raspberry that is in my office in Italy, while I am now in switzerland. I'd like to solve this, can you help me debug?

if you can! add a: cout << result << endl; to the scanner example, immediately after this line:
https://github.com/kashimAstro/ofxGPIO/blob/master/example-i2c-scanner/src/main.cpp#L28
and pass me the output.

Grazie!

@fred-dev
Copy link
Author

fred-dev commented Apr 19, 2018 via email

@kashimAstro
Copy link
Owner

kashimAstro commented Apr 19, 2018

the whole list contains only the value: 65415?
this is strange smbus should return 0 or 255 if it finds an address..
Is the chip connected when you run example?

@fred-dev
Copy link
Author

fred-dev commented Apr 28, 2018 via email

@kashimAstro
Copy link
Owner

Hi @fred-dev thanks for this,
in the next few days I solve this problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants