Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Networking, Protocols, and Devices / Re: Library for Digimesh S1 on: April 20, 2012, 04:45:57 am
i dont know if this is still relevent but i am using this library with digimesh
http://code.google.com/p/xbee-arduino/
2  Using Arduino / Sensors / Re: Analog Sensor with attachInterrupt() on: July 19, 2011, 01:41:38 pm
good example for use of the analog comparator
I Think you should add this code snippet to the playground
3  Using Arduino / Project Guidance / Re: modbus on: May 16, 2011, 04:22:02 am
I am using it alot
my work is based of modbusmq

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271505778
http://bazaar.launchpad.net/~marioquark-yahoo/modbusmq/modbusmq/files

however i found a small bug with using IP address containing zeros (192.168.0.1)
to fix find any strncpy in the code and replace with memcpy
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to create 3th interrupt on: December 07, 2009, 05:12:15 am
I am getting this error with your code
Code:

error: '__vector_3' was not declared in this scope
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Using Multiple sensors to eliminate errors on: November 26, 2008, 09:45:20 am
How to calculate witch sensor is wrong
6  Forum 2005-2010 (read only) / Syntax & Programs / Using Multiple sensors to eliminate errors on: November 25, 2008, 08:26:42 am
I am making water level control unit
And i want to eliminate errors by useing 3 analog presure sensors
And reporting an error if the reading from one sensor is off by alot
7  Forum 2005-2010 (read only) / Interfacing / Re: Digimesh on your XBee, anyone? on: March 01, 2010, 06:12:44 am
use X-CTU from Digi
http://ftp1.digi.com/support/utilities/40002637_c.exe

And Read page 10 of the documentation
http://ftp1.digi.com/support/documentation/90001003_A.pdf
8  Forum 2005-2010 (read only) / Interfacing / Re: Digimesh on your XBee, anyone? on: October 13, 2009, 07:41:23 am
can you please post some code examples using digimash
9  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: November 01, 2010, 03:14:45 am
you are not using the latest revision of the modbus code or you are missing a lot of parts from it

try downloading it again and only change to
Code:
Client client = 0;

in the beginning of the file
10  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: October 31, 2010, 08:56:51 am
I dont think so
11  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: October 31, 2010, 07:06:49 am
Can you post your code please
12  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: October 22, 2010, 07:06:01 am
this is a beginning of IP changer over Ethernet but i didn't manage to implement it fully in to the Modbus code
(i have managed to get it to work only by a switch at the beginning of the program before the loop)

Code:
#include <EEPROM.h>

#include <SPI.h>


#include <Ethernet.h>
#include <Wire.h>

#define maxLength 100

int stringtoint(String &s);

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 177 };
String inString = "";
int val;
Server server(80);

void setup()
{
  
    int DO_RESET_ETH_SHIELD = 8;
    pinMode(DO_RESET_ETH_SHIELD, OUTPUT);      // sets the digital pin as output
  digitalWrite(DO_RESET_ETH_SHIELD, LOW);
  delay(1000);  //for ethernet chip to reset
  digitalWrite(DO_RESET_ETH_SHIELD, HIGH);
  delay(1000);  //for ethernet chip to reset
  
  
  if ((EEPROM.read(1) != 0) && (EEPROM.read(1) != 0xFF)){
    
  ip[0] = EEPROM.read(1);
  ip[1] = EEPROM.read(2);
  ip[2] = EEPROM.read(3);
  ip[3] = EEPROM.read(4);
  
  }
  
  delay(100);
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.begin(9600);
  //BlinkM_beginWithPower();  
  //BlinkM_stopScript( blinkm_addr );  
}
void loop()
{
  
  
  
  
  int IP1=ip[0];
  int IP2=ip[1];
  int IP3=ip[2];
  int IP4=ip[3];
  
  
  
  Client client = server.available();
  if (client) {
    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        if (inString.length() < maxLength) {
          inString += c;
         }        
        
        
        if (c == '\n' && current_line_is_blank) {

          if (inString.indexOf("?")>0){
          
           int IP1p = inString.indexOf("IP1");
           int IP2p = inString.indexOf("IP2");
           int IP3p = inString.indexOf("IP3");
           int IP4p = inString.indexOf("IP4");
           int End = inString.indexOf("H");
          
           String IP1S = inString.substring((IP1p+4), (IP2p-1));
           String IP2S = inString.substring((IP2p+4), (IP3p-1));
           String IP3S = inString.substring((IP3p+4), (IP4p-1));
           String IP4S = inString.substring((IP4p+4), (End-1));
          
            IP1 = stringtoint(IP1S);
            IP2 = stringtoint(IP2S);
            IP3 = stringtoint(IP3S);
            IP4 = stringtoint(IP4S);
          
           EEPROM.write(1, IP1);
           EEPROM.write(2, IP2);
           EEPROM.write(3, IP3);
           EEPROM.write(4, IP4);
          
           /*
           Serial.print(IP1);
           Serial.print(".");
           Serial.print(IP2);
           Serial.print(".");
           Serial.print(IP3);
           Serial.print(".");
           Serial.print(IP4);
           */
           /*
           int IP1 = atoi(IP1S.toCharArray());
           int IP2 = atoi(IP2S.toCharArray());
           int IP3 = atoi(IP3S.toCharArray());
           int IP4 = atoi(IP4S.toCharArray());
          
          
          
          
          
           Serial.println(IP1+"."+IP2+"."+IP3+"."+IP4);
            
            */
            
          }
          
          
          
          /*
          if (inString.contains("?")) {
           int Pos_r = inString.indexOf("r");
           int Pos_g = inString.indexOf("g");
           int Pos_b = inString.indexOf("b");
           int End = inString.indexOf("H");
           r = atoi(inString.substring((Pos_r+2), (Pos_g-1)));
           g = atoi(inString.substring((Pos_g+2), (Pos_b-1)));
           b = atoi(inString.substring((Pos_b+2), (End-1)));  
           BlinkM_fadeToRGB( blinkm_addr, r, g, b );
         }
          */
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<html><head></head><body>");
          client.println("<h1>Network Settings</h1>");
          client.println("<h3>Saved IP is:  ");
          client.print(IP1);
          client.print(".");
          client.print(IP2);
          client.print(".");
          client.print(IP3);
          client.print(".");
          client.print(IP4);
          client.println("</h3>");
          client.println("<form method=get>IP:.......<input type=text size=2 name=IP1 MAXLENGTH=3><input type=text size=2 name=IP2 MAXLENGTH=3><input type=text size=2 name=IP3 MAXLENGTH=3><input type=text size=2 name=IP4 MAXLENGTH=3>&nbsp;<BR>");      
          //client.println("<form method=get>Subnet:<input type=text size=2 name=S1 MAXLENGTH=3><input type=text size=2 name=S2 MAXLENGTH=3><input type=text size=2 name=S3 MAXLENGTH=3><input type=text size=2 name=S4 MAXLENGTH=3>&nbsp;<BR>");  
          client.println("<input type=submit value=submit></body></html>");
          break;
        }
        if (c == '\n') {
          current_line_is_blank = true;
        } else if (c != '\r') {
          current_line_is_blank = false;
        }
      }
    }
    delay(1);
    inString = "";
    client.stop();
  }
}
 
 
 
 int stringtoint(String &s){
            int n;
           char carray[4];
           s.toCharArray(carray, sizeof(carray));
           n = atoi(carray);
           return(n);
 }
13  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: October 20, 2010, 12:51:01 pm
No i also couldn't get it to work with the DEBUG flag set.
but i thought it was because i used it with conjunction with i2c
so i just disabled  DEBUG  and moved on
14  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: October 20, 2010, 09:28:46 am
I think there is a problem with calling
Code:
Client client = server.available();
as a global


so change that line to
Code:
Client client = 0;

please tell me if this helps
for me it seams to fix the problem
15  Forum 2005-2010 (read only) / Development / Re: New Modbusmq project: Testers needed! on: June 10, 2010, 11:03:35 am
nice work
can you please explain a bit a about how to use it?
Pages: [1] 2 3 4