siti noorzazlina
Newbie level 4
Hi, I would like to know how do you built a code that have three input, let say Input 1, Input 1, Input 3, and Input 4 which correspond to 110, 101, 011 and 111 respectively. Note that 1 indicates 5V and 0 indicates 0V (ground). When the code read 110 (input 1), for example it will output the LED as what the programmer want, in this case 0x03, and also drive the stepper motor one step further. I already built a code but it is not working successfully, I don’t know which one is wrong, either my coding, or connection from PIC to ULN2003A. Can anyone tell me what is wrong? I’m new to ULN2003A. I have not used it before. I just connected it based on this website. Electronics EveryWhere: Stepper Motor Programming
Input 1: PORTB == 0b11000000 will give output 0x03 (LED) and stepper motor will move one step.
Input 2: PORTB == 0b10100000 will give output 0x06 (LED) and stepper motor will move another step.
Input 3: PORTB == 0b01100000 will give output 0x09 (LED) and stepper motor will move another two steps.
Input 4: PORTB == 0b11100000 will give output 0x0C (LED) and stepper motor will move another three steps.
Attached is the code that I am working on.
Input 1: PORTB == 0b11000000 will give output 0x03 (LED) and stepper motor will move one step.
Input 2: PORTB == 0b10100000 will give output 0x06 (LED) and stepper motor will move another step.
Input 3: PORTB == 0b01100000 will give output 0x09 (LED) and stepper motor will move another two steps.
Input 4: PORTB == 0b11100000 will give output 0x0C (LED) and stepper motor will move another three steps.
Attached is the code that I am working on.