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.
Dependencies: nRF51822
Diff: hw.cpp
- Revision:
- 4:1bfa16834dd4
- Parent:
- 2:def2c045c43a
- Child:
- 7:090f9eea7b3c
diff -r 15c2ffcb1982 -r 1bfa16834dd4 hw.cpp
--- a/hw.cpp	Tue Dec 20 15:13:35 2016 +0000
+++ b/hw.cpp	Tue Jan 24 16:29:51 2017 +0000
@@ -70,7 +70,7 @@
 /// This provides a result = Voltage/3.6*1023
 /// @param chan is the channel to read
 /// @param times is the number of readings to take
-/// @return sum of all the readings
+/// @return avg of all the readings
 uint16_t adc_read(int chan, int num_readings)
 {
     uint16_t result = 0;
@@ -88,7 +88,7 @@
                               (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);
             break;
 
-        case ADC_CHAN_OPTO:
+        case ADC_CHAN_SOUND:
             NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) |
                               (ADC_CONFIG_INPSEL_AnalogInputOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) |
                               (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) |