Need the code please!
Pickit 3
Connect a switch to the B6 ports. If you use a dip switch, just select one of them for this task. Please see the PIC16F690 circuit 3 of 3 among the online lectures. One side of the switch will be connected to +5V. The other side will be connected to the B6 port and to the ground after it goes through the 1k to 100k resistor. If you don't connect one side of the switch to the B6 port and the ground after it goes through the resistor, you won't see the switch is off just after you turn the switch off. The charge will stay at the pin for a while even if you turn the switch off. Sometime later, the charge will leak and you will see that the switch is read OFF. This delay is out of our control.
Connect a switch to the B7 port by following the instructions above.
Install 2803. Connect the stepping motor to the 2803 according to the following diagram.
Connect a potentiometer to the AN0 which corresponds to RA0. The potentiometer will have three legs. Two legs at the extreme ends will be connected to +5V and ground. The middle leg will be connected to AN0 (A0) port.
Connect a speaker to the port C4. One wire of the speaker is connected to the port C4, the other is connected to the ground.
Connect two LEDs to the C5 and C6 ports.
Prepare a MikroBASIC program for the PIC16F690. Let the program monitor one switch and the potentiometer.
1. Read the voltage of the potentiometer. If the voltage is below 2.5V, let the stepping motor turn slowly. Turn the motor two times faster if the voltage is above 2.5V.
2. Let the program read one switch. If the switch is on, let the motor work according to (1). If the switch is off, change the light intensity of the LED which is connected to C6 in 4 steps.