Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Slide 13 Product List
Ramp Up Down 2
This example assumes that two position sensors are spaced apart and a drive mechanism is needed to move an object back and forth between the two sensors. Driving the stepper motor causes movement of the object toward one of the sensors. The output of Sensor 0 is connected to input pin P0 of the PCA9629 and Sensor 1 Output is connected to pin P1. Both P0 and P1 are configured as inputs and programmed to generate an interrupt on either a rising or falling edge on P0 or P1. After an interrupt occurs the motor stops and reverses the direction of motion. The result is that the doll head movement is between two positions, A and B, until a motor stop command is issued.
PTM Published on: 2012-05-09