1: self.return_false, # Dx_INPUT_FALSE
2: self.return_true, # Dx_INPUT_TRUE_PULL_UP
3: self.return_true, # Dx_INPUT_TRUE_PULL_DOWN
- 4: self.return_true, # Dx_OUTPUT_TRUE
- 5: self.return_false, # Dx_OUTPUT_FALSE
+ 4: self.return_true, # Dx_OUTPUT
6: self.return_true, # NEOPIXEL
7: self.return_random_int, # Ax_INPUT_RAND_INT
8: self.return_fixed_int_pi, # Ax_INPUT_FIXED_INT_PI
self.current_value = new_value
def read(self):
- print("\nread mode: ", self._mode)
"""Returns the pin's expected value."""
self.previous_value = self.current_value
# perform a lookup on the pin_behavior dict to get the value
# is pin a pull up and pin is LOW?
if self._pull == Pin.PULL_UP and self.current_value == False:
- self.current_value = True
+ self.current_value = False
# is pin a pull down and pin is HIGH?
if self._pull == Pin.PULL_DOWN and self.current_value == True:
- print("switching PDR to False")
self.current_value = False
return self.current_value
D2 = Pin(2)
D3 = Pin(3)
D4 = Pin(4)
-D5 = Pin(5)
# Special "digital" pins
D6 = Pin(6)
# Analog pins