Re: help to develop psoc based solar tracker

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 sir project is intensity based solar tracking according to dat project wen intensity is low my panel rotates so i following code for comparator design and stepper motor

   
        
   
    comparator c code   
   
    #include <m8c.h>        // part specific constants and macros   
   
    #include "PSoCAPI.h"    // PSoC API definitions for all User Modules   
   
        
   
        
   
    void main(void)   
   
    {    
   
    // start the Low Threshold comparator with HIGH Power   
   
    lt_Start(3);   
   
     // start the High Threshold comparator with HIGH Power   
   
     ht_Start(3);   
   
     //Start the DigBuf   
   
     DigBuf_Start();   
   
          
   
           
   
          
   
       while(1) {   
   
          
   
       }      
   
    stepper motor c code   
   
        
   
    #include <m8c.h>        // part specific constants and macros   
   
    #include "PSoCAPI.h"    // PSoC API definitions for all User Modules   
   
        
   
        
   
        
   
    #define HALFSTEP   
   
        
   
    void main()   
   
    {   
   
    Half-Step Initialization  */      
   
       PRS8_1_WriteSeed(0x83);   
   
       PRS8_2_WriteSeed(0x38);   
   
       PRS8_3_WriteSeed(0x0e);   
   
       PRS8_4_WriteSeed(0xe0);   
   
        
   
    //  Start shift register   
   
       PRS8_1_WritePolynomial(0x80);   
   
       PRS8_2_WritePolynomial(0x80);   
   
       PRS8_3_WritePolynomial(0x80);   
   
       PRS8_4_WritePolynomial(0x80);   
   
       PRS8_1_Start();   
   
       PRS8_2_Start();   
   
       PRS8_3_Start();   
   
       PRS8_4_Start();   
   
         
   
    //  Start internal 360 degree pulse (96 step in half step mode)   
   
    //  If user need an external input the common prs clock should connect ta an external pin   
   
       Counter8_1_Start();   
   
       Counter8_2_Start();   
   
          
   
       while(1) {   
   
          
   
       }      
   
        
   
    accordingly i hve these two codes .sir in my project comparator senses d panel voltage wen it reaches d threshold comparator goes high and stepper motor program is initiated ,sir i need certain steps as i am not aware of c program ,sir i need c code dat wen comparator goes high stepper motor is initiated and rotated one step and after dis control gvn to comparator prgrm and it den senses d panel voltage   
0 Likes
8 Replies