Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 844
61  Using Arduino / Project Guidance / Re: Write string to EEPROM on: July 30, 2014, 11:14:14 am
I am trying to write a string to EEPROM but I have been having some trouble getting it to work. I've tried using the "write anything", "eepromex", and "EepromUtil" libraries but still can't get it to work.

What you're trying to do is certainly possible. If your attempt isn't working, post your code and perhaps somebody can explain what you're doing wrong.
62  Using Arduino / Project Guidance / Re: Ardi Noob Here - Identifiation & Tracking System - The Talos Project on: July 30, 2014, 11:11:54 am
UV based laser

Do you know enough about lasers to understand the associated dangers? By the time it's powerful enough to have any chance of zapping an insect, I suspect it'll be dangerous to unprotected eyes.

http://www.sciencebuddies.org/science-fair-projects/project_ideas/Phys_Laser_Safety.shtml
63  Using Arduino / Project Guidance / Re: Crittercam project - Camera won't take focused pictures on: July 30, 2014, 11:04:20 am
There's no detail at all about the technical specifications of the camera. Do you have any idea what the focal length is supposed to be? Does the camera use / support using an external lens to achieve the correct focus?
64  Using Arduino / Interfacing w/ Software on the Computer / Re: How to get output of system() command? on: July 30, 2014, 10:59:56 am
What Arduino are you using? If you're trying to get metrics back from the PC via the USB serial connection, what operating system is running on the PC? If you aren't trying to do that, please explain what you're trying to do.
65  Using Arduino / Programming Questions / Re: Serial.read on: July 29, 2014, 07:26:41 pm
Where is the "Yes" coming from? If it's coming from the serial monitor, you can use the line ending to indicate when you have received a complete command. In that case you can buffer and process it like this:

Code:
// incomplete, untested
void handleSerial()
{
    const int BUFF_SIZE = 32; // make it big enough to hold your longest command
    static char buffer[BUFF_SIZE+1]; // +1 allows space for the null terminator
    static int length = 0; // number of characters currently in the buffer

    if(Serial.available())
    {
        char c = Serial.read();
        if((c == '\r') || (c == '\n'))
        {
            // end-of-line received
            if(length > 0)
            {
                handleReceivedMessage(buffer);
            }
            length = 0;
        }
        else
        {
            if(length < BUFF_SIZE)
            {
                buffer[length++] = c; // append the received character to the array
                buffer[length] = 0; // append the null terminator
            }
            else
            {
                // buffer full - discard the received character
            }
        }
    }
}

void handleReceivedMessage(char *msg)
{
if(strcmp(msg, "Yes") == 0)
{
// handle the command "Yes"
}
else
{
// etc
}
}
66  Using Arduino / Programming Questions / Re: Global variables not updating on: July 29, 2014, 07:23:48 pm
I think you should only process the received message when you actually receive it, i.e. inside the if(network.available()) block.

I suggest you separate out the code dealing with network reception with the logic handling scene numbers. You could do that by writing a function to handle a received scene number and calling that with the received scene number as an argument each time you receive a new scene number.

The timeout logic should be simple enough to implement but it would be sensible to leave that out until you have got the basic logic to handle a sequence of scene numbers working correctly.

Make sure your sketch prints out trace messages to show what it has received and what it is doing to the scene number as a result, so that you can check whether it's working correctly.
67  Using Arduino / Project Guidance / Re: Servo Motor Signal Problem on: July 29, 2014, 07:17:09 pm
It just doesn't hold its location when something else is turned on.
Code:
    servo1.write(0);
    delay(200);
    servo1.write(180);

Your sketch will run the code above repeatedly as long as the input is low, and leave it in the '180' position when the input is high. I have no idea whether this is the behaviour you intend - if it isn't I suggest you explain exactly what behaviour you are trying to achieve.
68  Using Arduino / Project Guidance / Re: Help with how to approach my aquarium controller on: July 29, 2014, 07:10:56 pm
I don't know how the buttons work ojn the shield you're using but I suspect they'll just be connected to I/O pins. In that case, reading the button state will be as easy for the shield as in any other case. Look at the state change detection example to see how to debounce an input and detect button presses - you could probably get that working using your lcd/button shield by creating a copy that uses the pin numbers your shield connects the buttons to.

None of what you're trying to do seems especially difficult, and I suspect the reason that you're finding it so intimidating is that you're trying to solve the whole thing in one go. That's not the best way to tackle problems like this. Take it one step at a time, reading and trying the examples that show you how to use the techniques relevant to that step. You need to be able to detect button presses on the shield, you need to display text, and you should plan to implement a simple state machine to manage the menu system you're going to write. Individually, none of these things are especially difficult to do.
69  Using Arduino / Project Guidance / Re: Arduino unresponsive after a long time on: July 29, 2014, 07:04:21 pm
There is a huge amount of code there that presumably has nothing to do with the Arduino turning on and off. I don't pretend to understand your description of how the Arduino will be turned on and off but I suggest that you write a minimal sketch that does as little as possible while supporting being turned on and off in the way your real sketch will be turned on and off. Add a simple timer to make an LED flash in a recognisable pattern which tells you what the Arduino is doing. See whether it produces the same problem. This will tell you whether there is a system design issue or just a software bug.
70  Using Arduino / Project Guidance / Re: How to detect length of circuit? on: July 29, 2014, 06:51:21 pm
If the wire has a known resistance per unit length then you could measure the resistance and calculate the length from that. To be usable in practice, the resistance would need to be fairly high so you'd need to use resistive wire, not ordinary copper wire. If the wire is connected in discrete segments you could use an ordinary resistor in series with each segment to give you the known resistance.
71  Using Arduino / Programming Questions / Re: float switch loop with timing help needed with coding on: July 29, 2014, 01:15:39 pm
It would be better to post a complete sketch that demonstrates the problem, so we don't have to guess what else is going on and how your data is declared.

I think this logic would be simpler if you implemented it as a state machine. I suspect the state machine would only need two states (off and pumping) and you would check for float switch changes and timeouts appropriate to each state. I'm not sure what you intend to happen if the timers expire - perhaps you need a separate fault state where you turn everything off and wait for help.
72  Using Arduino / Programming Questions / Re: Read only the first row of data from a loop on: July 29, 2014, 01:11:50 pm
Put the first set of readings in row 0 of a 2 dimension array then ...

That could be made to work too, but I think the initial set of readings is used for a different purpose to the subsequent ones and storing both sets in a single 2-d array hides / loses that distinction. Two separate arrays (one for the calibration values, the other for the runtime values) makes more sense to me.
73  Using Arduino / Programming Questions / Re: Read only the first row of data from a loop on: July 29, 2014, 12:51:06 pm
Maximum of one thread per question please.

http://forum.arduino.cc/index.php?topic=257877.0
74  Using Arduino / Programming Questions / Re: Read only the first row of data from a loop on: July 29, 2014, 12:49:21 pm
Please use code tags when posting code, to stop the forum software mangling it.

I suggest you put a for loop in setup() which reads the initial value from each sensor and stores it into your reference array. Then you can subtract those values from the sensor values you read subsequently in loop().
75  Using Arduino / Project Guidance / Re: Help with how to approach my aquarium controller on: July 29, 2014, 12:46:31 pm
I'm sorry you feel like that, because I think you've already made good progress with the projects you've completed so far and I don't see any reason you couldn't continue and complete the project if you want to. I didn't envisage that the prototyping would involve any different hardware than you already have. You mentioned a UNO and a display/button shield and that is exactly what I'd use for prototyping.

Note that you will need a driver circuit between the Arduino and any motor or relay that it is going to operate. The Arduino I/O pins are safe for 20mA and have an absolute limit of 40mA which is way less than you need to operate even a tiny relay, and they need flyback protection in order to drive any inductive loads. You can get motor shields or separate driver boards which contain the necessary electronics - or you can make up your own circuit from discrete components if you want.
Pages: 1 ... 3 4 [5] 6 7 ... 844