Show Posts
|
|
Pages: [1] 2
|
|
1
|
Using Arduino / Project Guidance / I2C working on Arduino Pro, but not working on MEGA 2560
|
on: May 17, 2013, 03:59:41 pm
|
|
Hi! I am trying to interface analog devices accelerometer ADXL 345 with arduino MEGA. I want to be able to use I2C to do it. I was able to get raw data from the accelerometer when i used Arduino Pro, but when working with Mega it does not give out raw values. The code is the same, and since mega has its SDA and SCL pins as 20 and 21 respectively, I have hooked up the SDA and SCL lines to those pins. In short what works with arduino pro, is not working with mega. I am using 3.3V supply from the mega. How can I resolve this?
|
|
|
|
|
3
|
Using Arduino / Programming Questions / Re: RN-42 Bluetooth HID Mouse
|
on: February 09, 2013, 07:45:02 am
|
Hi! I am facing this problem with this module - void setup() { Serial.begin(19200); }
void loop() { Serial.println("aaaaaaaaa"); Serial.println("bbbbbbbbb"); Serial.println("cccccccccc"); }
Now when i try to see this on the serial window, I get aaaaaa bbbbbbbbb ccc aaaaaaaaa bb cccccccc and so on.. A lot of characters are lost When i do this with a SPP module by bluesmirf, I get all the characters. Any idea why this might be happening?
|
|
|
|
|
4
|
Using Arduino / Programming Questions / Re: RN-42 Bluetooth HID Mouse
|
on: February 09, 2013, 07:38:56 am
|
Have you gotten your module to auto connect after a power cycle?
HI guys! For autoconnect you need to put the device in pair mode. You can get that mode by sending the command "SM,6" on the uart. In this mode the module will pair up with the last device. Works well for me.
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: Efficient shifting of values in arrays
|
on: January 20, 2013, 09:04:57 am
|
|
Well I am trying to get the min and max values from this data. I am not a frequent programmer, so not very well versed with the concept of pointers. I am struggling to understand this circular buffer thing.
The idea is that the newest reading from the accelerometer should enter the array at the first spot and subsequently push the oldest reading from the last spot. I do not get how circular buffer does that, could you please be a little elaborate. Thanks.
|
|
|
|
|
7
|
Using Arduino / Programming Questions / Efficient shifting of values in arrays
|
on: January 20, 2013, 08:38:39 am
|
|
Hi! I am using the accelerometer ADXL 345. I get the x_acc from the deivce. I want to store these values in an updating array of 50 values. So everytime I get a new value that gets updated in X[0] and every other value moves forward by 1 place. { X[0] = x_acc; for( int i = 49; i>0 ; i--) { X = X[i-1]; } }
But because of this long for loop i loose some values that come from the device. Is there a more time efficient way of doing this?
|
|
|
|
|
12
|
Using Arduino / Programming Questions / Millis(), an interesting problem
|
on: January 10, 2013, 01:38:09 pm
|
long t1 = 0; long t2 = 0; void setup() { Serial.begin(9600); }
void loop() { t1 = millis(); t2 = t1 - 1000; while(t2<t1) { t2 = millis(); } Serial.println("Hello"); }
Above is a simple code using millis function in arduino. According to me, it should print "Hello" on serial after a second passes. However "Hello" keeps printing all the time, there is not a delay of 1 second between 2 prints. Can anyone try this code and figure out why?
|
|
|
|
|
13
|
Using Arduino / Project Guidance / Re: Crystal load capacitance
|
on: January 07, 2013, 01:18:35 am
|
[/quote] You would rather trust Internet forums because random people on the Internet know better than the engineers who designed the chip? [/quote] Exactly the reason why I came to this forum, because I did not trust those random people.  The datasheet mentions a load capacitance of 12-22 pf for the crystal. However, I have had problems with selecting the capacitors. The standard we use with arduino is 18 pf crystal with 2 22 pf caps in series. So overall the capacitance becomes 18 + 11 = 29 pf. Now my question is this, If I use a 6 pf crystal, do I need to put caps which amount to an equivalent capacitance of 29-6 = 23 pf?
|
|
|
|
|
15
|
Using Arduino / Project Guidance / Crystal load capacitance
|
on: January 04, 2013, 01:43:55 pm
|
|
Hi! I am confused regarding the load capacitance of the crystal to be used. Some forums say 18 pf would be a good choice, but I do not understand how they arrive at that conlusion. I do understand that the caps we use along with the crystal are 22 pf each in series, so they form a capacitance of 11 pf effectively. So if I am using two 22 pf caps, which amounts to 11 pf capacitance, then what would be the right load capacitance of the crystal. This seems really critical because I am using I2C to communicate to my sensor. HELP PLEASE!!!
|
|
|
|
|