Skip to content

Update core_esp8266_wiring_analog.c #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


18/06/2015 analogRead bugfix by Testato
*/

#include "wiring_private.h"
#include "pins_arduino.h"

extern uint16_t readvdd33(void);

void analogReference(uint8_t mode) {}

extern int __analogRead(uint8_t pin) {
if(pin == 17){
return readvdd33() >> 2; // readvdd33 is 12 bit
return system_adc_read();
}
return digitalRead(pin) * 1023;
}
Expand Down