PIC16F877A interface joystick to control speed of DC motor using PWM pin. MikroC for PIC coding.

Описание к видео PIC16F877A interface joystick to control speed of DC motor using PWM pin. MikroC for PIC coding.

Hello guys,
You can support my channel by buying this post on patreon its just 5$ one time only donation.
https://www.patreon.com/posts/guys-yo...

/
/
/
/
/
//////////////////////////////////////// Hello guys Welcome to learning microcontrollers,
Guys I had made a course for you guys on Udemy.
This course will teach you how to directly get your hands dirty on arduino and make useful projects to earn money.
Please do take this course on udemy this will greatly help me to grow my channel.
You will assisting my channel by paying for that course.
Here is the link to the course:


https://www.udemy.com/course/learn-ar...


A quote:
Learn from cradle to grave.
/
/
/
////////////////////// Hello Guys,
Welcome to learning Microcontrollers.
I had made a course for you guys to learn under my direction supervision on Udemy.
This course will make you a master of PIC microcontroller based projects making using MikroC for PIC software.
Please do take this course the link is below. This will greatly help my channel aswell to grow.
https://www.udemy.com/course/pic-micr...

A beautfiul quote:
The road to sucess is always under construction.
/
/
///////////////////////////////////////////////////// Hello guys,
Speed control of DC motor is a very important thing specially in robotics and other drone making type applications. This video is a detailed tutorial regarding how you can use a joystick to control the speed of a DC motor using PWM pin.

How to setup PIC video link:
   • Setting up a PIC16F877A/PIC16F887/PIC...  

Note: Youtube description dont allow writing greater than and less than mathematical symbols, so for that purpose I am gonna replace
LT = Lesser than symbol
GT= Greater than symbol


MikroC for PIC coding for current video: ( version 7.2.0 )



//////////////////////// Code starts here

float joy;
float per;
void main() {
PWM1_Init(5000); // 5000 = 5KHz
Delay_ms(20);
ADC_Init();
Delay_ms(20);

while(1)
{
joy = ADC_Read(0);
Delay_ms(10);
per = joy / 4; /// it brings ADC value in range of 255 i.e max duty

per = per - 128; //// centre = 512 255/ 2 = 127 per/2;

if ( per LT 0 )
{
per = 0;
}
per = per * 2; /// 0 to 255 is available

PWM1_Start();
PWM1_Set_Duty(per); /// max is 255




}

}

////////////////////// Code ends here

Комментарии

Информация по комментариям в разработке