Show Posts
|
|
Pages: [1] 2 3 ... 80
|
|
1
|
Using Arduino / Programming Questions / Re: Trying to include an int value as part of a character string
|
on: January 06, 2012, 01:50:34 pm
|
OK, first change the declaration at the top to something like: char msg[64]; ...so that we reserve space for 64 chars, but we don't yet know what they are. Then in'loop()': // if the current state is HIGH then the button // went from off to on: buttonPushCounter++; Serial.println("button pressed"); Serial.print("number of button pushes: "); Serial.println(buttonPushCounter);
snprintf (msg, 64, "test tweet number: %d", buttonPushCounter);
if (twitter.post(msg)) {
|
|
|
|
|
2
|
Using Arduino / Project Guidance / Re: Adding EEPROM or SRAM practical?
|
on: August 26, 2011, 09:07:40 am
|
Remember that such an external SRAM or EEPROM will not be addressable directly by the Arduino. That is, you'd have to write explicit read and write code to access data; you wouldn't be able to just say: my_var = 42; but you'd have to code: WriteToExternalRam(address, 42); On top of that, the Arduino processor can only execute code from internal Flash memory. External memory cannot be used for program storage.
|
|
|
|
|
4
|
Using Arduino / Programming Questions / Re: Reverse order of Integer array.
|
on: August 26, 2011, 05:00:25 am
|
So maybe use: int y = sizeof(buffer); ?
No, because 'sizeof' returns the number of bytes in the array, not the number of elements. Since an 'int' is two bytes on the Arduino, 'sizeof' will return twice the number of elements. Try this: int y = sizeof(buffer) / sizeof(buffer[0]); Remember that the compiler will evaluate the two 'sizeof's and the division.
|
|
|
|
|
7
|
Using Arduino / Sensors / Re: Sensor wiring question
|
on: August 25, 2011, 08:39:25 am
|
What I don't know is, do I need to power the sensor, or does it get the power from those 3-wires shown on the PDF?
Yes, it gets 5V power from the Arduino via the red wire in the photo (in the PDF).
|
|
|
|
|
14
|
Using Arduino / General Electronics / Re: Strip board vs Donut Board
|
on: August 24, 2011, 07:35:52 am
|
|
Stripboard has strips of copper on it, but donut board does not. With donut board, you must connect the components with copper wire, whereas with stripboard the ready-made copper strips conenct the components. You can cut the copper strips with a "spot face cutter" if you don't want some parts connected (e.g. under a DIP IC). You can use copper wire on donut board to make connections in any shape you want, not just in strips.
|
|
|
|
|
15
|
Using Arduino / General Electronics / Re: Backfeed diode and LM7805
|
on: August 24, 2011, 07:33:23 am
|
|
The idea of a backfeed diode like this is to discharge the output capacitor of the 7805 when the input is switched off. This prevents damage to the 7805 due to its output being at 5V when the input is at 0V. Now, if you have a supercap on the output, the diode may make it discharge when the power supply goes off. Is this what you want? Or do you want the supercap to keep the 5V power supply on for some length of time?
|
|
|
|
|