cagdas d
/
_uebung_demirtas_06102020
first commit
main.cpp@2:65f24e5a3ce4, 2020-10-06 (annotated)
- Committer:
- kafka
- Date:
- Tue Oct 06 17:22:26 2020 +0000
- Revision:
- 2:65f24e5a3ce4
- Parent:
- 1:0ab6ec2cda59
3rd commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kafka | 0:8217b9bfb66a | 1 | #include "mbed.h" |
kafka | 0:8217b9bfb66a | 2 | #include "MyClass.h" |
kafka | 1:0ab6ec2cda59 | 3 | #include "MyClassA.h" |
kafka | 2:65f24e5a3ce4 | 4 | #include "MyClassB.h" |
kafka | 0:8217b9bfb66a | 5 | |
kafka | 0:8217b9bfb66a | 6 | DigitalOut led(LED1); |
kafka | 2:65f24e5a3ce4 | 7 | MyClass element1 (23.2); |
kafka | 2:65f24e5a3ce4 | 8 | MyClass element2; |
kafka | 1:0ab6ec2cda59 | 9 | |
kafka | 2:65f24e5a3ce4 | 10 | MyClassA element_A_1(42, false); |
kafka | 2:65f24e5a3ce4 | 11 | MyClassA element_A_2; |
kafka | 2:65f24e5a3ce4 | 12 | |
kafka | 2:65f24e5a3ce4 | 13 | MyClassB sensor(p28, p27); |
kafka | 2:65f24e5a3ce4 | 14 | |
kafka | 2:65f24e5a3ce4 | 15 | int main() |
kafka | 2:65f24e5a3ce4 | 16 | { |
kafka | 2:65f24e5a3ce4 | 17 | while (1) |
kafka | 2:65f24e5a3ce4 | 18 | { |
kafka | 0:8217b9bfb66a | 19 | led = !led; |
kafka | 0:8217b9bfb66a | 20 | printf("Blink! LED is now %d\n", led.read()); |
kafka | 0:8217b9bfb66a | 21 | printf("element1 messwert: %lf, element2 messwert: %lf \n", element1.get_wert(), element2.get_wert()); |
kafka | 1:0ab6ec2cda59 | 22 | printf("element_A_1 x: %d, element_A_2 x: %d \n", element_A_1.getX(), element_A_2.getX()); |
kafka | 1:0ab6ec2cda59 | 23 | printf("element_A_1 wahr: %s, element_A_2 x: %s \n", element_A_1.getWahr() ? "wahr" : "false", element_A_2.getWahr() ? "wahr": "false"); |
kafka | 2:65f24e5a3ce4 | 24 | printf("sensor value %f\n", sensor.read()); |
kafka | 0:8217b9bfb66a | 25 | wait_ms(500); |
kafka | 0:8217b9bfb66a | 26 | } |
kafka | 1:0ab6ec2cda59 | 27 | } |