beagleboard / bonescript

Scripting tools for the BeagleBoard and BeagleBone
http://beagleboard.org
MIT License
32 stars 9 forks source link

i2c port format? #55

Open mzwtjp opened 6 years ago

mzwtjp commented 6 years ago

I am trying to use i2c, but I can see I have to pass ata like below as 'port' parameter to i2c functions. (Not simply '/dev/i2c-1', etc.)

Trying to open /dev/i2c-1 and scan devices:

var x = [ '/dev/i2c-2', 0x20 ];

b.i2cOpen(x, { device: '/dev/i2c-1'}, function(err) { ... }

b.i2cScan(x, function(err, data) { ... }

Is this expected? Sorry to be lazy but what exactly the format to be used here? I can see below change that might have something to do with this..?

i2c: move address definition to port

https://github.com/beagleboard/bonescript/commit/c2bc109e0eb9fe0e711922a38219b903d9dcfba9#diff-9f08fda3dc96b65b6bb787e899d80703