Show Posts
Pages: 1 ... 23 24 [25] 26 27 ... 290
361  Using Arduino / Programming Questions / Re: Switch Control on: July 13, 2014, 01:27:42 am
How will c change when the while loop is preventing other code being executed ?
362  Using Arduino / Programming Questions / Re: Fail When It Have Too Many IF, ELSE IF?? on: July 12, 2014, 02:05:42 pm
Quote
However,when I comment some of it out everythings work fine!
That makes it sound suspiciously like you have a problem with shortage of memory and you do have some large arrays of ints in the program.
363  Using Arduino / Programming Questions / Re: Delay() function in setup() on: July 12, 2014, 03:01:10 am
You have my permission to use it.

[hint]
One thing that I like about the Arduino is how easy it is to try things for yourself.
[/hint]
364  Using Arduino / Programming Questions / Re: Problems with servo motors and pots (Project 05 Mood Cue). on: July 12, 2014, 01:16:06 am
Please post details of your circuit as it is now.
365  Using Arduino / Programming Questions / Re: Problems with servo motors and pots (Project 05 Mood Cue). on: July 11, 2014, 04:33:47 pm
In the photograph the pot does not appear to be connected to anything and if the 3 pin lead at the far end of the board is the servo connection then that does not appear to be connected to anything either.
366  Using Arduino / Programming Questions / Re: Switch Control on: July 11, 2014, 12:30:25 pm
Code:
        while( c !=509){
         }
Unless c equals 509 when this while loop starts then it will never end.  What is it meant to do ?
367  Using Arduino / Programming Questions / Re: Switch Control on: July 11, 2014, 01:31:45 am
How is the readsw () function being called ?
Please post your complete program so that the use of the function can be seen in context.
368  Using Arduino / Programming Questions / Re: PWM Pins 9 and 10 on Uno on: July 11, 2014, 01:28:05 am
The reference page for the detach() method says this
Quote
detach()

Description

Detach the Servo variable from its pin. If all Servo variables are detached, then pins 9 and 10 can be used for PWM output with analogWrite().
This would seem to indicate that the pins should be able to be used for PWM.  Where and how are you setting the mode of the pins ?

Quote
If I make a call to a digital servo, it's routine runs, then I detach it but the pins are still set for the servo object
Can you clarify whether you want to use the same pins for servos and PWM or whether it is just the side effect of using the servo library that you are trying to circumvent ?
369  Using Arduino / Programming Questions / Re: Time.h compiling error on: July 10, 2014, 04:35:58 pm
Quote
I won't post my code because I'm just trying to output the time from the sample sketch that comes with the library
I don't think that is a good reason not to post the code and a link to where you got the library.
370  Using Arduino / Programming Questions / Re: Need help with alarm system involving a PIR and piezo on: July 10, 2014, 03:41:42 pm
Forget the PIR for now and write a program that makes a beep.  Then you can think about making a beep when the PIR is triggered.
371  Using Arduino / Programming Questions / Re: Relay not activating – help please on: July 10, 2014, 11:12:00 am
You seem to turn on relay 1 if the voltage is too high, but you never turn it off, and turn off relay 2 if the voltage is too low but you never turn it on.

I think that had better provide a circuit diagram so that we can see how things are wired in your project.  I note that in your latest reply you refer to "the relay" but you have 2 pins apparently relating to it.
372  Using Arduino / Programming Questions / Re: Unojoy - just getting some errors, not sure why on: July 10, 2014, 10:48:04 am
Think what the variable i is used for.
You said
Quote
i=number of 360 controllers connected, i has to be equal to or less than 4
Unless you have 5 controllers connected I suspect that the value of i must be less than 4 rather than less than or equal to 4.

What do you want to do with the data from the controllers, how is it stored and how is it accessed ?    The getControllerData() function seems to collect the data but you are not telling it which controller to look at when it is called.  The data seems to be stored in the controllerData structure but how does the program know which controller it relates to  and how would you access it later ?

You could call the getControllerData() function with a parameter of i, the controller number but as far as I can see the data retrieved from controller i is not stored in a way that relates to that particular controller.  One problem here is that most people will not have the same hardware and libraries as you which makes helping difficult.  Do the libraries that you are using come with any example programs ?

373  Using Arduino / Programming Questions / Re: Unojoy - just getting some errors, not sure why on: July 10, 2014, 02:45:23 am
Quote
i is declared under the Usb.Task()
Yes, but it is declared and valued as part of a for loop initialisation.  As such it will not be in scope outside of that for loop unless it is passed as a parameter to a function, which it isn't.
374  Using Arduino / Programming Questions / Re: Unojoy - just getting some errors, not sure why on: July 10, 2014, 01:32:11 am
The error message is telling you exactly what is wrong. 
On that line, and many others in the getControllerData() function the variable i is used as a parameter for the getButtonPress() function.  Where is the variable i declared and where is it given a value ?
375  Using Arduino / Programming Questions / Re: Unojoy - just getting some errors, not sure why on: July 09, 2014, 03:46:11 am
Check where your loop() function starts and ends.

This code
Code:
Usb.Task();

if(Xbox.XboxReceiverConnected)
{
  for (uint8_t i = 0; i < 4; i++) {
    if (Xbox.Xbox360Connected[i]) ]  }
}

is not in a function.
Pages: 1 ... 23 24 [25] 26 27 ... 290