We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i've seen it is commented in the code, is there a fork/branch with this command implemented?
I'd like to use a bunch of these common 74HC595 Shift Registers in my code.
The text was updated successfully, but these errors were encountered:
UPDATE: i've managed to port this piece of code from Johnny Five ,seems to work correctly, so no need to add a command:
def pyfirmata_shift_out(board, data_pin, clock_pin, value, is_big_endian=False): # derived from https://github.com/rwaldron/johnny-five/blob/main/lib/board.js#L560 for i in range(8): board.digital[clock_pin].write(0) if is_big_endian: b = int(bool(value & (1 << (7 - i)))) else: b = int(bool(value & (1 << i))) board.digital[data_pin].write(b) board.digital[clock_pin].write(1) def update_bar_display(value): # open latch to fill register with data board.digital[LEDBAR_SHIFTREG_LATCH_PIN].write(0) def convert_to_bits_on(num): result = 0 for i in range(num): result |= 1 << i return result #print("real value", value) value = int(value/9) if value>7: value=7 #print("real value", value) value = convert_to_bits_on(value) pyfirmata_shift_out(board, LEDBAR_SHIFTREG_DATA_PIN, LEDBAR_SHIFTREG_CLOCK_PIN, value, True) # close latch to commit bits into register. board.digital[LEDBAR_SHIFTREG_LATCH_PIN].write(1)
original example: https://johnny-five.io/examples/shift-register/
Sorry, something went wrong.
No branches or pull requests
i've seen it is commented in the code, is there a fork/branch with this command implemented?
I'd like to use a bunch of these common 74HC595 Shift Registers in my code.
The text was updated successfully, but these errors were encountered: