Loading...
  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?
2  Using Arduino / Project Guidance / RN-42 bluetooth module power saving on: February 19, 2013, 12:54:27 am
Hi,
I have been trying to use this module and I want to save power when I am not transmitting.
Here is the user manual - http://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf

Now My requirements are these
1. keep the module connected to my pc
2. transmit "Hello" to pc when a button pin 12 goes high on the arduino, this will happen by button press

So when I am not transmitting, I want to be able to keep the device in sleep mode. The command for that is SW,8000
However my module is still consuming 25 miliamps when not transmitting. Has anyone tried 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 -
Code:
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.
6  Using Arduino / Programming Questions / Re: Efficient shifting of values in arrays on: January 20, 2013, 08:47:57 am
Don't move data, move pointers to data.
Much quicker.


Can you give me a small example of how to do that?
Thanx
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?
8  Using Arduino / Project Guidance / Re: Bluetooth for sending keystrokes on: January 19, 2013, 02:16:43 am
Can anyone help?
9  Using Arduino / Project Guidance / Bluetooth for sending keystrokes on: January 17, 2013, 07:16:36 am
Hello!
I want to try and make a bluetooth remote to control my pc.

http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wireless/Bluetooth/RN-HID-User-Guide-v1.0r.pdf
Above is a link to the RN - 42 bluetooth module HID profile guide.

My question is this,
Can I use this module to directly send keystrokes to the laptop bluetooth without the use of any external dongle.
I mean if my microcontroller sends the required code via UART to the bluetooth, then the bluetooth will convert it according to the HID code, and when this is recieved by the bluetooth of my laptop, will the laptop be able to make sense of it?
10  Using Arduino / Programming Questions / Re: Millis(), an interesting problem on: January 10, 2013, 05:02:36 pm

[/quote]

I wouldn't worry too much, you're in very good company! smiley-grin
[/quote]

Thankyou! Really appreciate the kind of quick replies i get on this forum.
11  Using Arduino / Programming Questions / Re: Millis(), an interesting problem on: January 10, 2013, 02:30:28 pm
Well, that wasn't an interesting problem, it was an embarrassing one. smiley-red
12  Using Arduino / Programming Questions / Millis(), an interesting problem on: January 10, 2013, 01:38:09 pm

Quote
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. smiley
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?
14  Using Arduino / Project Guidance / Re: Crystal load capacitance on: January 06, 2013, 02:24:47 am
So suppose if I want to use a crystal with a load capacitance of 6pf, what should be the capacitance of the external capacitors i use?
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!!!
Pages: [1] 2