Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: PROBLEM WITH READING FROM SERIAL. BREAKS EARLY on: November 29, 2010, 08:35:19 am
What's your problem m8?
You can be a bit more polite...
Anyway.. thanx for your trouble
2  Forum 2005-2010 (read only) / Troubleshooting / Re: PROBLEM WITH READING FROM SERIAL. BREAKS EARLY on: November 29, 2010, 07:50:09 am
I'm sending a many characters and wait untl the "END" is sent...
Sometthing like this

rgergw3egwergvwerEND

my problem is that when i use the Serial.print on every step it works like a charm...
when the

     //Serial.println((char*)serialread);

is commented.... BOOM
3  Forum 2005-2010 (read only) / Troubleshooting / Re: PROBLEM WITH READING FROM SERIAL. BREAKS EARLY on: November 29, 2010, 06:56:47 am
i told it to break when

if(strcmp (strstr (serialread,"END"),(serialread + (strlen(serialread)-3))) == 0)break;

is ==0

not after 5 serial antries...
i want it to break After

i send END to the serial
4  Forum 2005-2010 (read only) / Troubleshooting / Re: PROBLEM WITH READING FROM SERIAL. BREAKS EARLY on: November 29, 2010, 06:23:45 am
void serial_read_data_new(){
  char serialread[30];
  memset(serialread,0,sizeof(serialread));
while(1){

   if (Serial.available()) {
    tmp = Serial.read();
    serialread[k]=tmp;
    serialread[k+1]='\0';
k++;

if(strcmp (strstr (serialread,"END"),(serialread + (strlen(serialread)-8))) == 0)break;

  }
   Serial.print("wow");
   Serial.println((char*)serialread);
}
}


Stops after 5 entries...
Why does it break the while(1) for no reason??
Any proposals??

(Chatting bad habbit)
5  Forum 2005-2010 (read only) / Troubleshooting / PROBLEM WITH READING FROM SERIAL. BREAKS EARLY on: November 29, 2010, 01:28:52 am
hello people
i have a problem when trying to read from my arduino serial...
i have this code in a function which i call from setup() :

void serial_read_data(){
  while(1){
    if (Serial.available()) {
      tmp = Serial.read();
      serialread[k]=tmp;
      k++;
      int len;
      char* filename;
      len=strlen(serialread);
      Serial.println(len);
      filename = serialread + (len-3);

      //Serial.println((char*)serialread);

      if(strcmp (strstr (serialread,"END"),filename) == 0)break;
    }


unless i have the commented " //Serial.println((char*)serialread);" line enabled it breaks before it's time...
I cannot figure out why...

the same happens to both my duemillanove and mega...

any ideas or alternatives??

I want to read the serial to a buffer untill a specific sequence of characters arrives and then it breaks...

ANY HELP????  >smiley-sad
6  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino and Writing SD on: December 02, 2009, 09:25:55 am
@Duckula:
after you aply the hacks in the ethernet library for use with the MEGA and after you change all ss pins to other than 53, use the sdfat sdi configuration disable w5100 spi by driving the sen (prog) jumper LOW.
I also drive 53 always HIGH no matter if |I don't have it connected...
this way there is no conflict with the buged w5100 spi pins...
I include my changed sdfat and ethernet libs

http://rapidshare.com/files/315255059/libraries.rar



I use pin 4 to drive the prog jumper LOW-HIGH wired to the jumper...

also read this
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1257662425

I hope I helped you
7  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino and Writing SD on: November 25, 2009, 08:04:49 pm
this works perfectly for me
http://code.google.com/p/sdfatlib/

it can use both 32 and 16 fats up to 2 gb - tested and works perfectly with some modifications on the sd adptor on the ethernet shield...

RECOMMENDED
8  Forum 2005-2010 (read only) / Interfacing / download file from SD on: November 20, 2009, 12:38:55 pm
Does anyone know if it is possible to download a file saved in an SD through the internet shield???
I use the fat16lib for accessing the SD and the web server of the ethernet library or the one posted here...

http://www.arduino.cc/playground/Code/WebServer
9  Forum 2005-2010 (read only) / Development / Re: Recotana's OSC Library on: October 21, 2010, 01:14:39 am
i downloloaded the 17 version and it compiled..
i have the touch osc app on my iphone and cannot find out if something works or not...
i'm really noob on the osc part
any ideas?
10  Forum 2005-2010 (read only) / Development / Re: Recotana's OSC Library on: October 20, 2010, 11:09:43 pm
hey guys..
i need some help with this library..
i cant compile it..
no example..
i fix the spi.h problem.. but after that i get a thousand errors...
i use arduino 0019

any help would be appreciated
11  Forum 2005-2010 (read only) / Troubleshooting / Re: Has anyone managed to use ethernet shield with SD? on: November 09, 2009, 02:31:26 am
i FINALLY DID IT..
In the sdcard.h file i defined a new pin4 as WD

// define SPI pins
#if defined(__AVR_ATmega1280__) //SPI pins
// pins for Arduino Mega
#define SS   49
#define SE   53
#define MOSI 51
#define MISO 50
#define SCK  52
#define WD   4

then in the sdcard.cpp, i made this code modification

// set Slave Select HIGH
STATIC_NOINLINE void spiSSHigh(void)
{
  digitalWrite(SS, HIGH);
  pinMode(SE,OUTPUT);
  digitalWrite(SE, HIGH);
  pinMode(WD,OUTPUT);
  digitalWrite(WD, HIGH);

  
}
// set Slave Select LOW
STATIC_NOINLINE void spiSSLow(void)
{
  digitalWrite(SS, LOW);
  pinMode(WD,OUTPUT);
  digitalWrite(WD, LOW);

When the 4 pin is connected to the PROG jumper of the ethernet shield, it drives the wiznet off when the sd's spi initializes and then on when it goes low...

this way it works perfectly for me as i can log data and see the analog read on a web page...
12  Forum 2005-2010 (read only) / Troubleshooting / Re: Has anyone managed to use ethernet shield with SD? on: November 08, 2009, 03:55:52 am
For anyone who cares... I just found out that the w5100 isbuggy when used with other spi devices as the miso pin doesn't go to hi-z state and brakes the bus...
http://www.wiznet.co.kr/W5100_SPI.doc

i suppose this is the reason th SD card is not officialy supported by the shield...
any aother ideas on solving the problem?
13  Forum 2005-2010 (read only) / Troubleshooting / Has anyone managed to use ethernet shield with SD? on: November 08, 2009, 01:40:25 am
I have the w5100 ethershield with the sd card adaptor on it...
I use the arduino MEGA device
so far i have managed to use both but separately...
For the SD i use the fat16lib code and for the ethershield the spiMEGA.h hack having moved 11, 12 and 13 pins as advised...
i have changed the code so that pin 10 of the ethernet shield (SS) move to another pin.(L port)
I also connect the corresponding pins of the SD card adaptor (3, 8, 9) to 50, 51, 52 pins of the arduino Mega
Also changed the SS pin of the SD to another pin...
When the arduino is programmed with the webserver example it works perfect no matter of ths SD connected or not...The SD doesn't initialize as no 74 cycles code is implemented so there is no conflict..
When i try the SD log example  on the arduino with the w5100 miso pin disconnected the SD works perfectly too...
On the contrary when the miso pin of W5100 is connected, the system goes nuts...
the card never inits...even if i set both pin53 to OUTPUT/HIGH and w5100 SS to OUTPUT/HIGH...
I need to use them both simultaneously in order to log some analog data and show them online while showing a graph of the data during time on a web page...
Anyone managed to do this?
any ideas?
 :o
14  Forum 2005-2010 (read only) / Interfacing / Re: Arduino Ethernet Shield MEGA hack on: November 06, 2009, 12:24:57 am
what if someone wants to use multiple ss pins for pultiple devices...
I want to use the sd on the ethernet shield...
It simply doesn't work with the mosi pin of the spi connected to both wiznet and sd...
is it possible to set the pi 10 hi in order to set arduino as slave and still use diferent pins for cselecting w5100 and sd?
Pages: [1]