I would like to use a joy stick to control electricity up to 3 volts.We are doing an experiment called galvanotaxis to control protozoa They are attracted to negative voltage i would like to see id we can control their movements.Normally in a very basic setup you have 2 poles Ether connected to a (platinum wire or lead from a pencil) at the opposite of each other as power increases they swim towards the negative. up and down and left and right would be fine but 8 degree axis would be amazing!does anyone have an example on how to do the controls for this?Thank you Tommy
analogWrite(<pinNumber>, analogRead(A0) * 0.1494)
and then the output pin will provide electricity acording to the joystick position when it's on the highest position it'll provide 3V and on the lowest 0V
No, that's not how analogWrite works. It would put out a PWM signal alternating between 0V and 5V with an average value of 3V. That wouldn't work for what the OP wants at all.
Depending on the applications he uses that for, it might work.For example, dimming an LED controlling servo...