Show Posts
Pages: 1 ... 1887 1888 [1889] 1890 1891 ... 3391
28321  Using Arduino / Programming Questions / Re: Help with using byteDiscard on: May 16, 2012, 03:20:16 am
You need to read and store those bytes in an array, so that you can compare the array with a standard response array. If they match, then what? Why is starting, then, to store data in a (different or reinitialized)  array a problem?
28322  Using Arduino / Networking, Protocols, and Devices / Re: Xbee communication on: May 15, 2012, 02:06:42 pm
You send a letter. Let's say it's a 'C'.

There is a character to read. You read that letter. It's not an 'A', so you read another letter (oops). That's not a 'B', so you read another letter (double oops). You really need to compare the SAME letter to 'B', 'C', 'D', etc. That means, of course, that you need to save the letter.
28323  Using Arduino / Networking, Protocols, and Devices / Re: Serial data problem when using Tx/Rx pins on: May 15, 2012, 02:03:11 pm
Why are you calling Serial.flush() at all? Which version of the IDE are you using? That determines what Serial.flush() does. That should be enough to make you wonder whether you should be calling it at all.
28324  Using Arduino / Interfacing w/ Software on the Computer / Re: arduino+servo+xbee on: May 15, 2012, 01:56:05 pm
Quote
You convert the value you got from analogRead() to a String, in binary format, then take the length of the String, scale it and send that value to the receiver.
Sh*t! Glossed right over that.
28325  Using Arduino / Programming Questions / Re: How much OOP is good? on: May 15, 2012, 01:43:07 pm
Quote
until you say "OOPS!" ?
I like that. One OOP is good. Two OOPS is bad.
28326  Using Arduino / Programming Questions / Re: Timer1 Interrupt Won't Run ISR on: May 15, 2012, 01:37:36 pm
Quote
I think if what you need to do takes too long in an ISR or does something that will interfere with interrupts, then that means you should not be using ISR. 
In general, I agree. The exception, as in this case, is when something needs to be done on a relatively regular basis. Having a timer generate a "It's time to do your thing" flag is easy. Then, loop() doesn't need to figure out if it's time to do something. It knows, because the flag is set.
28327  Using Arduino / Programming Questions / Re: Timer1 Interrupt Won't Run ISR on: May 15, 2012, 12:57:05 pm
ISRs need to be fast. Serial printing is not fast, and is generally not something you should do in an ISR.

The ISR sets a flag; loop() sees that the flag is set, and sends the data.
28328  Using Arduino / Programming Questions / Re: Accelerometer Nunchuck: from three values to one on: May 15, 2012, 12:54:20 pm
Quote
Thing is, my teacher told me that it wasn't as simple as that, but I don't have a clue, actually.
That depends on what you are trying to accomplish. The output of the accelerometer is the acceleration along three axes. For your purpose, all you seem to be concerned about is whether there is motion, or not.
28329  Using Arduino / Programming Questions / Re: RTClib Programming Reference on: May 15, 2012, 12:44:07 pm
Generally, the source code is the best documentation available, and you have that. What else do you need?

What library? Post a link.
28330  Using Arduino / Programming Questions / Re: Accelerometer Nunchuck: from three values to one on: May 15, 2012, 12:42:37 pm
Quote
To do this it's necessary to find a formula to go from the three values to one
How about d = a + b + c?
28331  Using Arduino / Programming Questions / Re: Creating filename using string or char on: May 15, 2012, 12:41:10 pm
My recommendation is to dump the String class. Use char arrays (static, big enough) and sprintf with proper format specifiers to define the name.
28332  Using Arduino / Project Guidance / Re: gsm modem #~plz help~# on: May 15, 2012, 12:31:41 pm
Quote
by Rx/Tx I meant the fake Rx/Tx pin created by the Newsoft library.
Maybe you connect the device to a real pin. There is nothing fake about the software serial port.
28333  Using Arduino / Project Guidance / Re: Potential heat problem? on: May 15, 2012, 11:27:20 am
Quote
You don't have a USB (5V) wall wart in your vast pile ?
That would have to be a regulated 5V, not an unregulated 5V, and you'd have to cut the connector off to wire it past the 5V regulator. Using an unregulated 5V past the voltage regulator is not a good idea, and using the unregulated 5V before the voltage regulator is not enough voltage.
28334  Using Arduino / Project Guidance / Re: Potential heat problem? on: May 15, 2012, 11:11:55 am
Quote
but my vast pile of old wall warts only had 5V, 9V, and 12V to choose from, so 9 was my best bet
Might want to think about what the Arduino is worth, relative to the cost of a 7.5V wall wart. But, hey, it's your Arduino.
28335  Using Arduino / Programming Questions / Re: How to show graph while detecting pulse on: May 15, 2012, 10:29:00 am
Quote
please help me sir I am really noob at this
When is our homework due?

Quote
the changes of every pulse
What does this mean? The Arduino can be programmed to read sensors. What kind of sensor are you reading? Sending the result of reading that sensor to the serial port is trivial. It's one line of code.
Pages: 1 ... 1887 1888 [1889] 1890 1891 ... 3391