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

PSoC™ 5, 3 & 1 Forum Discussions

Level 1
First question asked Welcome!
Level 1

The motor assembly includes a limit switch that operates in both the top and bottom positions

also switches in the lower end position (closed in the end positions, during the

Motor drive open).

The first task:

The motor should be run up and down 1000 times and on each run the limit switch must open and close again. Depending on the test result, a red or green LED should be switched on.



I have already defined my macros


#define LOW 

#define HIGH 

#define LED_GREEN_ON LedGreen_Write(HIGH);

#define LED_GREEN_OFF LedGreen_Write(LOW);

#define LED_RED_ON LedRed_Write(HIGH)

#define LED_RED_OFF LedRed_Write(LOW);

#define MOTOR_UP {MotorDown_Write(LOW);\


#define MOTOR_DOWN {MotorUp_Write(LOW);\


#define MOTOR_STOP {MotorUp_Write(LOW);\


#define READ_END_POS EndPosition_Read()

Please help me in approaching this problem. I have to use psoc creator.

1 Solution
Moderator 100 sign-ins 25 solutions authored 50 replies posted

Hello @revolution 

Could you let us know exactly what kind of a motor control algorithm you are looking for ? 

As you may be knowing, there are several motor control algorithms and knowing what you are looking for is important. Also, various other factors need to be considered before developing the code like the type of the motor, motor parameters, motor rating, control architecture that you want to use. 

Before developing the motor control algorithm, please consider preparing a plan for the motor controller considering all the aspects some of which are mentioned above.

If you need any specific help on any issue that you face, I will be happy to help you

Thanks and regards


View solution in original post

1 Reply