PICs are Rugged !
So, I risked it.
First off all, lets cut-off a pair of legs, (as talked in this thread)
**broken link removed**
Then, lets make this circuit
**broken link removed**
Then, Lets write this code
Finally, Lets burn it and see it in action,
The motor I had was a 3V motor, and its resistance was 12ohm. To, limit the current down, I added, 250 ohm in series. Sounds absurd, yeah, but the motor rotates anyway. And thats all I wanted, I want the motor to rotate. No loads.
Next step: Rip another pair of legs and repeat.
So, I risked it.
First off all, lets cut-off a pair of legs, (as talked in this thread)
**broken link removed**
Then, lets make this circuit
**broken link removed**
Then, Lets write this code
Code:
#include<htc.h>
#define _XTAL_FREQ 4000000
#define output RA4
#define output_tris TRISA4
void main(){
CMCON = 0xff; //disable all the comparators
ANSEL = 0b00000000; // disable all the analog modulse
OPTION = 0b11010100 ;// disable internal weak pullup,,internal clock source for T0
TRISA1 = 0;
TRISA2 = 0;
TRISA0 = 1;
while(1){
if(RA0){
RA2 = 1;
RA1 = 0;
}else{
RA2 = 0;
RA1 = 1;
}
}
}
The motor I had was a 3V motor, and its resistance was 12ohm. To, limit the current down, I added, 250 ohm in series. Sounds absurd, yeah, but the motor rotates anyway. And thats all I wanted, I want the motor to rotate. No loads.
Next step: Rip another pair of legs and repeat.
Last edited by a moderator: