Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Gamepad2/Gamepad.cpp
- Revision:
- 2:07cef563acdf
- Parent:
- 1:766a293c9b07
- Child:
- 3:b7df72682b81
--- a/Gamepad2/Gamepad.cpp Thu Feb 06 12:59:16 2020 +0000
+++ b/Gamepad2/Gamepad.cpp Mon Mar 30 15:03:36 2020 +0000
@@ -414,6 +414,17 @@
dac->write(val);
}
+//writes DAC value in int format
+void Gamepad::write_u16(int val)
+{
+ if (val < 0) {
+ val = 0;
+ } else if (val > 65535) {
+ val = 65535;
+ }
+ dac->write_u16(val);
+}
+
void Gamepad::play_next_note()
{