Show Posts
Pages: [1]
1  Development / Other Software Development / Re: I wrote a library for the Microchip EEPROMS 24LC256 and 24LC512 on: October 14, 2012, 05:05:48 pm
I was going to do that, but I am leaving that to the programmer who is using the lib.  I wanted to keep this lib as small as possible to allow for a small footprint on the MCU.  I do see the advantage of this but I can also see some performance issues as well.  If there is a large enough request, I can throw it in there and update the repo.

Thanks for your feedback!
2  Development / Other Software Development / I wrote a library for the Microchip EEPROMS 24LC256 and 24LC512 on: October 14, 2012, 11:03:21 am
I have been working on a library to make it easy to interface to the Microchip 24LC256 and 24LC512 Chips. 

The lib currently supports the following:
byteRead
byteWrite
pageRead*
pageWrite*

The lib is semi-configurable by running a begin function that sets the address and sets the mode of the chip (256 or 512).

*  pageReads and pageWrites are done using a 16 byte burst mode.  This is to overcome the limitation by the Wire Library in which the internal TX and RX buffer is 32 bytes.
I have also included a test Arduino sketch that exercises corner cases of the above functionality and random reads / writes. 

The library is available for download at: http://github.com/mikeneiderhauser/I2C-EEPROM-Arduino
The library is released under the LGPL license.

I have only tested it under Arduino IDE V1.0.1.

Hope this helps everyone trying to use these chips!
3  Community / Exhibition / Gallery / Re: Portable console on: October 08, 2012, 03:04:45 pm
Quote
Thank you very much !
The screen module costs 13$ on eBay (search "1.8 LCD module"), and the screen alone costs 7$. The library is this one : http://www.bestelecs.com/download/lcd/1.8SPI.zip.
I don't know if I will do an instructable, there is a lot of information in the video, and doing instructable take a lot of time, and I'm not sure people are interested in that...
Here is another project I made with this screen module : http://r0d0t.tumblr.com/post/23671409352

I downloaded the 1.8SPI lib but for some reason I cannot get it to verify with the arduino code.  What IDE version did you use?

Error in IDE 1.0 & IDE 1.0.1
Quote
In file included from doudeul4.cpp:1:
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:6:22: error: WProgram.h: No such file or directory
In file included from doudeul4.cpp:1:
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:57: error: expected `)' before 'CS'
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:59: error: expected `)' before 'CS'
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:64: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:65: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:65: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:65: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:66: error: 'int16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:66: error: 'int16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:66: error: 'int16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:66: error: 'int16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:66: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:67: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:68: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:68: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:69: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:69: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:70: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:70: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:71: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:71: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:72: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:72: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:72: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:73: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:73: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:74: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:74: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:74: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:74: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:75: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:76: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:76: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:76: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:76: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:77: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:78: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:78: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:78: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:79: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:80: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:80: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:80: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:81: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:83: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:83: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:84: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:84: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:85: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:85: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:86: error: 'uint16_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:86: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:88: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:89: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:91: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:91: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:91: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:91: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:92: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:93: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:96: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:97: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:107: error: 'uint8_t' has not been declared
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:110: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:111: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:112: error: 'uint8_t' does not name a type
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:114: error: 'uint8_t' does not name a type
In file included from doudeul4.cpp:2:
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:55: error: redefinition of 'class ST7735'
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:55: error: previous definition of 'class ST7735'
doudeul4:16: error: no matching function for call to 'ST7735::ST7735(int, int, int)'
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:55: note: candidates are: ST7735::ST7735()
D:\Users\Mike\Dropbox\Arduino\arduino-1.0\libraries\ST7735/ST7735.h:55: note:                 ST7735::ST7735(const ST7735&)

Thanks
4  Community / Exhibition / Gallery / Re: Portable console on: October 04, 2012, 08:19:27 pm
Awesome Project!  I just placed an order to get the screen online.  What are you looking for in v2.0  I may be able to help (however my time is very limited)
5  Development / Other Software Development / Re: EEPROMex library - An extension of the standard Arduino EEPROM library on: August 08, 2012, 07:35:35 pm
Any chance of getting this to work with the 24LC256 I2C eeprom?
6  Development / Suggestions for the Arduino Project / IDE Suggestion... any takers? - Collasapable Code Segments on: January 15, 2012, 01:06:56 am
I believe that the IDE can be improved / modded to support collasapable Code such as in visual studio.

Does any one else agree?
7  Using Arduino / Programming Questions / Re: SoftwareSerial in Arduino IDE V1.0 on: January 14, 2012, 05:08:41 pm
I am sending all 50 chars to try to save some consistency between the 2 sketches. this way I know that I always need to read 50 chars and I dont need to send a msg head...

for some odd reason it started to work and the message is now going across the softSerial.  I think what might have happened as Paul S commented on commenting out the x10.  This gave me the idea to connect the x10 transceiver up to the wall outlet.  Whet i didn''t know was that the x10 transceiver needed to be connected in order to actually execute the lib code.  I thought there was a timeout associated with the x10 lib.  At the time of posting this I did not have x10 transceiver powered up.  I had the cables in place, but the x10 transceiver was not plugged in.  Therefore the command in the setup was never being executed and was halting the sketch.

Also.  Paul S... do you think I should only send up to the NULL terminator in the sBuffer to the other arduino?  It would make the code a little bit more robust.  This being stated... is there some type of malloc that I could use to dynamically handle the char array. or should I just make my buffers on the first Arduino larger?

Thanks for all of your help
8  Using Arduino / Programming Questions / Re: SoftwareSerial in Arduino IDE V1.0 on: January 14, 2012, 11:22:37 am
There is noting I can really do about the link....  That how this project works.. it uses the ethernet shield.  That url is read in from the client as a HTTP request..... i could post that

the Serial.print is printing the whole array (up until the NULL termination)  that is how the Serial Print in arduino IDE 1.0 (and if i remember most standard c libs) work.  It is printing what I expect: "?house=A&dev=02&ctrl=0" after the zero there is a null termination.  This causes the char array to act like (how i see it) a streaming string.  It will stop at the Null termination.

As for the 2nd arduino read, one of those are supposed to be commented out as well as the same version in the arduino 1 code.  I dont know why the comment didnt copy.  but they essentially should be XOR'd.


Below is the http request that the ethernet server will get... the lights.htm is indeed located on the sd card and the client receives the HTTP 200 version of the request

Quote
GET /lights.htm?house=A&dev=02&ctrl=1 HTTP/1.1
Ho

That is the readRequest buffer after it fills.. and was generated but the URL:
Quote
192.168.1.62/lights.htm?house=A&dev=02&ctrl=1

Let me know if any more clarity is needed.

Thanks

9  Using Arduino / Programming Questions / Re: SoftwareSerial in Arduino IDE V1.0 on: January 14, 2012, 10:57:10 am
Here is the full code as requested.
The sBuffer is being filled previously in the code on Arduino 1 (around line 190) and right before I send it over serial, it is printed to the SerialMonitor over USB.  This is how I know its terminated properly due to the fact that I dont get garbage in the Serial Monitor.

The serial sending is at the bottom of Arduino 1 code and in a function called sendMessgeToSlave.

Arduino 1
Code:
/*
  Web Server
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * SD on 4
 * connect ground to ground
 Pin 2 connected to Pin 3, Pin 3 connected to pin 2 on other arduino
 */
#define DEBUG
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
#include <SoftwareSerial.h>

#define resetRelay 7
#define zcPin 9
#define dataPin 8
//MAC ADDRESS CHANGED FOR ONLINE POSTING
byte mac[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
IPAddress ip(192,168,1, 62);

EthernetServer server(80);
//vars to parse http request

//HTTP request Buffer
int _readRequestSize = 50;
char readRequest[50] = "";
int requestPos = 0;
int validPage = 0;

//default URL
char baseURL[10] = "index.htm";

//Serial Buffer
int _sBufferSize=50;
char sBuffer[50];
int realSBufferSize=0;
int sendCommand=0;

//generic loop var
int i = 0;

//parsing variables
int spaceIndex = -1;
int slashIndex = -1;
int dotIndex=-1;

int lockSlash= 0;
int lockDot=0;
int lockSpace=0;

//mode for reset var.
int mode =0;


SoftwareSerial ss(2,3);

void setup()
{
  Serial.begin(9600);
  ss.begin(9600);
 
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

  //Start SD
  pinMode(10, OUTPUT);
  SD.begin(4);

  //relay Reset
  pinMode(resetRelay,OUTPUT);
  digitalWrite(7,LOW);
  Serial.print("init Done");
}

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("Client Connected\nReading Request");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;

    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //start to copy request into buffer
        if(requestPos < _readRequestSize)
        {
          readRequest[requestPos] = c;

          requestPos++;
        }

        if (c == '\n' && currentLineIsBlank) {
          //start response to client
          //reset counter
          requestPos=0;

          Serial.println("Begin Request Parser");
          //readRequest Parser
          for(i=4;i<_readRequestSize;i++)
          {
            if(readRequest[i]=='/'&&!lockSlash)
            {
              slashIndex=i;
              lockSlash=1;
            }
            else if(readRequest[i]=='.'&&!lockDot)
            {
              dotIndex=i;
              lockDot=1;
            }
            else if(readRequest[i]==' '&&!lockSpace)
            {
              //space index
              spaceIndex=i;
              lockSpace=1;
              break;
            }
          }//end for

#ifdef DEBUG
          Serial.println("Slash : Dot : Space");
          Serial.print(slashIndex);
          Serial.print(" : ");
          Serial.print(dotIndex);
          Serial.print(" : ");
          Serial.println(spaceIndex);
#endif

          //requestPos = urlLength
          if(dotIndex==-1)
          {
            Serial.println("NO URL -> Pushing Index");
            //no url given
            requestPos=10;
          }
          else
          {
            requestPos = (dotIndex+3)-(slashIndex);
          }

          //create url charArray
          char url[requestPos];

          if(dotIndex==-1)
          {
            for(i=0;i<requestPos;i++)
            {
              url[i] = baseURL[i];
            }
          }
          else
          {
            for(i=0;i<requestPos;i++)
            {
              url[i] = readRequest[i+slashIndex+1];
            }
          }

          //add null term
          url[requestPos]=NULL;
#ifdef DEBUG
          Serial.print("\nURL: ");
          Serial.println(url);
#endif


          if((dotIndex != -1)&&(spaceIndex != (dotIndex+4)))
          {
            Serial.println("Grabbing Env Vars");
            //grab rest of message
            requestPos = (spaceIndex) - (dotIndex+4);

            //flag to send
            Serial.println("Setting sendCommand");
            sendCommand=1;

            //copy over buffer
            for(i=0;i<requestPos;i++)
            {
              sBuffer[i] = readRequest[i+dotIndex+4];           
            }
            realSBufferSize=requestPos;
           
            //add null termination
            sBuffer[requestPos]=NULL;
          }//end if dotIndex

          //parsing for URL
          requestPos=0;
          String URL = String(url);
          URL.trim();
          if(URL.equals("resetServer.htm"))
          {
            URL = String("index.htm");
            mode=-1;
          }
 
          Serial.println("Checking for file");
          char file[URL.length()+1];
          URL.toCharArray(file,URL.length()+1);
          Serial.print(file);
          //parse here
          File doc = SD.open(file);
          if(doc)
          {
            // send a standard http response header
            Serial.println("File Found");
            client.println("HTTP/1.1 200 OK\nContent-Type: text/html\n");
            validPage=1;
            while (doc.available())
            {
              client.print((char)doc.read());
            }
            doc.close();
            if(validPage && sendCommand) sendMessageToSlave();
          }
          else
          {
            Serial.println("File not found");
            client.println("HTTP/1.1 404 Not Found");
            validPage=0;
          }

          //exit client loop
          break;
        }

        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        }
        else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }

    // give the web browser time to receive the data
    delay(1);
    // close the connection:
#ifdef DEBUG
    Serial.println("\nClient disconnected");
#endif
    client.stop();

    resetGlobalVars();
  }//end client

  //reset
  if(mode==-1)
  {
    mode=0;
    digitalWrite(resetRelay,HIGH);
  }
}

void resetGlobalVars()
{
  Serial.print("Resetting Golbal Vars");
  for(i=0;i<_readRequestSize;i++)
  {
    readRequest[i]=NULL;
  }

  for(i=0;i<_sBufferSize;i++)
  {
    sBuffer[i]=NULL;
  }

  spaceIndex=slashIndex=dotIndex=-1;
  lockSlash=lockDot=lockSpace=0;
  requestPos=validPage=sendCommand=0;
}

void sendMessageToSlave()
{
  //implement soft serial to other device
  Serial.println("Send Message To Slave!");
  Serial.print("sBuffer:\n\t");
  Serial.println(sBuffer);
  //See aprrox Line 193 for termination
  for(i=0;i<50;i++)
  {
    ss.print(sBuffer[i]);
    ss.write(sBuffer[i]);
  }
}


Arduino 2
Code:
// include the X10 library files:
#include <x10.h>
#include <x10constants.h>
#include <SoftwareSerial.h>

#define zcPin 9         // the zero crossing detect pin
#define dataPin 8       // the X10 data out pin
#define repeatTimes 3   // how many times each X10 message should repeat

x10 myHouse =  x10(zcPin, dataPin);
SoftwareSerial ss(2,3);

void setup() {
  // begin serial:
  Serial.begin(9600);
  ss.begin(9600);
 
  //set internal pullup
  pinMode(zcPin, INPUT);
  digitalWrite(zcPin, HIGH);

  // Turn off all lights:
  myHouse.write(A, ALL_UNITS_OFF,repeatTimes);
}

void loop()
{
  Serial.println("loop");
  if(ss.available())
  {
     Serial.print("Message Avail");
     Serial.print(ss.read());
     Serial.write(ss.read());
  }
}

An example of what the first arduino gets is
"http://192.168.1.62/lights.htm?house=A&dev=02&ctrl=0" --from web browser
It then extracts the url and checks for special cases and to see if the file exists on sd.. if it does it will return it to the client....
then the rest of the input containing "?house=A&dev=02&ctrl=0" is then parsed out and stored in sBuffer.  I then calculate the length of the string and add in the null terminator being sBuffer[end] = NULL;  This is around line 193 on arduino 1.

**The other thing that I may be causing the issue, but I cannot seem to find if it actually is, and I dont believe it is, is the var requestPos.  I use this var to store different things at different times as a work around to help with the flash storage issue I am having.  But like I said, I could not find anything wrong with it.

I do know that more or less I will actually be getting ascii encoding over this line and reading on arduino 2.  I have managed this before.  My issue is that the Message Avail is never actually printed, thus the second arduino is not getting the message. So this means, to me at least, that I am not getting softSerial to work properly.

Thanks
10  Using Arduino / Programming Questions / SoftwareSerial in Arduino IDE V1.0 on: January 14, 2012, 02:26:48 am
So I have been working on this project for a few weeks now and it contains 2 arduinos and an ethernet shield.  Long story short I am very close to running out of room on the arduino with the ethernet shield and need to send a string containing information for more functionality to another arduinio.  I intend on doing this with softwareSerial.  However, I cannot seem to get it to function.  I have tried many other workarounds such ass Easy Transfer and I2C, but none of these work. 

The first arduino has an Ethernet shield and has its own power source.  Pin 2 is connected to Pin 3 of the second arduino, Pin 3 is connected to Pin 2 of the other arduino and the arduinos are connected with a common ground.  The second arduino also has its own power source.  (I have also tried powering the second arduino with the first, but it produces the same result.)

basically whenver I attempt to send a char array from the first arduino to the second, the second does not recgonize that there is incoming data.  Can anyone help me with this bug?  Code below (ethernet code removed).



Arduino 1
Code:
#include <SoftwareSerial.h>
char sBuffer[50];
SoftwareSerial ss(2,3);

void setup()
{
  Serial.begin(9600);
  ss.begin(9600);
 
  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

  //Start SD
  pinMode(10, OUTPUT);
  SD.begin(4);
}

loop()
{
//do stuff with the ethernet lib...
//generate sBuffer char array.....
sendMessage();
}

void sendMessage()
{
  for(i=0;i<50;i++)
  {
    ss.write(sBuffer[i]);
  }
 
  //this was also attempted
  //sbuffer is null terminated...
  /*
  ss.write(sBuffer[i]);
  */
}



Arduino 2
Code:
#include <SoftwareSerial.h>
void setup() {
  // begin serial:
  Serial.begin(9600);
  ss.begin(9600);
}

loop()
{
if(ss.available())
{
Serial.write(ss.read());
}
}


In both cases the baud rate of 4800 was also attempted.
the char array that I am passing looks like this:

"?house=A&dev=00&ctrl=1"

(P.S. If you guessed x10, you are correct! smiley)

I cannot use the onboard serial because I also need to interface to a computer.
Any help would be great!
Thanks
11  Development / Other Software Development / Tablet Dev on: January 10, 2012, 09:54:44 am
I think it would be a good idea to possibly have compatibility for the IDK to run on Android, iOS, and webOS.  I personally store my sketches online using dropbox and there is no way to edit the pde or (to my knowledge) the ino files.  If I'm on the go and have an idea, it has to wail till i get back to a computer.

Does anyone else like this idea?
12  Using Arduino / Networking, Protocols, and Devices / Re: WiShield (async / CUHead) on: December 29, 2011, 09:45:49 pm
I did, but I did not fix the entire lib.  I am also not sure if it is "arduino legit"  I basically used my knowledge of c and modified it to compile it in V1.0.  You can still run it in its original code in v0022.
13  Using Arduino / Networking, Protocols, and Devices / WiShield (async / CUHead) on: December 13, 2011, 11:04:33 pm
After upgrading my arduino software from 0022 to 1.0 the wishield library I believe broke.  I did a search on the forum and did not find anything with this issue.  Currently I have a basic Wifi server setup using the CUHead shield (clone to async) and when I try to upload it to the Arduino from the IDE, I get and error compiling message with 2 errors.  See code section
Code:
In file included from Wifi_Test.cpp:5:
C:\Users\M\Dropbox\Arduino\arduino-1.0\libraries\WiShield/WiServer.h:199: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
C:\Users\M\Dropbox\Arduino\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

I personally am not sure how to fix this issue nor do I want to actually mess with and Arduino Core file to get it working.

Is anyone else seeing this and of have found a solution.

Regards


EDIT BELOW THIS POINT
I changed the data type of the write function in the WiServer.h file to size_t instead of void... this fixed the issue above.. however, a new issue arrised....
Code:
C:\Users\M\Dropbox\Arduino\arduino-1.0\libraries\WiShield\clock-arch.c:44:20: error: wiring.h: No such file or directory

I believe this is attempting to access the wiring.h file located in the hardware folder... It is there in version 22 but not in 1.0

As before any ideas welcome
Pages: [1]