Masahiko Yamazaki
/
Lab1-01_pc_communication_number_lite
Lab1-01_pc_communication_number_lite
main.cpp@0:0c8a8e7fbf76, 2021-08-10 (annotated)
- Committer:
- heptasat2021
- Date:
- Tue Aug 10 01:51:25 2021 +0000
- Revision:
- 0:0c8a8e7fbf76
Lab1-01_pc_communication_number_lite
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heptasat2021 | 0:0c8a8e7fbf76 | 1 | #include "mbed.h" |
heptasat2021 | 0:0c8a8e7fbf76 | 2 | Serial pc(USBTX,USBRX,9600); |
heptasat2021 | 0:0c8a8e7fbf76 | 3 | int main() |
heptasat2021 | 0:0c8a8e7fbf76 | 4 | { |
heptasat2021 | 0:0c8a8e7fbf76 | 5 | int a; |
heptasat2021 | 0:0c8a8e7fbf76 | 6 | float b,c; |
heptasat2021 | 0:0c8a8e7fbf76 | 7 | a = 5; |
heptasat2021 | 0:0c8a8e7fbf76 | 8 | b = 1.5; |
heptasat2021 | 0:0c8a8e7fbf76 | 9 | c = a+b; |
heptasat2021 | 0:0c8a8e7fbf76 | 10 | while (true) { |
heptasat2021 | 0:0c8a8e7fbf76 | 11 | pc.printf("a=%d, b=%f, c=%f\r\n",a,b,c); |
heptasat2021 | 0:0c8a8e7fbf76 | 12 | wait_ms(500); |
heptasat2021 | 0:0c8a8e7fbf76 | 13 | } |
heptasat2021 | 0:0c8a8e7fbf76 | 14 | } |