Loading...
  Show Posts
Pages: 1 2 [3] 4 5 ... 42
31  Using Arduino / Programming Questions / Re: Reverse button state on: May 05, 2013, 12:50:42 pm
Hello and welcome smiley

Follow this tutorial:

http://arduino.cc/en/tutorial/button
32  Using Arduino / Programming Questions / Re: serial.read() and device it to multi string on: May 05, 2013, 11:15:10 am
Easiest way I think:

http://codepad.org/VLfagSkg
33  Using Arduino / Installation & Troubleshooting / Re: Mega2560 R3 - can't upload... on: May 05, 2013, 08:10:29 am
What if you try older IDE (1.01) ?
34  Using Arduino / Programming Questions / Re: Single Clock Delay on: May 04, 2013, 11:57:46 pm
Yes I've looked this function in IDA, and here it is:
Code:
loc_A6:
nop
adiw    r24, 1
ldi     r18, 3
cpi     r24, -24
cpc     r25, r18
brne    loc_A6

So 6 instructions that probably takes 7 clocks.. As you said, 440 / 7 = close to 62.5. Sorry then, this function is useless smiley

35  Using Arduino / Programming Questions / Re: Single Clock Delay on: May 04, 2013, 11:24:53 pm
Code:
void delayClocks( uint32_t clocks )
{
  do
  {
    __asm( "nop" );
  }
  while ( --clocks );
}

smiley

But, I don't think it will be the correct delay as you expect, I tested it and: delayClocks( 1000000 ) should be a delay of 62.5 milliseconds right? Well on my Arduino it is more like 440 milliseconds...
36  Using Arduino / Installation & Troubleshooting / TX LED stay ON after the Serial Monitor is closed on: May 04, 2013, 06:48:12 pm
Hello smiley

I don't know if it's a bug, but in my current program I have a Serial.print that prints some data every seconds in the Serial Monitor. So the TX LED is blinking every seconds, until now everything is normal.

But if I close the Serial Monitor, the LED continue blinking for approx 93 seconds, and then stay ON. After a press of the Reset button, the LED is still ON.

Only when I unplug the power (from USB), and plug it back, the LED stay OFF as it should. When I reopen the Serial Monitor, the LED starts blinking every seconds again, as should, and the problem always happen like 93 seconds after I close the Serial Monitor.

Any idea why? Should I check if Serial.available() before the Serial.print? smiley-eek
37  Using Arduino / Programming Questions / Re: temp censor delay(1000); on: May 04, 2013, 05:18:58 pm
Yes, look the example "Blink without delay".
38  Using Arduino / Sensors / Re: 2 pin temp censor on: May 04, 2013, 02:43:09 pm
I never tried thermistors but from what I've read, they aren't accurate, even 2 thermistors of the same model, could show different values at the same temperature. So you have to make your own lookup table by using a thermometer (or 2, to be more accurate) and measure the resistance at different temperatures. You could use a sensor such as the DHT22 (they are accurate, I have 2 of them and they show the same temp.) to automatically build a lookup table smiley
39  Using Arduino / Sensors / Re: 2 pin temp censor on: May 04, 2013, 02:24:29 pm
A thermistor? I don't think you need a library for that smiley

http://bildr.org/2012/11/thermistor-arduino/
40  Using Arduino / Microcontrollers / Re: Is the whole program uploaded even if only one byte changed? on: May 04, 2013, 08:54:44 am
OK, I will stop worrying about memory lifetime then smiley
41  Using Arduino / Project Guidance / Re: running servos on a sine wave on: May 04, 2013, 07:10:34 am
Hello smiley

And you could calculate that delay with something like this:

Code:
delay_ms = 3 / sin( angle )

So with this example, when the angle is 90 the delay will be 3 ms until the next servo move (91 or 89) and with for example an angle of 179, the delay will be ~172 ms. I suggest you use microseconds for more accuracy.

(Be carefully with angles 0 or 180, it will divide by 0 and your Arduino may explode smiley-grin)

Oh and don't use delay() or delayMicroseconds() functions, instead look at the "Blink without delay" example to see how to do delays without those blocking functions.
42  Using Arduino / Programming Questions / Re: Having problems with temp reading analog sensor on: May 03, 2013, 10:38:37 pm
Is your Serial Monitor set at the same baud speed as in your code?
43  Using Arduino / Microcontrollers / Re: Is the whole program uploaded even if only one byte changed? on: May 03, 2013, 09:10:03 pm
Well, I have an Arduino since approx 7 months, uploading on average 10 times a day... (that's how it works when you want to explorate and learn) so that's how I calculated those 2000+. Maybe you don't realize, but it goes quick.
44  Using Arduino / Microcontrollers / Re: Is the whole program uploaded even if only one byte changed? on: May 03, 2013, 07:11:15 pm
Well you are right, I use a Mega 2560 so can't replace chip (at least not easily) but (sainsmart's) Mega 2560 is like 15$ these days. But still, isn't it possible for the "uploader" (avrdude?) to "download" the current program that is on the chip, compare with the to-be-uploaded and if only few bytes changed only upload those bytes? Is it theorically possible and if yes, why it hasn't been made? It would greatly increase the lifetime of that flash memory right?
45  Using Arduino / Microcontrollers / Is the whole program uploaded even if only one byte changed? on: May 03, 2013, 05:51:30 pm
Hello smiley

I'm not sure where to post this question...

I am wondering if when I upload a program in which I did only small changes compared to the previous version of that program (changing for example byte a = 2 to byte a = 3), will the whole program be uploaded or just the changes?

My real question is, will uploading a program "damage" every memory cells it uses, even if only one memory cell was required to be changed? Considering "memory supports at least 10,000 writes or upload cycles"... I'm already at 2000+ uploads I think, and I haven't even done 10% of the code for my project, just testing things...
Pages: 1 2 [3] 4 5 ... 42