programming stepper motor using C

Thread Starter

saeight_87

Joined Apr 8, 2010
1
can anyone help me in write the coding in C to control the stepper motor based on the intensity of solar energy received. project use the 4 photoresistor to compare the voltage for every output from the photoresistor circuit. used PIC 16F877A
 

retched

Joined Dec 5, 2009
5,207
Without knowing how your circuit is wired, It would be impossible to write your code.

But a little help.. You can use the on board ADC to get the readings from the photosensors and then use the result to vary the PWM to the stepper motor driver
 

John P

Joined Oct 14, 2008
2,026
No PWM, this is a stepper system.

Would it be sufficient just to say "If A+ > A-, run the motor at some reasonable speed"?

That makes the control algorithm very simple. Start with something to run the motor when you press a button connected to an input pin (Port B is best for this, as it has internal pullups) and then develop the control via the analog inputs.
 
Top