Controlling DC motor using power MOSFET

Dependencies:   mbed

Committer:
Nydrel
Date:
Wed Feb 14 09:29:20 2018 +0000
Revision:
1:f5e6f3468ec3
Parent:
0:2366bfc35e27
Implemented for loop and PWM to accelerate speed of the DC motor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Nydrel 0:2366bfc35e27 1 #include "mbed.h"
Nydrel 1:f5e6f3468ec3 2
Nydrel 1:f5e6f3468ec3 3 PwmOut Ctrl(p21);
Nydrel 0:2366bfc35e27 4
Nydrel 0:2366bfc35e27 5 int main() {
Nydrel 0:2366bfc35e27 6 while(1) {
Nydrel 1:f5e6f3468ec3 7 float x = 0.0; x < 0; x+=0.01){
Nydrel 1:f5e6f3468ec3 8 Ctrl = x;
Nydrel 1:f5e6f3468ec3 9 }
Nydrel 0:2366bfc35e27 10 }
Nydrel 0:2366bfc35e27 11 }