I had enable @micropython.native on the ESP8266 to get the best performance in refreshing the displays.
It turned out MicroPython for the ESP32 does not support that option!
Either it is always on, or the ESP32 without that option is FASTER than the ESP8266 with that option.
@micropython.native
def shift_out(self, bits):
for i in range(8):
value = bits & (1 << i) # Is bit set or cleared?
self.data.value(1 if value > 0 else 0)
self.clock.on() # pulsing clock HIGH then LOW to shift data
self.clock.off()
This is faster!
def shift_out(self, bits):
for i in range(8):
value = bits & (1 << i) # Is bit set or cleared?
if value > 0:
self.data.on()
else:
self.data.off()
self.clock.on() # pulsing clock HIGH then LOW to shift data
self.clock.off()
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.