Show Posts
Pages: 1 ... 327 328 [329] 330 331 ... 748
4921  Using Arduino / Programming Questions / Re: Colorduino with led matrix - not in sync error on: May 18, 2013, 08:43:26 am
Perhaps you have not selected the correct board type, or the boards entry that you have selected is not configured correctly. Did the documentation with the Colorduino board tell you whether it needed any non-standard settings?
4922  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 18, 2013, 08:41:12 am
Sorry, posting 5500+ lines of code would have been silly when this was more out of interest than anything else.  Someone was able to come up with the solution without the code.  I am more than happy to jump in and help others and usually the code is necessary but on this occasion it would have been ott.

I'm certain that it would have been possible to demonstrate the problem in considerably less than 5500 lines of code. Just the act of doing so would probably have been enough for you to spot the problem on your own. In any case, posting a minimal sketch that actually demonstrated the problem would have avoided relying on some inspired guesswork by majenko and would have avoided everyone else looking at this thread from wasting time trying to guess what you were doing. If you had posted a short sketch demonstrating the problem, it would have been blindingly obvious what was causing it.
4923  Using Arduino / Programming Questions / Re: Arduino UNO sampling rate on: May 18, 2013, 08:35:43 am
To control the sampling rate, use the approach demonstrated in the 'blink without delay' example sketch to make the voltage reading code run at regular intervals.

Look at the example sketches for the SD library to see how to create a file and write text to it.

Please use [ code ] [ /code ] tags when posting code, to prevent the forum software from munging it.
4924  Using Arduino / Project Guidance / Re: What is best way to create an adjustable relay delay with a know/dial? on: May 18, 2013, 08:32:49 am
For the dial, consider using a rotary switch with a different resistance connected to each switch position, and connect the common terminal in series with another resistor to act as a voltage divider. You can then use an analog input to read the voltage and determine which switch position is selected from that.

For the solenoid output you will need some sort of driver circuit. You could use a standard Arduino with an H-bridge motor driver or relay shield, or a clone such as Baby Orangutan which has an integral dual H-bridge motor driver.

If it's to be used in a hostile environment I would suggest putting the whole thing inside a sealed enclosure, with just the external wiring connections and output spindle for the rotary switch exposed.

You'll need to know what the electrical characteristics of the hot shoe are to design the circuit to connect it to the Arduino. Perhaps you already know, and if not I'm sure it wouldn't be hard to find out.
4925  Using Arduino / Project Guidance / Re: Sequential Turn Signals on: May 18, 2013, 08:25:05 am
The code looks as if it should flash the lamps correctly, although I think you might find the lack of responsiveness to switch inputs irritating and you will probably want to fix that. But it should basically work. You haven't got any serial port output there so we can't tell whether the Arduino is running or what it thinks it's doing. How is it being powered?  What are you using for the switch inputs and how are they connected? What are you using for the turn signals, and how are they powered and connected?
4926  Using Arduino / Project Guidance / Re: calling functions with input pins on: May 17, 2013, 09:18:08 pm
Quote
Code:
     ++alarmCount;
Try
Code:
alarmCount++;

There's lots wrong with the code posted, but there's nothing wrong with this part - if you don't use the value, it doesn't matter whether you use a pre-increment or post-increment operator.
4927  Using Arduino / Programming Questions / Re: Structure not defined error on: May 17, 2013, 07:27:08 pm
can you show in my code where to put it

In order to compile, your code must include declarations for any functions that are used before they are defined. To help you do this (or get in the way and make a right pig's ear of it, depending on your point of view) the IDE inserts function declarations for all of your functions. But it adds them in the wrong place; it adds them before the type declarations in your code, which means that any function declarations which depend on types you defined in that file won't compile.

To fix this, you can insert this statement in your code after you declare the finger type (this will only work for later versions of the IDE):
Code:
int finger_move(int factor,finger FingerVerable, int Angle, int Side);

Or, put the declaration of the finger struct in a header file and #include that header in your sketch file (this should work with all IDE versions).

I see you've included some declarations in your code for functions that aren't implemented, so I suggest you get rid of those.

I also see you've implemented the main() function. There are very few situations where that is the right thing to do, and this isn't one of them. The entry points to your sketch should be setup() and loop(), as shown in all the examples that ship with the IDE.

Also, when posting code please enclose it in [ code ] [ /code ] tags. You can insert them into a post by clicking on the # button in the edit window. You can fix your previous posts by editing them, selecting the code and clicking the # button to add the code tags. The code tags stop the forum software from munging your code, so that it displays properly.
4928  Using Arduino / Programming Questions / Re: Cant get Ethernet WebClientRepeating example working (possibly incorrect DNS) on: May 17, 2013, 07:17:37 pm
You DNS server address should be the address of an actual DNS server. Since the Arduino is not a DNS server, it is never correct for it to be the same as the Arduino's own address.

On Windows, you can find the actual address of the local DNS server in the TCP/IP properties under network settings. You can also find it from a command prompt on most platforms by running 'nslookup localhost'.
4929  Using Arduino / General Electronics / Re: Problem with my project(arduino keeps resetting) on: May 17, 2013, 07:09:24 pm
That leaves the next question - where do the switched terminals on the relay connect to?

I think that either the act of energizing the coil is causing the reset (although I don't see how at the moment) or the problem is caused by the relay switched circuit being closed/opened.

To find out which, I suggest you try reproducing the problem with the relay switched terminals isolated (so that operating the relay does not switch anything), and also try to reproduce it by manually making/breaking the circuit that would normally be switched by the relay.
4930  Using Arduino / Project Guidance / Re: replace the 16MHz clock crystal with a 555 timer?? on: May 17, 2013, 07:04:43 pm
i was asked to use as much resources as possible

A 555 timer is not at all suitable to replace a crystal/resonator. It would probably get you a better assessment if you used resources that were sensible to achieve something useful, rather than just adding parts for the sake of adding them. Look for something you can do with an Arduino that requires external electrics/electronics.
4931  Using Arduino / Programming Questions / Re: Structure not defined error on: May 17, 2013, 05:58:51 pm
It's not your fault. The problem is that the Arduino is generating function declarations for you and it is screwing it up because it does not cope correctly with function signatures that use types declared in the sketch file. Specifically, it puts the function declarations in the wrong place in the file.

If you are using a late enough version of the IDE I understand you can prevent the error by adding your own function declarations after the type declarations, thereby preventing the IDE from adding its own ones in the wrong place.

Alternatively, put your type declarations in a separate header file and #include the header at the top of your sketch.
4932  Using Arduino / General Electronics / Re: Problem with my project(arduino keeps resetting) on: May 17, 2013, 05:52:54 pm
I can't spot the relay on that circuit. You say it's being controlled by the sensor - is the relay coil being powered from the same supply as the Arduino? If so it could be that the coil is either taking so much current that it is causing a brown-out on the supply, or that it doesn't have flyback protection and is putting a voltage spike onto the power line when it is turned off.
4933  Using Arduino / Programming Questions / Re: SoftwareSerial strange behaviour on: May 17, 2013, 04:30:54 pm
I haven't used it, but I remember reading that there is an AltSoftSerial which avoids the 'one port at a time' restrictions of the standard SoftwareSerial implementation.
4934  Using Arduino / Programming Questions / Re: looking for help to translate a sketch so that non-programmers understand it on: May 17, 2013, 04:27:56 pm
Now i would like to hear if the explainations make sence to you and what you think of the explainations...

Since you seem to have changed the objectives in the middle of this thread, perhaps you ought to explain who your comments are intended for, what you expect them to know already, and what you're trying to inform them about. They're obviously not trying to achieve what comments are usually used for, so I'm baffled as to what you are trying to achieve with them.
4935  Using Arduino / Programming Questions / Re: delay() & equivalent not working. on: May 17, 2013, 04:12:07 pm
The sketch locks up at the delay

Can you prove that?
Pages: 1 ... 327 328 [329] 330 331 ... 748