Adam Ciechalski
/
Inst_LAB_1
PicoScope experiment
main.cpp@0:774b1d4dd4d2, 2019-04-13 (annotated)
- Committer:
- AdamCiechalski
- Date:
- Sat Apr 13 13:26:52 2019 +0000
- Revision:
- 0:774b1d4dd4d2
Inst Lab1;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AdamCiechalski | 0:774b1d4dd4d2 | 1 | #include "mbed.h" |
AdamCiechalski | 0:774b1d4dd4d2 | 2 | |
AdamCiechalski | 0:774b1d4dd4d2 | 3 | AnalogOut Aout (p18); |
AdamCiechalski | 0:774b1d4dd4d2 | 4 | |
AdamCiechalski | 0:774b1d4dd4d2 | 5 | float i; |
AdamCiechalski | 0:774b1d4dd4d2 | 6 | |
AdamCiechalski | 0:774b1d4dd4d2 | 7 | int main(){ |
AdamCiechalski | 0:774b1d4dd4d2 | 8 | while(1) { |
AdamCiechalski | 0:774b1d4dd4d2 | 9 | for (i=0; i<=1; i=i+0.001) { |
AdamCiechalski | 0:774b1d4dd4d2 | 10 | Aout = i; |
AdamCiechalski | 0:774b1d4dd4d2 | 11 | wait (0.0001); |
AdamCiechalski | 0:774b1d4dd4d2 | 12 | } |
AdamCiechalski | 0:774b1d4dd4d2 | 13 | for (i=1; i=>0; i=i-0.001){ |
AdamCiechalski | 0:774b1d4dd4d2 | 14 | Aout = i; |
AdamCiechalski | 0:774b1d4dd4d2 | 15 | wait (0.0001); |
AdamCiechalski | 0:774b1d4dd4d2 | 16 | } |
AdamCiechalski | 0:774b1d4dd4d2 | 17 | } |
AdamCiechalski | 0:774b1d4dd4d2 | 18 | } |