Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: xbee api mode help!! on: June 12, 2013, 03:18:44 pm
Did you try to use XBee.h? This can solve the hedege of writing the "wrong" code. They also have great examples on using their library.

https://code.google.com/p/xbee-arduino/
2  Using Arduino / Networking, Protocols, and Devices / Re: HELP!! XBee Series 1 GPIO Star-Network Setup! on: June 12, 2013, 02:51:00 pm
PaulS: I have updated my diagram and setup to only focus on getting status of Button press of End Device. I removed the LED to make things a little simpler. However, I am not having any luck.
3  Using Arduino / Networking, Protocols, and Devices / Re: Help setting up an XBee mesh network for DIO on: June 11, 2013, 05:22:39 pm
Shnick: Have you made any progress? I am attempting do something similar to your Design. Take a look at my post: http://forum.arduino.cc/index.php?topic=171535.0

Jack Christensen: I have successfully upgraded the firmware of my XBee S1 to DigiMesh XB24-DM.
4  Using Arduino / Networking, Protocols, and Devices / Re: xbee api mode help!! on: June 11, 2013, 05:14:02 pm
if all you are going to do is Point-To-Point, then you dont really need to use API mode. You can just do Serial.print("a") and the results will go from Arduino 1 to Arduino 2 via XBees. Then you can write  IF statements and check if the data coming from Serial is "a" then the button was pressed?
5  Using Arduino / Networking, Protocols, and Devices / Re: xbee api mode help!! on: June 11, 2013, 05:06:51 pm
What type of XBees are you using?
6  Using Arduino / Networking, Protocols, and Devices / HELP!! XBee Series 1 GPIO Star-Network Setup! on: June 11, 2013, 05:04:37 pm
For what I want to accomplish I believe a Star-Network topology is sufficient. From my readings, I should be able to accomplish such topology via XBee S1.  At the moment, the coordinator is receiving API packets every 20ms, however, no matter how I press the buttons connected to End Device 1, the incoming API packets stay the same.  So I am not sure where the problem is. Are my configuration settings off? Did I miss something?


I am using Series 1 XBees, modem type XB24, function set: XBEE 802.15.4 and version 10EC.

Please advise. Any help is much appreciated!
7  Using Arduino / Project Guidance / Need help with XBee S1 I/O Network Design on: March 29, 2013, 12:42:39 pm
Hello Everyone!

Below I have a diagram showing a setup that I would like to achieve as a segway into bigger projects. I can successfully connect 2 XBees in a P2P setup: Coordinator (connected to PC) and an End Device (connected to an Arduino). However, I would like to work on 3+ XBees without using any Arduinos.



I would like to attempt building the above network, where I am able to control (on/off) the LED of all 3 XBees independently by a click of a button. At the same time, I would like to know/show which XBee (of the 3) had its button pressed.

Can my setup be done? Or, do I have to purchase DigiMesh XBees?

Any example would be very appreciated.
8  Using Arduino / Project Guidance / Re: Can we extend Arduino I2C pins? More SDA and SLC Pins? on: March 28, 2011, 01:32:48 pm
Quote
WTF.

Senso:

Could you direct me to the right bit-bang method?

I tried to implement Software I2C for Hmc6352 Compass http://www.arduino.cc/playground/Learning/Hmc6352.

I have looked at:
-------------------------------------------
SoftI2CMaster:
-------------------------------------------
.CPP: http://blinkm-projects.googlecode.com/svn/trunk/blinkm_examples/arduino/BlinkMSoftI2CDemo/SoftI2CMaster.cpp
.H:  http://blinkm-projects.googlecode.com/svn/trunk/blinkm_examples/arduino/BlinkMSoftI2CDemo/SoftI2CMaster.h

I did not use this because there is no Software RECIEVE method.
-------------------------------------------
SoftTWI:
-------------------------------------------
.CPP: http://code.google.com/p/fivevolt/source/browse/Quadcopter/Arduino/Telemetry/SoftTWI.cpp
.H: http://code.google.com/p/fivevolt/source/browse/Quadcopter/Arduino/Telemetry/SoftTWI.h

Code compiles but I always get 0.00 degrees. I used A5 and A4 because using Wire.H through the same code (replace every "compass." with "Wire."), I am able to get compass data. However, when I switch to SoftTWI I get 0.00.

Code:
#include "SoftTWI.h"

SoftTWI compass;

void setup()
{
  Serial.begin(9600); // Initiate Serial
  compass.attach(A5, A4);
  compass.begin();
}
 
void loop(){
  compass.beginTransmission(0x21);
  compass.send(65);     // Send "Get Data" command, info from Datasheet
  delay(100);         // interface command delay, info from Datasheet
  compass.requestFrom(0x21, 2); //get the two data bytes, MSB and LSB
  byte MSB = compass.receive(); // Result will be in tenths of degrees (0 to 3599)
  byte LSB = compass.receive(); // Provided in binary format over two bytes."
  compass.endTransmission();
  // Compute result from the two bytes results
  float myres = ((MSB << 8) + LSB) / 10;
  // Display result
  Serial.print(myres);
  Serial.println(" degrees");
  delay(1000);
}

Any thoughts?
9  Using Arduino / Sensors / Re: HELP! I cant get both HMC6352 Compass and ADNS2620 on ONE Arduino on: March 28, 2011, 01:09:00 pm
WillR:
I am looking at it from a "project design" perspective: Should I use two Arduinos for what I would like to accomplish OR there are other methods like extending I2C capability?
I have already went through the 2 arduinos approach, however, not happy.

John:
I will try this out and get back to you. I will cry if that works.

10  Using Arduino / Project Guidance / Re: Can we extend Arduino I2C pins? More SDA and SLC Pins? on: March 28, 2011, 01:03:42 pm
So using two arduinos is the only way to resolve this ASAP. It will take time to understand how ADNS-3000 would work, then I need to buy parts to have the complete mouse using ADNS-3000. Sparkfun has the breakout for ADNS2620, which is what I am using.

this sucks.
11  Using Arduino / Sensors / Re: HELP! I cant get both HMC6352 Compass and ADNS2620 on ONE Arduino on: March 28, 2011, 12:50:19 pm
Quote
You have two different devices.

If you test them individually do they function correctly? Did you test them?

When you say two you mean: HMC6352 & ADNS2620? Yes I did, here is the working code for each:

ADNS2620
Code:
#include <adns2620.h>
ADNS2620 mouse(18,19);

void setup()
{
    mouse.begin();
    delay(100);
    mouse.sync();
    mouse.write(CONFIGURATION_REG, 0x01);
    Serial.begin(9600);
}

void loop()
{
 if (Serial.available() > 0)
   {
      int incomingByte = Serial.read();

      if (incomingByte == 'a')
      {       
        int8_t delta_X = mouse.read(DELTA_X_REG);
        int8_t delta_Y = mouse.read(DELTA_Y_REG);
       
        Serial.print(delta_X, DEC);
        Serial.print(',');
        Serial.println(delta_Y,DEC);
      }     
   }
}

HMC6352
Code:
#include "Wire.h"

void setup()
{
  Serial.begin(9600); // Initiate Serial
  Wire.begin();
}
 
void loop(){
  Wire.beginTransmission(0x21);
  Wire.send(65);     // Send "Get Data" command, info from Datasheet
  delay(100);         // interface command delay, info from Datasheet
  Wire.requestFrom(0x21, 2); //get the two data bytes, MSB and LSB
  byte MSB = Wire.receive(); // Result will be in tenths of degrees (0 to 3599)
  byte LSB = Wire.receive(); // Provided in binary format over two bytes."
  Wire.endTransmission();
  // Compute result from the two bytes results
  float myres = ((MSB << 8) + LSB) / 10;
  // Display result
  Serial.print(myres);
  Serial.println(" degrees");
  delay(1000);
}

They both function correctly when either one of them is connected to the arduino alone. But together it will not work!
12  Using Arduino / Project Guidance / Can we extend Arduino I2C pins? More SDA and SLC Pins? on: March 28, 2011, 12:18:19 pm
I have a topic discussing my issue with getting an Optical mouse Sensor and Compass to work on a single Arduino here: http://arduino.cc/forum/index.php/topic,55891.0.html

The topic above is under "Sensors". I am not trying to double post, but I believe I need project guidance. My expensive way to "extend" arduino I2C is to just using another arduino unfortunately, which is making my project too big. Here is my current solution to communicate with two I2C devices:



Any guidance or help is much appreciated.
13  Using Arduino / Sensors / Re: Is it possible? Communicating with both HMC6352 Compass and ADNS2620 on: March 28, 2011, 11:47:13 am
How can I implement Software I2C for Hmc6352 Compass http://www.arduino.cc/playground/Learning/Hmc6352 ?

If I can get my compass to work through Software I2C using other pins, then ADNS-2620 should work correctly with A5 and A4.

I have looked at:
-------------------------------------------
SoftI2CMaster:
-------------------------------------------
.CPP: http://blinkm-projects.googlecode.com/svn/trunk/blinkm_examples/arduino/BlinkMSoftI2CDemo/SoftI2CMaster.cpp
.H:  http://blinkm-projects.googlecode.com/svn/trunk/blinkm_examples/arduino/BlinkMSoftI2CDemo/SoftI2CMaster.h

I did not use this because there is no Software RECIEVE method.
-------------------------------------------
SoftTWI:
-------------------------------------------
.CPP: http://code.google.com/p/fivevolt/source/browse/Quadcopter/Arduino/Telemetry/SoftTWI.cpp
.H: http://code.google.com/p/fivevolt/source/browse/Quadcopter/Arduino/Telemetry/SoftTWI.h

I am unable to get my code to work, I keep getting 0.00 degrees. I used A5 and A4 because using Wire.H through the same code (replace every "compass." with "Wire."), I am able to get compass data. However, when I switch to SoftTWI I get 0.00.

Code:
#include "SoftTWI.h"

SoftTWI compass;

void setup()
{
  Serial.begin(9600); // Initiate Serial
  compass.attach(A5, A4);
  compass.begin();
}
 
void loop(){
  compass.beginTransmission(0x21);
  compass.send(65);     // Send "Get Data" command, info from Datasheet
  delay(100);         // interface command delay, info from Datasheet
  compass.requestFrom(0x21, 2); //get the two data bytes, MSB and LSB
  byte MSB = compass.receive(); // Result will be in tenths of degrees (0 to 3599)
  byte LSB = compass.receive(); // Provided in binary format over two bytes."
  compass.endTransmission();
  // Compute result from the two bytes results
  float myres = ((MSB << 8) + LSB) / 10;
  // Display result
  Serial.print(myres);
  Serial.println(" degrees");
  delay(1000);
}

Any thoughts?
14  Using Arduino / Sensors / HELP! I cant get both HMC6352 Compass and ADNS2620 on ONE Arduino on: March 19, 2011, 05:15:01 pm
I would like to get values from both HMC6352 Compass and ADNS2620 using one arduino. I am currently using Arduino Duemilanove (ATMEGA328). The problem is that both of them use pins A4 & A5.

Looking at the "2 nunchuck with arduino" solution http://www.wiimoteproject.com/general-discussion/2-nunchuck-with-arduino-help/?PHPSESSID=affa1d7af16fe51558af75e5789dbd31 it is possible to switch I2C reading between two devices on pins A4 & A5.

I am ready to follow the "nunchuck solution", but current working ADNS2620 communication requires the use of ADNS2620.h where Wire.h is not used.

So, I would like to communicate with ADNS2620 using Wire.h, this way I COULD read both HMC6352 Compass and ADNS2620 data.

Am I on the right track?
15  Using Arduino / Project Guidance / Re: Making sense of Optical Mouse sensor data [ADNS2620] on: March 17, 2011, 05:59:55 pm
Korman,  it all makes sense now.

I initially used  int_8t, which resulted in compile errors. I tried to look it up but no luck. I then used uint8_t because it compiled (you pointed out I shouldn't).

However, int8_t did the trick. With all my decoding at the application level (C#), I am still missing a couple of tweaks; but I can handle them.

Final arduino code:

Code:
#include <adns2620.h>
ADNS2620 mouse(18,19);

void setup()
{
    mouse.begin();
    delay(100);
    mouse.sync();
    mouse.write(CONFIGURATION_REG, 0x01);
    Serial.begin(9600);
}

void loop()
{
 if (Serial.available() > 0)
   {
      int incomingByte = Serial.read();

      if (incomingByte == 'a')
      {      
        int8_t delta_X = mouse.read(DELTA_X_REG);
        int8_t delta_Y = mouse.read(DELTA_Y_REG);
        
        Serial.print(delta_X, DEC);
        Serial.print(',');
        Serial.println(delta_Y,DEC);
      }    
   }
}

Thanks for your help Korman!
Pages: [1] 2