Show Posts
Pages: 1 ... 1886 1887 [1888] 1889 1890 ... 3442
28306  Using Arduino / Networking, Protocols, and Devices / Re: Twitter limiting number of client requests/hr on: July 03, 2012, 09:37:58 am
Quote
but using an existing domain like twitter wouldn't it be much easier
If twitter didn't need to guard against twits overpowering its server, yes. But, you would have complete control over your server, and could implement whatever policies you liked. Authorization, IP limits, etc.
28307  Using Arduino / Programming Questions / Re: Programming linear motor interpolation on: July 03, 2012, 09:35:22 am
Quote
Could that be the problem???
Haven't you already answered that question for yourself. I believe you have.
28308  Using Arduino / Programming Questions / Re: Reading hours meter from generator on: July 03, 2012, 09:30:35 am
Quote
Should I read and write back to the same memory location each time?
Yes.

Quote
Since each location can only hold a number up to 255 should I break the accrued time up and use a different memory location for each character?
No. You should look at the EEPROM_readAnything and EEPROM_writeAnything functions (google if you need to) to see how to read and write ints, floats, structs, etc. There is no reason to convert the number to and from a string.

Writing additional accrued time appropriately (once a minute, every 30 seconds, etc.) will allow you to achieve a balance between wear and loss of data.

If the power supply to the Arduino is stable enough, you could write only when the pin went LOW again, but I don't recommend that. Any accrued time since the last save would be lost if the Arduino lost power.

Writing every 5 minutes while the pin is high and again when it goes LOW should be a reasonable compromise.
28309  Using Arduino / Programming Questions / Re: Reading input from serial communication. on: July 03, 2012, 09:19:08 am
Quote
in 1.0.1 there is something like serial.readstring()

that lets me compare directly
Because the output is a String. A String and a string are NOT the same thing.

We've been trying to help you learn how to use strings, because they are far less resource intensive.
28310  Using Arduino / Programming Questions / Re: Programming linear motor interpolation on: July 03, 2012, 09:16:42 am
Quote
That's negative right there.
The function is using longs, so that value should be in range.

Quote
X:53688 Y:21475 NEWX:99999 NEWY:40000 OLDX:0 OLDY:0 Y2:21475
X:53688 Y:21475 NEWX:99999 NEWY:40000 OLDX:0 OLDY:0 Y2:-21474
Unless I'm missing something (like the code that printed this), two identical inputs produced two different outputs. That is normally not possible.

One question, though. If all of the inputs are signed longs, why is the output an unsigned long?
28311  Using Arduino / Storage / Re: need to store data in database. on: July 03, 2012, 08:57:54 am
Quote
i need to use the database to store my datas.
What database?

Quote
Is it possible to  use the database in storing my datas in the sd card.
What database? A relational database consists of a lot more than just data storage.

Quote
Please help me with the simple sample programs.
There are simple samples (provided) for reading and writing to SD cards. Creating a database application that uses the SD card as the data repository is possible but not simple.
28312  Using Arduino / Programming Questions / Re: quick help -- button pressing and timing on: July 03, 2012, 08:49:48 am
Code:
unsigned int time;

void setup(){
Serial.begin(9600);
Status = digitalRead(5)
time =millis()
Aside from the milling semicolons, this code is a disaster waiting to happen.

millis() returns an unsigned long, not an unsigned int. Storing the value in an unsigned int will result in mangled data.
28313  Using Arduino / Programming Questions / Re: making a library on: July 03, 2012, 08:46:39 am
Quote
when it compiles it will change to the binary value then and there?
Exactly.
28314  Using Arduino / Programming Questions / Re: Reading hours meter from generator on: July 03, 2012, 08:45:47 am
Quote
When the generator is running one of the digital inputs goes HIGH.
So, you simply want the Arduino to keep track of how long this pin is HIGH?

Quote
I want the accrued hours to be stored in non volatile memory so it can survive a reboot and updated once the generator shuts down.
How often? How is the Arduino powered? If you store the time in EEPROM (there's a library and functions to do this), you can read it again next time the Arduino starts up. You want to minimize how often you write to EEPROM, because it has a finite number of writes (100,000+ guaranteed; a lot more than that is quite likely). Writing on every pass through loop WILL wear it out in a hurry, though. Writing every time 5 additional minutes has accrued will take a long time to wear out the EEPROM (cell).
28315  Using Arduino / Programming Questions / Re: C++ or C# good tutorial on: July 03, 2012, 08:38:28 am
If you want to replace Processing with your own applications, C# is a much better choice than C++, due to how much easier it is to build user interfaces AND talk to the serial port.

There are plenty of resource on the web that deal with all aspects of C#.

If that is not what you want, you need to clarify just what it is you do want.
28316  Using Arduino / Programming Questions / Re: Programming linear motor interpolation on: July 03, 2012, 08:35:54 am
Quote
The value suddenly inverts into negative.
Given what input values? Perhaps it is perfectly reasonable that that happens.
28317  Using Arduino / Project Guidance / Re: Tilt robot motor code not working on: July 03, 2012, 08:21:40 am
Code:
    if ((mydata.xVal < forwardRangeMax && mydata.xVal > backwardRangeMin) || (mydata.yVal < rightRangeMax && mydata.yVal > leftRangeMin)){ // If enough accelerometer movement detected...
It is possible to add white space to this code to make it more readable:
Code:
    if ((mydata.xVal < forwardRangeMax &&
      mydata.xVal > backwardRangeMin) ||
     (mydata.yVal < rightRangeMax &&
      mydata.yVal > leftRangeMin))
    { // If enough accelerometer movement detected...

There are a variety of styles for C/C++ coding, that dictate where the { goes, with respect to the block that follows. NONE of them call for putting the } on the same line as any other code.

Quote
Now, my problem lies in implementing turning. I have the code down for moving forward and backward, but whenever I try to implement turning, the code doesn't do anything. As in, it doesn't 'recognize' that I'm turning or gets stuck or something. I don't know.
You need to debug your code somehow. Generally, that means using the serial port to write to the serial monitor. Reading the accelerometer and sending that data to the robot does not appear to be the problem. So, temporarily dump all that code.

Write some code that reads from the serial monitor, instead. Send the robot KNOWN instructions (i.e. known values of x, y, and z). Use Serial.print() to echo that data, to confirm that it is being received correctly. Use Serial.print() to show what motorDriveDeterm() decides should be done.

There are no else statements in motorDriveDeterm(), so it is likely that driveRight and driveForward are both true (or any number of other combinations). Is that going to be OK? Can you drive right and forward at the same time?
28318  Using Arduino / Project Guidance / Re: sending Text file using Arduino UNO on: July 03, 2012, 07:34:39 am
Quote
Can anyone please help me how to send the text file from computer to Arduino UNO1
You need an application on the PC that can open the file, read the data, and send the data to the serial port. This part is not Arduino specific.

Quote
and sending the file to another Arduino UNO2 using two Xbee Series2 for each Arduino.
Read the serial data, using Serial.available() and Serial.read(), and send it to the other one using a SoftwareSerial instance on two other pins that the XBee shield is connected to.

Sending data from one Arduino to another using XBees is trivial, as long as the XBees are configured correctly.

One the second Arduino, read the data that the XBee put on the serial port (hardware or software), storing it in an array, until a complete packet is received. Then, parse that array and use the data.

There are plenty of examples around to show how to perform each step.
28319  Using Arduino / Project Guidance / Re: Greenhouse Automation with User interface. on: July 03, 2012, 07:25:53 am
Quote
I came across some researches with Arduino Scada, will that do for my project
No. The Scada implementation for Arduino is far from complete.

Developing your own protocol and PC application (I like C# for that) that talks to the Arduino (via the serial port (I really like C# for that)) will be far easier than trying to understand and extend the Scada protocol.

I have a sample application, written in C#, that lets the PC talk to the Arduino. If you would like that as a starting point, PM me.

28320  Using Arduino / Project Guidance / Re: Motorcycle gear position indicator on: July 03, 2012, 07:10:37 am
Quote
Any help appreciated.
http://arduino.cc/en/Reference/Array

Code:
    noInterrupts();
If you turn interrupts off (not a good idea, generally), you should really turn them back on as soon as possible.
Pages: 1 ... 1886 1887 [1888] 1889 1890 ... 3442