gold12star
Junior Member level 3
hello to everyone
I kown how to control servo motor and DC motor using h-bridge
but I don't know how to combaine these two code together
and can I control them usnig only one port such as B
because I use UART and I can't control more than one port when I send the data through UART
using PIC16f877A and MikroC Pro
please help me
thank you
Servo motor
DC motor
I kown how to control servo motor and DC motor using h-bridge
but I don't know how to combaine these two code together
and can I control them usnig only one port such as B
because I use UART and I can't control more than one port when I send the data through UART
using PIC16f877A and MikroC Pro
please help me
thank you
Servo motor
Code:
char i;
void main() {
for (i=0; i<=50; i++){
trisb=0b00000000;
portb=0b10000000; //b7 input signal for servo motor
Delay_us(1500);
portb=0b00000000;
Delay_ms(18); }
}
DC motor
Code:
void main() {
TRISC = 0b00000000;
PORTC = 0b00001000; // c3 for enable pin in h-bridge ,c2 for input pin in h-bridge
TRISD = 0b00000000;
PORTD = 0b00000010; // d1 for output pin in h-bridge
}