Mirza Mesic
/
tinf_PWM1
RGB Leds
main.cpp@0:6cf7bc2bed0c, 2019-12-09 (annotated)
- Committer:
- mirzamesic
- Date:
- Mon Dec 09 18:26:40 2019 +0000
- Revision:
- 0:6cf7bc2bed0c
ver1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mirzamesic | 0:6cf7bc2bed0c | 1 | #include "mbed.h" |
mirzamesic | 0:6cf7bc2bed0c | 2 | |
mirzamesic | 0:6cf7bc2bed0c | 3 | PwmOut red(p23); |
mirzamesic | 0:6cf7bc2bed0c | 4 | PwmOut green(p24); |
mirzamesic | 0:6cf7bc2bed0c | 5 | PwmOut blue(p25); |
mirzamesic | 0:6cf7bc2bed0c | 6 | |
mirzamesic | 0:6cf7bc2bed0c | 7 | |
mirzamesic | 0:6cf7bc2bed0c | 8 | |
mirzamesic | 0:6cf7bc2bed0c | 9 | |
mirzamesic | 0:6cf7bc2bed0c | 10 | int main() |
mirzamesic | 0:6cf7bc2bed0c | 11 | { |
mirzamesic | 0:6cf7bc2bed0c | 12 | |
mirzamesic | 0:6cf7bc2bed0c | 13 | red.period_ms(500); |
mirzamesic | 0:6cf7bc2bed0c | 14 | red.pulsewidth_ms(100); |
mirzamesic | 0:6cf7bc2bed0c | 15 | blue.period_ms(500); |
mirzamesic | 0:6cf7bc2bed0c | 16 | blue.pulsewidth_ms(300); |
mirzamesic | 0:6cf7bc2bed0c | 17 | green=1; |
mirzamesic | 0:6cf7bc2bed0c | 18 | while(1) |
mirzamesic | 0:6cf7bc2bed0c | 19 | { |
mirzamesic | 0:6cf7bc2bed0c | 20 | } |
mirzamesic | 0:6cf7bc2bed0c | 21 | } |