
Lab3 example program 2 with debug code
DAC Ticker
- Sample code for part 2 of lab 3 using the DAC, called from a Ticker.
- Note that to use AnalogOut from the Ticker (an ISR), we create a version without locking.
- This version has extra code for debugging
Revision 4:42b85520dca6, committed 2020-02-06
- Comitter:
- WilliamMarshQMUL
- Date:
- Thu Feb 06 22:42:30 2020 +0000
- Parent:
- 3:f04c8a88a27d
- Commit message:
- Change to sleep_for
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
diff -r f04c8a88a27d -r 42b85520dca6 main.cpp --- a/main.cpp Mon Feb 04 16:11:54 2019 +0000 +++ b/main.cpp Thu Feb 06 22:42:30 2020 +0000 @@ -71,11 +71,11 @@ while (true) { pc.printf("Update at 64 x 100ms giving about 0.15Hz\n"); tick.attach_us(callback(&writeAout), update_us); // setup ticker to write to AnalogOut - wait(30.0) ; // wait 30 sec - 30000ms + ThisThread::sleep_for(30000) ; // wait 30 sec update_us = 150000 ; // 150ms pc.printf("Update at 64 x 150ms giving about 0.1Hz\n"); tick.attach_us(callback(&writeAout), update_us); // setup ticker to write to AnalogOut - wait(30.0) ; // wait 30 sec - 30000ms + ThisThread::sleep_for(30000) ; // wait 30 sec update_us = 100000 ; // 100ms } }
diff -r f04c8a88a27d -r 42b85520dca6 mbed-os.lib --- a/mbed-os.lib Mon Feb 04 16:11:54 2019 +0000 +++ b/mbed-os.lib Thu Feb 06 22:42:30 2020 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#a8f0c33eaa2c52babff9655417c36f4b5edd54d7 +https://github.com/ARMmbed/mbed-os/#430e64fce8098fd5e54f6de32f3f029f35dc705f