Show Posts
Pages: [1] 2 3 ... 284
1  Using Arduino / Programming Questions / Re: saving changes to sketches on: Today at 12:45:04 pm
Where are you trying to save the programs ?

Mine go into C:\Users\Bob\Documents\Arduino which is set in File/Preferences
2  Using Arduino / Programming Questions / Re: LOW edge from 0V on: Today at 08:19:42 am
How long is the LED stay on during each time through loop() ?
How long is the LED stay off during each time through loop() ?
What is the ratio of off to on ?

3  Using Arduino / Programming Questions / Re: Error message when trying to verify Tone tutorial : http://arduino.cc/en/Tutor on: Today at 04:35:05 am
Quote
What am I doing wrong?
Using a Mac ?  smiley
More seriously, using a build of the IDE that may not be stable.  The code compiles OK for me on a PC using IDE versions 1.0.5 amd 1.5.6-r2

Try an earlier version of the IDE or reinstall the once you have.
4  Using Arduino / Programming Questions / Re: Input Disable Untill Point in Program on: Today at 01:20:52 am
As with your other thread about relays that I read the question is difficult to understand.
An input will not "go high", rather an external signal will make it high.  What is it that will take the input high ?  A switch maybe ?

Can you please be more specific in your requirement.
5  Using Arduino / Programming Questions / Re: Internal Relay??? concept?? application in arduino on: August 21, 2014, 04:40:57 pm
Would it be possible to have the question again please, but this time in English ?
Please post all of your program, use code tags and take out all the unnecessary blank lines.

Incidentally, giving pins names such as PinSeven and PinEight is not helpful in the least.
6  Using Arduino / Programming Questions / Re: Incrementing array steps on: August 21, 2014, 03:09:37 pm
Code:
digitalWrite(A5, HIGH);
can't increment, but a variable could.  Initialise the variable to 0, then every time you execute the digitalWrite(); increment the variable.
7  Using Arduino / Programming Questions / Re: Why no servo movement? on: August 21, 2014, 12:08:53 pm
The problem is that while the photoCell value exceeds 60 the only code that will be executed is that between the braces of the while loop and that does not include any servo commands.

If you need to do things that depend on whether the light is on or off then set a boolean variable to true when the light is on and false when it is off then test its value before executing code that depends on its value.

You have potential problems with your timing variables too.  All of them should be declared as unsigned long as they can never be negative. 
8  Using Arduino / Programming Questions / Re: Why no servo movement? on: August 21, 2014, 11:15:10 am
Quote
Can someone help me to understand why I am not getting servo movement while my photocell is in light?
Perhaps because the program is stuck in this while loop
Code:
  while(analogRead(photoCell) > photoValue)
  {      //Suspends LED program while the photocell is in light
    digitalWrite(ledOne, LOW);
    digitalWrite(ledTwo, LOW);
    previousTimeS = millis() - 600000;
    previousTimeL = millis() - 240000;
  }
9  Using Arduino / Programming Questions / Re: millis inside while on: August 21, 2014, 10:58:21 am
Code:
while(val > 60); //while light is still on
//while val (which never changes) is greater than 60
10  Using Arduino / Programming Questions / Re: Display line numbers in IDE editor version 1.0.5 ? on: August 21, 2014, 10:32:43 am
Quote
Nothing in preferences.txt  and Google did not help either..
Looks like no then....

If line numbers are important to the way that you work you could always use an external editor for which there is an option in File/Preferences
11  Using Arduino / Programming Questions / Re: [SOLVED] Nested IFs - a quick check would be appreciated on: August 21, 2014, 08:25:30 am
Quote
I'm still very far from a compilable version of the code - by the time I'll compile the program, it will be much bigger,
My advice would be to stop right now and create a version that compiles even if it calls functions that do nothing or perhaps return fixed values that will vary in the final version. 

Do not continue without testing sections of the program until you have written it all or you will regret it.
12  Using Arduino / Programming Questions / Re: Weird program behaviour when using interrupts on: August 21, 2014, 06:21:35 am
Code:
const unsigned long delayDataBroadcast = 9333;//How often should the RF codes be rebroadcasted in ms
This looks like a very magic number....

Do you actually need to broadcast the data every 9333 milliseconds or could you do it only when currentPower and/or DailyProd have changed ?
13  Using Arduino / Programming Questions / Re: Compiling USB shield on: August 21, 2014, 06:10:31 am
Thanks for the error messages. 
Please post the whole program that you are trying to compile as I can't work out what it is from the link that you gave in your first post.
14  Using Arduino / Programming Questions / Re: Weird program behaviour when using interrupts on: August 21, 2014, 04:32:53 am
If the code that you posted is all that the Arduino is doing then do you actually need to use an interrupt at all ?  Could you not simplify things by polling the input pin ?

How long do the kWh pulses last ?  Unless you are consuming vast amounts of power then I assume that they don't occur very often.
15  Using Arduino / Programming Questions / Re: Can't make button increment my Array :( on: August 21, 2014, 04:25:16 am
You need to increment the index variable when the button becomes pressed, not when it is pressed.  Look at the state change detection example in the IDE to see how to do it.

Also consider using
Code:
pinMode(menuBut, INPUT_PULLUP);
to activate the internal pullup resistor and remove the external pull down resistor if you have one, which I suspect you don't, and wire the button to pull the pin low when pressed.  This will ensure that the input is always at a known voltage and not floating between 0V and 5V.  Note that when you do this you will need to invert the logic of the test to see whether the button is pressed.
Pages: [1] 2 3 ... 284