Show Posts
Pages: 1 [2] 3 4 ... 3234
16  Using Arduino / Programming Questions / Re: Displaying RTC (DS1307) date and time on LCD on: July 10, 2014, 05:49:43 am
Quote
Plus, every time i upload the sketch, the time would keep override, will this wear out the RTC?
No. But, since you have an RTC, why do you need to keep changing the time? Comment out that line.

Quote
I've tried different ways of code (I'm bad at coding) but still couldn't get the values display on the LCD, it just shows zero and some weird patch on the screen.
Is the problem with getting the data onto the LCD, or with getting the data? In other words, what does your serial output look like?

Why do you have global variables named hour, minute, second, etc. AND local variables in the stupidly-named printDate() function?
Stop that shit NOW!
17  Using Arduino / Programming Questions / Re: Display HH:MM:SS? on: July 10, 2014, 05:44:33 am
millis() reports the number of milliseconds since the Arduino restarted. It has NOTHING to do with what time it is now.

You are barking up the wrong tree.
18  Using Arduino / Programming Questions / Re: Sampling rate for accelerometer data transmission using XBee and arduino on: July 10, 2014, 05:35:25 am
Code:
  int ADCx=0; int ADCy=0; int ADCz=0;
  for (int i=0;i<loopCount;i++)
  {
     // It takes 100 micro second (0.0001 s) to read an analog input
    ADCx += analogRead(xpin);
    ADCy += analogRead(ypin);
    ADCz += analogRead(zpin);
  }
First, the comment is wrong. It doesn't take that long to read an analog input, by several orders of magnitude.
Second, with 60 readings, the possible values in ADCx and the others could run up to 61380, which would overflow the ints being used.

You could take three sets of readings, and send 18 bytes per packet, to see if that makes a difference.

Finally, the baud rate that you talk to the XBee, and the baud rate that the XBee talks to the other XBee do not have to be the same. Pick up the speed that you talk to the XBee.

And, last but not least, what is your environment like? Is there lots of noise? What kind of antennas do you have? How far apart are the XBees?
19  Using Arduino / Programming Questions / Re: ah man Noob asking a question again... on: July 09, 2014, 06:03:36 pm
for(buttonPushCounter = 0; buttonPushCounter > 6; buttonPushCounter++) ;
Starting with buttonPushCounter at 0, while buttonPushCounter is greater than 6, do nothing (that's what the semicolon on the end means). How many times will you actually do nothing? Why are you trying to do nothing more than once?

When that for loop ends, what will be the value in buttonPushCounter that the rest of the code relies on?

Since buttonPushCounter is NOT counting the number of times the switch was pressed, what possessed you to use that name?
20  Using Arduino / Networking, Protocols, and Devices / Re: Softwareserial and SPI/nrf24l01/RF24 library possible conflict - help please. on: July 09, 2014, 05:58:20 pm
Quote
Am I falling fowl of the libraries using the same internal counter?
No.

Quote
Or is there another explanation?
Coding issues. Out of memory. Sharing pins that shouldn't be shared. Should I go on guessing?

Or, would you care to share some code and a schematic?

Quote
pointers
Code:
char *pointer;

Quote
would be very welcome.
I can't see how the last will be helpful, but you did ask.
21  Using Arduino / Networking, Protocols, and Devices / Re: To get continuous data from a rocket going ~mach 1.5 can I use an Xbee Pro? on: July 09, 2014, 05:54:13 pm
At an altitude of 10,000ft, the horizon is about 120 miles so the range isn't going to be a problem especially in a desert. I don't know what the Tx power is on an XBee Pro but if it is on the order of 100mW or more it should be plenty.

Pete
Assuming a decent antenna, among other things. OP hasn't told us anything about the particular XBees being used, so any assumptions about range are a bit premature.
22  Using Arduino / Networking, Protocols, and Devices / Re: Triggering Communication using Slave - I2C on: July 09, 2014, 05:51:54 pm
Quote
nd I was wondering if there was any way of beginning a communication by the slave
No. A slave can only respond when asked by a master.

Of course, the role of master and slave CAN change.
23  Using Arduino / Networking, Protocols, and Devices / Re: Xbee seemingly random transmission pause on: July 09, 2014, 05:49:56 pm
Quote
Therefore we think the XBees are malfunctioning.
Misconfigured, more likely.

Quote
What might cause the pause in transmission?
Incorrect code.
24  Using Arduino / Interfacing w/ Software on the Computer / Re: Weird spikes on UART communication. on: July 09, 2014, 05:46:56 pm
val is used by the interrupt service routine AND by loop(), but it is not volatile. That will cause garbage output to the serial port, for two reasons.

One is that the current value of val is not fetched every time it is accessed, since loop() doesn't know that the variable can change outside of loop().
The second is that the value of val COULD change between the two accesses of val in loop().

You need to male val volatile, and you need to disable interrupts before computing upper and lower, and enable them again afterwards.
25  Using Arduino / Interfacing w/ Software on the Computer / Re: Weird spikes on UART communication. on: July 09, 2014, 05:39:40 pm
I thought Serial.write/print didn't work within ISRs because interrupts were disabled within interrupt handling routines, and Serial library uses interrupts?
They will work until the outgoing buffer gets full. Then, the Arduino will freeze, with Serial.write() waiting for room in the buffer to store the character, and room being made only by interrupts happening, shifting a byte out. Since interrupts don't happen in an ISR, the Serial.write() function will never return.
26  Using Arduino / Interfacing w/ Software on the Computer / Re: Control thermal printer through openframeworks. on: July 09, 2014, 03:58:04 pm
Only arduino.WriteByte(sum) is sending to the Arduino. tempOutputFile is a file, as the name suggests i'm writing a txt file to check te output of that part of the program; \n to check that im actually writing 48 bytes to the Arduino.
Yeah, OK, I see that now. What is this:
Code:
 if(++n < totalBytes);
doing?

Code:
     printBuffer[bufferCount] = Serial.read();
      bufferCount++;
    }
    if(bufferCount == 47){
       printer.printBitmap(384,1,printBuffer,false);
After writing a byte to the array, you increment bufferCount. The value after writing in printBuffer[47] is 48. The if test then looks to be off by 1.

I don't know what the first two arguments to the printBitmap() method are. I'm assuming that you know that they are right.
27  Using Arduino / Programming Questions / Re: Why arduino "ignore" % on: July 09, 2014, 03:15:54 pm
Code:
  val == digitalRead(BUTTON);
Here, you are comparing val to the result of reading the pin state, and discarding the result. You are not assigning the result of the read to the variable.
28  Using Arduino / Programming Questions / Re: Slow server on Arduino on: July 09, 2014, 03:07:05 pm
Quote
This is the best way to read from the SD and send over the internet.
You can speed up the read, by using the read() overload that takes an array, and returns the number of bytes read. Much Faster than reading one character at a time.
29  Using Arduino / Programming Questions / Re: Gesture Control Car Using MPU6050+nRF24l01 (Help me, quickly!) on: July 09, 2014, 03:00:23 pm
Quote
the problem is that, i can't combine MPU6050 gyro and nRF24l01 transceiver...
Why not? What happens when you try? Does the Arduino simply go up in smoke?

You are making it very difficult to help you.
30  Using Arduino / Programming Questions / Re: Operations between two SD files on: July 09, 2014, 02:58:47 pm
Quote
I have two files in a SD card and since they have 2000 values
ASCII or binary?

Code:
I think I'm in the right direction,
Oh, I seriously doubt it.
Pages: 1 [2] 3 4 ... 3234