mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
analogRead
This commit is contained in:
parent
84765a16b0
commit
f8ddfe8d0a
@ -27,29 +27,17 @@
|
||||
#include "wiring_private.h"
|
||||
#include "pins_arduino.h"
|
||||
|
||||
uint8_t analog_reference = DEFAULT;
|
||||
|
||||
void analogReference(uint8_t mode)
|
||||
{
|
||||
analog_reference = mode;
|
||||
}
|
||||
|
||||
int analogRead(uint8_t pin)
|
||||
{
|
||||
uint8_t low, high;
|
||||
if (pin == 0)
|
||||
return system_adc_read();
|
||||
|
||||
low = 0;
|
||||
high = 0;
|
||||
|
||||
// combine the two bytes
|
||||
return (high << 8) | low;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Right now, PWM output only works on the pins with
|
||||
// hardware support. These are defined in the appropriate
|
||||
// pins_*.c file. For the rest of the pins, we default
|
||||
// to digital output.
|
||||
void analogWrite(uint8_t pin, int val)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -132,3 +132,10 @@ void initPins()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void analogWrite(uint8_t pin, int val)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user