Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 273
106  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.
107  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.
108  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 ?
109  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.
110  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 ?
111  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.
112  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.
113  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.
114  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 ?

115  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.
116  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 ?
117  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.
118  Using Arduino / Programming Questions / Re: odd error i cant figure out on: July 08, 2014, 12:59:28 pm
Code:
  if (output_format == OUTPUT__FORMAT_BINARY);
I had a suspicion that is what you meant.  It is wrong, as is
Code:
  else if (output_format == OUTPUT__FORMAT_TEXT);
Look at http://arduino.cc/en/Reference/If carefully.  Do you see any semi-colons at the end of the lines except where the test is immediately followed by the one line of code to be executed if the test is true ?

Including the semi-colon effectively stops the test from happening and causes the following code block to be always executed.
119  Using Arduino / Programming Questions / Re: odd error i cant figure out on: July 08, 2014, 12:35:48 pm
so the kicker is it was all due to the lack of a semicolon in the
Code:
if (output_format == OUTPUT__FORMAT_BINARY)
so now its working properly....
i feel like such a noob but thats the fun of learning
Can you please post your working program because it seems to me that a missing semi-colon in that line was probably not the cause of the problem.
120  Using Arduino / Storage / Re: can arduino read current size/capacity of one SD card? on: July 08, 2014, 06:13:11 am
http://arduino.cc/en/Tutorial/CardInfo may help but I have no experience of using the functions.
an extract from the code
Code:
  volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
  volumesize *= volume.clusterCount();       // we'll have a lot of clusters
  volumesize *= 512;                            // SD card blocks are always 512 bytes
  Serial.print("Volume size (bytes): ");
  Serial.println(volumesize);
  Serial.print("Volume size (Kbytes): ");
  volumesize /= 1024;
  Serial.println(volumesize);
  Serial.print("Volume size (Mbytes): ");
  volumesize /= 1024;
  Serial.println(volumesize);

As an alternative how about writing to the first card until the write fails then continuing with the second card ?  This would also cover the situation where the first card fails for some reason.  Mind you, I do wonder what you are going to do when the second card fills up.
Pages: 1 ... 6 7 [8] 9 10 ... 273