![](/media/cache/profiles/8631e5b91354a846f00dbbf16ad94259.jpg.50x50_q85.jpg)
Lab 3 example 2, no debugging
Fork of DACandticker_sample_with_debug by
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.
Diff: main.cpp
- Revision:
- 3:2bf79a3c3cbc
- Parent:
- 2:e27fd3b65155
- Child:
- 4:75ad475aff41
diff -r e27fd3b65155 -r 2bf79a3c3cbc main.cpp --- a/main.cpp Wed Jan 24 22:56:54 2018 +0000 +++ b/main.cpp Wed Jan 23 17:56:42 2019 +0000 @@ -27,10 +27,10 @@ int update_us = 1000 ; // 1ms while (true) { tick.attach_us(callback(&writeAout), update_us); // setup ticker to write to AnalogOut - Thread::wait(30000) ; // wait 30 sec - 30000ms + wait(30.0) ; // wait 30 sec update_us = 2000 ; // 2ms tick.attach_us(callback(&writeAout), update_us); // setup ticker to write to AnalogOut - Thread::wait(30000) ; // wait 30 sec - 30000ms + wait(30.0) ; // wait 30 sec update_us = 1000 ; // 1ms } }