Consider the Arduino connections in the picture.
The component in the bottom-right of the breadboard is a variable resistor, which creates a changing analogue voltage on its centre pin as you turn it; that voltage swings between the voltages applied on each of the outside pins. The transistor is an N-Channel MOSFET, with its Gate pin in the centre. The battery pack is made up of 4 x AA batteries, with a nominal voltage of 6V.
a.Write small, separate programs that do each of the following:
i. Turns both LEDs on
ii. Blinks the LEDs alternately at 5Hz
iii. Turns the motor on
iv. Turns the left-hand LED on when the variable resistor is turned all the way to the bottom (near zero volts)
v. Prints the value of the analogue conversion from the variable resistor to the Serial monitor
vi. Controls the speed of the motor, proportional to the position of the variable resistor.
vii. Reads a number between 0 – 9 from the Serial monitor and sets the motor speed between 0 and 100 respectively (in equal steps). % All your programs should include a setup() function and a loop() function, and may include other functions and variables as required.
b. Why do the motor and LEDs use different positive voltages (orange connected to “Vin” and red connected to “5V”), and why does the variable resistor use the red one? What would happen if the variable resistor used the orange wire?
That assignment will result in a full program (called a "sketch"), but don't be overwhelmed by it.
Start simple, you learn along the way.
There is a led at pin 9 and a led at pin 10.
In the examples (in the menu of the Arduino IDE) is a sketch to blink a led.
Try to make the led at pin 9 blink, and also the led at pin 10.
For the other things of the assignment are examples and tutorials as well.
What I don't get is why so many schools throw assignments like these at total raw newbies to programming and logic year after year. You'd think that they would have to pass required courses first but nooooooooooo!
Is it too much to hope that you have months to learn and develop?
Usually the teacher dumps the assignment on the unprepared students and expects answers in 2 days to 2 weeks, just going off posts here.
Sounds like a school/college assignment.
Have you constructed the circuit.
Have you done any arduino programming before?
Do you have the IDE (the windows program that you use to write and program the arduino?)
Tom....
Actually each is a separate step project in a series. What you do in part (a) leads to answers in part (b).
So not the circuit but 7 circuits building up to 1.
a.Write small, separate programs that do each of the following:
i. Turns both LEDs on
ii. Blinks the LEDs alternately at 5Hz
iii. Turns the motor on
iv. Turns the left-hand LED on when the variable resistor is turned all the way to the bottom (near zero volts)
v. Prints the value of the analogue conversion from the variable resistor to the Serial monitor
vi. Controls the speed of the motor, proportional to the position of the variable resistor.
vii. Reads a number between 0 - 9 from the Serial monitor and sets the motor speed between 0 and 100 respectively (in equal steps). % All your programs should include a setup() function and a loop() function, and may include other functions and variables as required.
Start simple, write out your names for your pin numbers.
int dave = 1;
int wrote =2;
int this = 3;
int sketch =4;
IF we do your work for you, you cannot learn.
this is some of the most fundamental parts of the Arduino software.
WHEN you learn this is up to you.
if you learn it now, your future will be simple.
if we do your work you will have to learn it once you have so many things floating around in your head, you will drop out of the course.