Hi new to arduino
I have a basic sketch i found for turning a servo to "0" and 180 via 2 inputs which works on my uno but not on my nano any ideas. sketch below
#include<Servo.h>
int pos = 90;
int pin2 = 2;
int pin3 = 3;
int LedHi = 5;
int LedLow = 6;
Servo servo1;
@shrekanddonkey66, your topic has been moved to a section of forum that is more suitable.
Can you please edit your post, select all code and click the </> button above the text box; next save the post again. This will make it easier to read and copy.
david i too noticed that and changed the servo to pin 9 stil not working.
the wife wants a watering system for the green house so all i want to do is open a valve via a servo turning 180degrees when an input goes high and back to 0 when input is low
Servos take more current than an Arduino can provide, especially if they're actually doing some work. You may get away with it for a demo where an unloaded servo just turns to and fro.
Depending on the servo and the power supply's capacity, it might be plausible to power them both from the same PSU.
Note also that many servos don't have 180 degrees of movement, but will happily draw loads of current trying to get there if you ask. Find out by experiment how far yours go.
A latching solenoid valve made for irrigation systems is an easy way to control a water line. You don't even need an arduino if all you want is a push-button manual control, although at that point a 1/4 turn manual ball valve is simpler.
David I'm using a water butt so the pressure is too.low for a soleniod valve ,hence the idea of using a 1/4 turn or half turn full bore valve with some time of motor and control.
Original idea was from thingiverse " watering system "
A regular solenoid valve does not require ANY pressure, It will open/close just setting in the air with no fluid at all. Perhaps you are thinking of "piloted solenoid valves" which do require a pressure differential of a small amount.
Paul