@@ -112,8 +112,16 @@ This will result in another subset of the Y pins to select from.
112112- ** HC4067(uint8_t s0, uint8_t s1, uint8_t s2, uint8_t s3, uint8_t enablePin = 255)** constructor.
113113Set the 4 select pins and optional the enable pin.
114114If the enablePin == 255 it is considered not used.
115- - ** void setChannel(uint8_t channel)** set the current channel.
116- Valid values 0..15, this value is not checked, only the lower 4 bits will be used.
115+ - ** bool setChannel(uint8_t channel, bool disable = true)** set the current channel.
116+ Valid values 0..15, this value is checked (since 0.2.1).
117+ Returns false if channel out of range.
118+ If the channel is already selected it does not change it.
119+ Note the four channels will not change at the very same moment,
120+ possibly resulting in an invalid selection for a (very short) time.
121+ The disable flag can be set to false so the device is not disabled during channel switching.
122+ Default the device is disabled during channel switching to prevent (very short) ghost channels.
123+ Note that a call to ** setChannel()** will always enable the device again.
124+ Note the device cannot be disabled if there is no enable pin configured.
117125- ** uint8_t getChannel()** returns the current channel 0..15.
118126The selected channel is also returned when the multiplexer is disabled.
119127
@@ -122,9 +130,9 @@ The selected channel is also returned when the multiplexer is disabled.
122130
123131These functions work only if enablePin is set in the constructor.
124132
125- - ** void enable()** enables the HC4067 to multiplex.
126- - ** void disable()** disables the HC4067 , no channel is selected.
127- - ** bool isEnabled()** returns the current status of the HC4067 .
133+ - ** void enable()** enables the device to multiplex.
134+ - ** void disable()** disables the device , no channel is selected.
135+ - ** bool isEnabled()** returns the current status of the device .
128136Also returns true if the enablePin is not set in the constructor.
129137
130138
@@ -146,10 +154,10 @@ Also returns true if the enablePin is not set in the constructor.
146154
147155#### Won't (unless requested)
148156
149- - check channel in setChannel() ?
150- - return true if in range, false otherwise.
151157- move code to .cpp file
152-
158+ - uint8_t channelCount() { return 16; };
159+ - cache enable status
160+ - inline the enable/disable
153161
154162## Support
155163
0 commit comments