Posts

Showing posts with the label Serial

Arduino To Arduino Serial Communication Without A Library

Answer : Not sure it has a bearing on your problem or not, but I can't help highlight this: wait: while((tmp = serialReceive()) != 2){ goto wait; } That has to be the the most evil piece of code ever written in the history of mankind. I'm sorry, but it is. while((tmp = serialReceive()) != 2); is all you need. Or if you must be "pedantic": while((tmp = serialReceive()) != 2) { continue; } There is never any call to use goto (I don't know why it was ever even included in C), and certainly not to re-run a while loop that is going to re-run itself anyway. In your receiver you are using dynamic memory, and doing it extremely badly. First you start out with a pointer char *s; Then when you receive a data character you pass that pointer to your array_concat() routine as the source for where to copy data from: s = array_concat(s, strlen(s), tmp); You are at that point asking it for the length of the string in an undefine...

Arduino Nano Uploading Gives Error: Avrdude: Stk500_recv(): Programmer Is Not Responding

Answer : Know this is old but I ran onto it during my search for Nano(V3)'s not uploading so thought might help someone else. Problem is the bootloader - Arduino IDE BUT I Found an easy solution (right under my nose). I realized that my nano's had been uploading just fine then I had finally updated the Arduino AVR Boards from 1.6.20 to 1.6.21. I didn't think there was any problems because it still showed my Nano and ATmega328 etc in the board manager after the change. But the new boards manager has a new ATmega328 processor choice for the Nano. I changed processor: In the Arduino IDE select TOOLS > PROCESSOR > pulldown menu from ATmega328P to "ATmega328P (Old Bootloader)" . Since then, I have uploaded many programs to several different Nano's V3 (Prolofic interace Chipset) without issue. This error message basically shows up for any communication problem, so by itself, it is not all that instructive. The Arduino Nano is supposed to have au...