Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:c858fcbd0f70, 2014-04-03 (annotated)
- Committer:
- tim010
- Date:
- Thu Apr 03 15:45:34 2014 +0000
- Revision:
- 0:c858fcbd0f70
LV5 - PAI - Grupa 6 - Tim010
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tim010 | 0:c858fcbd0f70 | 1 | #include "mbed.h" |
| tim010 | 0:c858fcbd0f70 | 2 | AnalogIn x(dp9); |
| tim010 | 0:c858fcbd0f70 | 3 | PwmOut y(dp24); |
| tim010 | 0:c858fcbd0f70 | 4 | BusOut ledice(dp23, dp25, dp26, dp27, dp5, dp6, dp28); |
| tim010 | 0:c858fcbd0f70 | 5 | DigitalOut enable(dp14); |
| tim010 | 0:c858fcbd0f70 | 6 | |
| tim010 | 0:c858fcbd0f70 | 7 | int main() |
| tim010 | 0:c858fcbd0f70 | 8 | { |
| tim010 | 0:c858fcbd0f70 | 9 | enable=0; |
| tim010 | 0:c858fcbd0f70 | 10 | ledice=0; |
| tim010 | 0:c858fcbd0f70 | 11 | wait_ms(50); |
| tim010 | 0:c858fcbd0f70 | 12 | y.period_us(50); |
| tim010 | 0:c858fcbd0f70 | 13 | float x1(0.8/3.3); |
| tim010 | 0:c858fcbd0f70 | 14 | float z(x); |
| tim010 | 0:c858fcbd0f70 | 15 | while(1) |
| tim010 | 0:c858fcbd0f70 | 16 | { |
| tim010 | 0:c858fcbd0f70 | 17 | |
| tim010 | 0:c858fcbd0f70 | 18 | if(x<x1) z=0; |
| tim010 | 0:c858fcbd0f70 | 19 | else z=x; |
| tim010 | 0:c858fcbd0f70 | 20 | y = z; |
| tim010 | 0:c858fcbd0f70 | 21 | } |
| tim010 | 0:c858fcbd0f70 | 22 | |
| tim010 | 0:c858fcbd0f70 | 23 | } |