Take for instance the libconfig library: The rest are around 5.0 as they should. So I lose a bit for every byte, rather difficult to use… Do you have any idea for a solution/workaround?Ahhh, I rebooted and loaded i2c for 20000, now all clocks are around 25us! The 2017 Hackaday Prize; Design your concept; This project was created on 11/01/2016 and last updated 3 years ago. The device id is always 0x1d.I am having a problem with the MMA8452Q 3-axis accelerometer always getting a return of -1 with any read/write command.

Sounds obvious but with so many libraries having poor documentation this can be a simple thing that consfuses the hell out of you. just use the file descriptor returned by the Setup() code, but tell the setup code the device ID.The functions I’ve made are just wrappers round the standard ones provided by the Linux kernel – I’d really need to sit-down and have a look at your device in-detail. I’ve used wiringPi since getting my first Pi and I think it’s wonderful. Shouldn’t be too hrd to adapt some existing code if there is any though…Thank you Gordon. Returns

With wiringPi v2, you can even use the gpio command to run the i2cdtect program with the right parameters too: gpio i2cdSo the physical pins are always the same, the underlying BCM_GPIO pins change between board revs, but wiringPi sorts it out for you. Can I can some help please?I suspect you have 2 peripherals that you’ve used the same pinBase number for – ie. I2C1 on P1 and I2C0 on P5.It’s designed to use the correct one for the I2C interface on the GPIO connector on Pi you’re on – ie. I’ve used it recently with one of the popular RTC chips.ah just made a mistake… used wiringPiI2CWrite instead of write()I really did mean write() and not wiringPiI2CWrite()ok with write() it seems to be doing more than before.if(usiTwiDataInReceiveBuffer()) // if there is data in buffer if(b[1] == 0x01){ //check command designationNot sure to be honest with you – it’s been a long time since I’ve used I2C on the ATmegas – I did write my own driver for it though (master only though) so I’d need to go & look at the ATmega side of things.I am rather sure it is not that simple code needed to make an ATTiny 2313 listening as a slave to the master RPi. read (fd, &c, 1); (where c is unsigned char).Sequential mode will auto-increment an internal register address pointer after each read, so you can put it into sequential mode, then read register 0, then perform a read of 15 more registers and you’ll get the next 15 registers in a single operation.Personally, I’d stick to byte mode and do the full register poll each time I wanted to read the GPIO register on the chip – it’s slightly less efficient, but you know what to expect!In associating the SEQOP bit with the low-level mechanics of a 16-bit transfer I think was just adding two and two and making five, on the basis of an imperfect understanding of the data sheet. i.e.

Raspberry Pi Resources Our resources for other geeks, designers and engineers.

At least that's what I did in my single use of GTK.The easiest way to do this without using the Desktop ("...but is it possible to easely display images in the same manner without startx") would be to use You might consider a somewhat radical step and use Squeak. We hope you find the site helpful.Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. Check with the gpio -v command – it should give you version 2.xxNot sure why you were getting the undefined references though, but I guess it’s working now (by your next post?

Every peripheral you add into wiringPi needs to have a unique pinBase number. 100.

But when I call my program using wiringpi, I get always the last result that adafruit outputs.