Home > Back-end >  51 single chip microcomputer intelligent car about L298n for help
51 single chip microcomputer intelligent car about L298n for help

Time:09-16

I use 51 microcontroller 51 series) (currently only learned two l298n drive, power supply with single-chip microcomputer on external 5 v power supply, the battery is to power a microcontroller, the program finished only one l298n motor can drive the motor, after another with a multimeter to measure the 5 v voltage input, but not h bridge voltage, this is what happened to the great god
Attach your own test program: # include & lt; Reg51. H>
# define uint unsigned int
# define uchar unsigned char
//dc tractor foot definition
Sbit Left_in_1=P0 ^ 4;
Sbit Left_in_2=P0 ^ 3;
Sbit Left_out_1=P0 ^ 2;
Sbit Left_out_2=P0 ^ 1;
Sbit Right_in_1=P2 ^ 1;
Sbit Right_in_2=P2 ^ 2;
Sbit Right_out_1=P2 ^ 4;
Sbit Right_out_2=P2 ^ 3; Sbit En_left_1=P0 ^ 5; Sbit En_left_2=P0 ^ 0;
Sbit En_right_1=P2 ^ 0; Sbit En_right_2=P2 ^ 5; Void main ()
{the while (1)
{
En_left_1=1;
Left_in_1=0;
Left_in_2=1; En_left_2=1;
Left_out_1=0;
Left_out_2=1; En_right_1=1;
Right_in_1=0;
Right_in_2=1; En_right_2=1;
Right_out_1=0;
Right_out_2=1;
}
}
  • Related