Seongbin Lim
/
sb_first_project
This is a very simple guide, reviewing the steps required to get Blinky working on an Mbed OS platform.
main.cpp@123:c9734480ca03, 2020-04-21 (annotated)
- Committer:
- sb8718
- Date:
- Tue Apr 21 00:34:57 2020 +0000
- Revision:
- 123:c9734480ca03
- Parent:
- 122:2c65a61b756d
- Child:
- 124:acd4e55881bd
Lab4_1 Measure Light
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sb8718 | 109:5274dd9bebe1 | 1 | #include "mbed.h" |
sb8718 | 119:d879334e3d87 | 2 | #include <string.h> |
sb8718 | 117:cc2a98cdd8fa | 3 | |
sb8718 | 123:c9734480ca03 | 4 | AnalogIn aIn0(A0); |
sb8718 | 121:450f119863a7 | 5 | RawSerial pc(PA_2, PA_3,115200); |
sb8718 | 120:a1dd83d9c036 | 6 | |
sb8718 | 118:88f30fadf08f | 7 | int main() { |
sb8718 | 119:d879334e3d87 | 8 | |
sb8718 | 123:c9734480ca03 | 9 | float meas; |
sb8718 | 117:cc2a98cdd8fa | 10 | |
sb8718 | 123:c9734480ca03 | 11 | pc.printf("Welcome to AnalogIn Lab!\r\n"); |
sb8718 | 119:d879334e3d87 | 12 | |
sb8718 | 119:d879334e3d87 | 13 | while(true) { |
sb8718 | 123:c9734480ca03 | 14 | meas = aIn0.read(); |
sb8718 | 123:c9734480ca03 | 15 | meas = meas * 3300; |
sb8718 | 123:c9734480ca03 | 16 | pc.printf("A0 input voltage = %fmV\r\n", meas); |
sb8718 | 123:c9734480ca03 | 17 | ThisThread::sleep_for(1000); |
sb8718 | 118:88f30fadf08f | 18 | } |
sb8718 | 109:5274dd9bebe1 | 19 | } |