Xiaohai Li
/
RPi_MOT_HAT
Raspberry Pi MOT HAT Based on STM32F030R8. The clock needs to be changed to 8MHz after export.
AplicationLayer/SelfTest.cpp@0:633cef71e6ba, 2015-08-09 (annotated)
- Committer:
- nightseas
- Date:
- Sun Aug 09 09:37:55 2015 +0000
- Revision:
- 0:633cef71e6ba
- Child:
- 1:a6bcf44b90df
Basic DC motor and servo control lib finished!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nightseas | 0:633cef71e6ba | 1 | #include "SysConfig.h" |
nightseas | 0:633cef71e6ba | 2 | |
nightseas | 0:633cef71e6ba | 3 | void SelfTest(void) |
nightseas | 0:633cef71e6ba | 4 | { |
nightseas | 0:633cef71e6ba | 5 | //Breath LED |
nightseas | 0:633cef71e6ba | 6 | int i, j; |
nightseas | 0:633cef71e6ba | 7 | led_mb = 0; |
nightseas | 0:633cef71e6ba | 8 | while(1) |
nightseas | 0:633cef71e6ba | 9 | { |
nightseas | 0:633cef71e6ba | 10 | for(j=0;j<=100;j++) |
nightseas | 0:633cef71e6ba | 11 | { |
nightseas | 0:633cef71e6ba | 12 | for(i=0;i<=100;i++) |
nightseas | 0:633cef71e6ba | 13 | { |
nightseas | 0:633cef71e6ba | 14 | led_mb = 1; |
nightseas | 0:633cef71e6ba | 15 | wait_us(j); |
nightseas | 0:633cef71e6ba | 16 | led_mb = 0; |
nightseas | 0:633cef71e6ba | 17 | wait_us(100-j); |
nightseas | 0:633cef71e6ba | 18 | } |
nightseas | 0:633cef71e6ba | 19 | } |
nightseas | 0:633cef71e6ba | 20 | for(j=100;j>=0;j--) |
nightseas | 0:633cef71e6ba | 21 | { |
nightseas | 0:633cef71e6ba | 22 | for(i=0;i<=100;i++) |
nightseas | 0:633cef71e6ba | 23 | { |
nightseas | 0:633cef71e6ba | 24 | led_mb = 1; |
nightseas | 0:633cef71e6ba | 25 | wait_us(j); |
nightseas | 0:633cef71e6ba | 26 | led_mb = 0; |
nightseas | 0:633cef71e6ba | 27 | wait_us(100-j); |
nightseas | 0:633cef71e6ba | 28 | } |
nightseas | 0:633cef71e6ba | 29 | } |
nightseas | 0:633cef71e6ba | 30 | wait_ms(200); |
nightseas | 0:633cef71e6ba | 31 | } |
nightseas | 0:633cef71e6ba | 32 | } |