Loading...
  Show Posts
Pages: 1 2 3 [4] 5 6 ... 17
46  Using Arduino / Programming Questions / Re: Help with Code - blocking menu on: April 23, 2013, 09:21:38 pm
In addition, check out the switch statement.
47  Using Arduino / Programming Questions / Re: Motor Acceleration Timer Deceleration Problem on: April 23, 2013, 08:54:12 pm
I am having some trouble getting the following code to work. Any Ideas?

Code:
   if (second > time){   // Count over decel motor
      Serial.print("Time Out");
       for (int motorspeed = stir_speed; motorspeed >= 0; motorspeed--) {
 

Assuming stir_speed is a positive number, then motorspeed will always be >0 and your for loop won't do anything. That's why it's not ramping up. Try:
Code:
for (motorspeed = stir_speed; motorspeed <= 0; motorspeed--)
48  Using Arduino / Programming Questions / Re: Help Reversing Servos!!! on: April 22, 2013, 11:21:28 pm

Heres the code:
Code:
pos2 = 90 + (i*1);     

 
i*1 will always = i so
Code:
pos2 = 90 + i;     

will do exactly the same.
49  Using Arduino / Programming Questions / Re: Loop in a Switch Case Statment on: April 22, 2013, 10:51:53 pm
My Complete code:

Code:
void loop() {
  // check the status of the switch
  switchState = digitalRead(switchPin);

  // compare the switchState to its previous state
  if (switchState != prevSwitchState) {
....
     // save the current switch state as the last state
    prevSwitchState = switchState;
  }
}

If switchState hasn't changed, your program will miss out all the code between the {...}.
Close the if statements after setting the LCD output and use else{...}

Also you can use just one if statement:
Code:
if (switchState != prevSwitchState && switchState == LOW) {...}
50  Using Arduino / Programming Questions / Re: Completing a task in a loop before breaking out. on: April 21, 2013, 08:39:44 pm

What is this line of code supposed to do?

 
Code:
else (xsensorReading < 333);       
           
51  Using Arduino / General Electronics / Re: Is my circuit OK? (help a newbie out) on: April 21, 2013, 11:31:41 am
Thanks!

I'll move the power source and sink around.

If the cylinders are EMI suppression inductors, does that mean I can take out the diodes?

No. They are still needed.

Quote
I only put them in to protect against power-spikes but they've been getting super-hot.

They're getting hot because they're zenner diodes! Replace them with 1N4002 or 1N4003 diodes.
52  Using Arduino / Programming Questions / Re: Light controll problem on: April 21, 2013, 11:05:02 am
While the program is doing 'delay', it's not able to do anything else, like reading the state of the button, so your button will only be read every 4 seconds.

Look at the 'Blink without delay' sketch.
53  Using Arduino / Project Guidance / Re: Hello to the Arduino community. "Water" project advice... on: April 21, 2013, 10:07:04 am
You should, to make it failsafe, have the valve shut when there's a power outage.
54  Using Arduino / Project Guidance / Re: Traffic Light - advice? on: April 21, 2013, 09:54:09 am
You should switch the lamps using relays, to keep the mains voltage away from your Arduino.
55  Using Arduino / Project Guidance / Re: looking for a solenoid valve to open partially... on: April 21, 2013, 09:49:35 am
Or a motorised valve. These act like a motorised tap [fawcet].
56  Using Arduino / Project Guidance / Re: Traffic Light - advice? on: April 21, 2013, 09:29:08 am
Thanks.The lights are just normal 40 watt light bulbs. It plugs into the wall.

What voltage?
57  Using Arduino / Project Guidance / Re: Hello to the Arduino community. "Water" project advice... on: April 21, 2013, 12:08:27 am
I wonder if you are thinking of a "too perfect" secondary piping system. It wouldn't be subject to pressure so it would not have to be as carefully jointed as the pressure pipes. Indeed it may not even matter much if it leaked a little if the leak-points could be located where the leakage could be managed. Even a partial secondary system could be useful if it carried escaped water to a point where it would be easily detected. For example there could be several small sumps each with a small water level detector (perhaps just two bare wires that would conduct a small current if the water reached them.

The secondary piping would not even have to be a complete cylinder. Something like this would work

      _____
      | O |
    |         |
   ------------

The "o" is the pressure pipe with a cover above and beside it that drains into a channel below. There is no need for the cover to be connected to the channel.


I suggest a compromise solution. Use square/rectangular plastic electrical trunking. The 'lid' would be strong enough to contain all but the most catastrophic of bursts under pressure and the availability of various sizes and fittings ('T's and elbows) would make it fairly easy to fit.

My idea for the water sensor is to use a piece of stripboard with each of the two wires connected to alternate strips, thus avoiding possible false alarms if the two wires accidently touch. Not a good idea if it happens when you're in the middle of a shower.  smiley
58  Using Arduino / Project Guidance / Re: Triggering sound with arduino uno (need help) on: April 20, 2013, 11:29:55 pm
...play it through large speakers.

'Large speakers' would suggest that you'll also need an audio amplifier.
Are you playing the sounds to a football stadium, a living room or something in between?
In other words, how large is large and how much sound power do you need?
59  Using Arduino / Project Guidance / Re: Feasibility of making a mouse with an Arduino? on: April 20, 2013, 10:58:07 pm
I am looking into using an Arduino to make a left-handed mouse.

All mouses (mice?) are ambidextrous. You just need to change the mouse settings in your operating system.
60  Using Arduino / Project Guidance / Re: Help with designing programs for beginers on: April 20, 2013, 10:48:15 pm
For the children to do, how about a 'hand capacitance' LED dimmer. Once it's powered up, they can see it working. They could then go on to do something useful with it, maybe operating a solenoid to unlock a box when a hand is held over the sensor. As an incentive, place a chocolate bar inside the locked box, which can only be retrieved when the project is working successfully.  ]smiley
Pages: 1 2 3 [4] 5 6 ... 17