Show Posts
|
|
Pages: [1] 2
|
|
2
|
Using Arduino / Networking, Protocols, and Devices / Re: Bluetooth Clarification Needed
|
on: December 07, 2011, 05:12:19 am
|
Thank you! Keep in mind that this is a 3.3V board. If you are connecting it to a 5V Arduino, you may want to have a look at the last link on the sparkfun site on how to connect it safely.
Not a prob, i disabled atmega internal pullup editing the twi.c file, i will use external pull up to 3.3v
|
|
|
|
|
10
|
Using Arduino / Networking, Protocols, and Devices / Re: I2C 6 DOF IMU
|
on: November 18, 2011, 12:51:24 pm
|
Using this hardware is a bit more complicated than you think i use this sensors a lot, you can find a lot of well made tutorials, google fabio varesano or starlino for example. Btw for the adxl345 you have to: //Define byte to read: #define ACC (0x53) #define A_TO_READ (6)
// Init the sensor writeTo(ACC, 0x2D, 0); writeTo(ACC, 0x2D, 16); writeTo(ACC, 0x2D, 8);
//Use functions to get data out (following functions were made i think by fabio varesano)
void getAccelerometerData(int * result) { int regAddress = 0x32; //first axis-acceleration-data register on the ADXL345 byte buff[A_TO_READ];
readFrom(ACC, regAddress, A_TO_READ, buff); //read the acceleration data from the ADXL345 //each axis reading comes in 10 bit resolution, ie 2 bytes. Least Significat Byte first!! //thus we are converting both bytes in to one int result[0] = (((int)buff[1]) << 8) | buff[0]; result[1] = (((int)buff[3])<< 8) | buff[2]; result[2] = (((int)buff[5]) << 8) | buff[4]; }
//reads num bytes starting from address register on device in to buff array void readFrom(int DEVICE, byte address, int num, byte buff[]) { Wire.beginTransmission(DEVICE); //start transmission to device Wire.send(address); //sends address to read from Wire.endTransmission(); //end transmission Wire.beginTransmission(DEVICE); //start transmission to ACC Wire.requestFrom(DEVICE, num); // request 6 bytes from ACC int i = 0; while(Wire.available()) //ACC may send less than requested (abnormal) { buff[i] = Wire.receive(); // receive a byte i++; } Wire.endTransmission(); //end transmission }
//Writes val to address register on device void writeTo(int DEVICE, byte address, byte val) { Wire.beginTransmission(DEVICE); //start transmission to device Wire.send(address); // send register address Wire.send(val); // send value to write Wire.endTransmission(); //end transmission }
There are libraries for those sensors you can use if you want to simplify your work, remember the first rule of coding is not to reinvent the weel! Cheers
|
|
|
|
|
13
|
Using Arduino / Networking, Protocols, and Devices / I2C (SDA-SDL) Voltage problem
|
on: November 18, 2011, 07:44:45 am
|
|
Hi, i'm a little bit confused about the I2C and wiring library. I need to use a sensor witch need 3.3v both on the Vcc and on the SDA-SCL. From what i understood arduino has an internal pull-up resistor on SDA-SCL lines therefore their voltage is 5v, is this right? If this is right all i need to do is to disable the internal pullups and use two external pull-ups resistor between SDA-SCL and the 3.3v to have SDA-SCL running at 3.3v right?
Tx.
Gabriele
|
|
|
|
|
15
|
Using Arduino / Interfacing w/ Software on the Computer / problem installing pyserial
|
on: November 01, 2011, 05:18:51 pm
|
|
Hi, i'm trying to install pyserial on osx lion. when i launch install from terminal i have this error:
MacBook-Pro-di-Gabri:pyserial-2.5 Gabri$ python setup.py install running install running build running build_py running build_scripts running install_lib creating /Library/Python/2.7/site-packages/serial error: could not create '/Library/Python/2.7/site-packages/serial': Permission denied MacBook-Pro-di-Gabri:pyserial-2.5 Gabri$
what can i do to enable permission to create the folder?
tx
Gabriele
|
|
|
|
|