Hi,
I would like to post a question regarding registers locations in e-puck. If i want to obtain current/voltage readings, what registers should i connect to be able to read the values? because i would like to connect a I2C device to my e-puck device to measure current/voltage level in the e-puck during motion. Lastly, I would like to know assuming i already know what registers to connect to, how do i locate the register locations in order to connect the probes of i2c devices to the robot? do i have to open up the robot? PS: this is the continuation of the question i posted earlier on, which was posted to the wrong person. Regards, Hao Ran ________________________________ From: #LIEW HAO RAN# Sent: Wednesday, November 06, 2013 5:37 PM To: Fabien Rohrer Subject: RE: [E-puck-user] Connecting I2C devices to e-puck Hi, >From what you say, i believe i just have to add in relevant libraries like >"#include <I2C/e_I2C_protocol.h>" and relevant statements like // #ifdef FLOOR_SENSORS e_i2cp_enable(); for (j=0; j<3; ++j) { buffer[i++] = e_i2cp_read(0xC0,2*j+1); buffer[i++] = e_i2cp_read(0xC0,2*j); } e_i2cp_disable(); #else for(j = 0; j < 6; j++) buffer[i++] = 0; #endif // into my current program to read the value , did i get your meaning correctlly? Also, how do we know what registers to read? for example in this example, we read 0xc0 to obtain ground sensor value, but what if i want to obtain current/voltage readings, what registers should i connect to? Lastly, to connect I2C devices, i believe we have to connect the probes of the I2C devices to the mobile robot, given that i know what registers to connect to, how do i know where the register is? do i have to open up the robot? Sorry for my novice questions. Regards, Hao Ran ________________________________ From: fabien.roh...@gmail.com <fabien.roh...@gmail.com> on behalf of Fabien Rohrer <fabien.roh...@cyberbotics.com> Sent: Wednesday, November 06, 2013 4:06 PM To: e-puck-user@gna.org Cc: #LIEW HAO RAN# Subject: Re: [E-puck-user] Connecting I2C devices to e-puck Hi Hao Ran, Some extensions implemented in Webots such as the ground sensors<http://www.e-puck.org/index.php?option=com_content&view=article&id=17&Itemid=18> are accessible by reading I2C. If you take a look at the Webots firmware (WEBOTS/transfer/e-puck/firmware/firmware.c), the ground sensor values are read like this: e_i2cp_enable(); for (j=0; j<3; ++j) { buffer[i++] = e_i2cp_read(0xC0,2*j+1); buffer[i++] = e_i2cp_read(0xC0,2*j); } e_i2cp_disable(); This file can be extended/recompiled to implement new features/device support. If you're interested in extending the cross-compilation mode rather the remote-control mode, please look at this file WEBOTS/transfer/e-puck/libepuck/libepuck.c. I hope this helps, Sincerely, -- Fabien Rohrer Responsible in software development Cyberbotics S?rl<http://www.cyberbotics.com/> PSE C - EPFL 1015 Lausanne Switzerland -- 2013/11/5 #LIEW HAO RAN# <hrli...@e.ntu.edu.sg<mailto:hrli...@e.ntu.edu.sg>> Hi, I would like to ask if it is possible to connect I2C devices to e-puck and read that device through my program? Btw, I'm using webots edu. Hao Ran Sent using OWA for iPhone _______________________________________________ E-puck-user mailing list E-puck-user@gna.org<mailto:E-puck-user@gna.org> https://mail.gna.org/listinfo/e-puck-user
_______________________________________________ E-puck-user mailing list E-puck-user@gna.org https://mail.gna.org/listinfo/e-puck-user