This is the initial version of my PWM fan control program for BE 3205. This program is not well designed but it work. The point of this lab is the transistor driver circuit, not this program.
Revision 1:9394056a2287, committed 2022-05-05
- Comitter:
- CSTritt
- Date:
- Thu May 05 02:41:19 2022 +0000
- Parent:
- 0:49b2df5f87eb
- Commit message:
- Changed output to D13. Corrected instruction wording.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Apr 18 01:55:28 2018 +0000 +++ b/main.cpp Thu May 05 02:41:19 2022 +0000 @@ -12,15 +12,15 @@ #include "mbed.h" Serial pc(USBTX, USBRX); // Default settings are 9600 Baud, 8-N-1. -PwmOut myPWM(PWM_OUT); // PB_3, D3 Works on CE Dev Board. +PwmOut myPWM(D13); // PB_3, D3 Works on CE Dev Board. DigitalOut myLED(LED1); int main() { - pc.printf("\n\nThis is FanPWM v. 1.0.\n"); - pc.printf("Set Terminal > Local echo.\nMake New-lines to LF.\n"); - pc.printf("PWM output is pin D3.\n"); + pc.printf("\n\nThis is FanPWM v. 1.1.\n"); + pc.printf("Set Terminal > Local echo.\nSet New-lines to LF.\n"); + pc.printf("PWM output is pin D13.\n"); float myValue = 0.50; // Initialize to default value. Use for input. myPWM.write(myValue); pc.printf("PWM set to %0.2f by default.\n", myPWM.read()); // Read value.