mirror of
https://github.com/esp8266/Arduino.git
synced 2025-11-28 17:36:39 +03:00
BREAKING - analogWriteRange 8-bit default (#7456)
Matching standard Arduino cores, make the default analogWrite() take values from 0...255. Users can always use the analogWriteRange() call to change to a different setup. Add a `analogWriteResolution` which takes a number of bits and sets the range from 0...(1<<bits)-1, part of the standard Arduino API. Remove the PWMRANGE define. It's non-standard and not generally valid (i.e. it's fixed at 1024 of 256, but the real range varies depending on what you last set). Also add note about the change and how to fix pre 3.0 applications. Fixes #2895
This commit is contained in:
committed by
GitHub
parent
33083861c8
commit
a679869155
@@ -43,8 +43,6 @@ extern "C" {
|
||||
#define HIGH 0x1
|
||||
#define LOW 0x0
|
||||
|
||||
#define PWMRANGE 1023
|
||||
|
||||
//GPIO FUNCTIONS
|
||||
#define INPUT 0x00
|
||||
#define INPUT_PULLUP 0x02
|
||||
@@ -176,6 +174,7 @@ int analogRead(uint8_t pin);
|
||||
void analogReference(uint8_t mode);
|
||||
void analogWrite(uint8_t pin, int val);
|
||||
void analogWriteFreq(uint32_t freq);
|
||||
void analogWriteResolution(int res);
|
||||
void analogWriteRange(uint32_t range);
|
||||
|
||||
unsigned long millis(void);
|
||||
|
||||
Reference in New Issue
Block a user