Skip to content

Commit

Permalink
update python
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronTenkel committed Mar 10, 2024
1 parent ca2ef6a commit 8e917c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arduino_handshake.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def send_function(serial_port, receive_wallet, send_wallet, eth_amount) -> bool:
# Open the serial port
ser = serial.Serial(serial_port, baud_rate, timeout=1)
ser = serial.Serial(serial_port, baud_rate, timeout=0)

message = 't' + receive_wallet + send_wallet
ser.write(message.encode())
Expand All @@ -20,7 +20,7 @@ def send_function(serial_port, receive_wallet, send_wallet, eth_amount) -> bool:

def receive_function(serial_port, send_wallet, receive_wallet, eth_amount) -> bool:
# Open the serial port
ser = serial.Serial(serial_port, baud_rate, timeout=1)
ser = serial.Serial(serial_port, baud_rate, timeout=0)

message = 'r' + send_wallet + receive_wallet
ser.write(message.encode())
Expand All @@ -41,10 +41,10 @@ def receive_function(serial_port, send_wallet, receive_wallet, eth_amount) -> bo
send_wallet_address = "11Ec4aF7f5e10068Cc07EDDC6884223a0b93b732" # no 0x in front because it is an arbitrary hex tag

if action == 'send':
return_bool = send_function("COM10", recipient, send_wallet_address, amount)
return_bool = send_function("COM10", recipient[2:], send_wallet_address, amount)
print(return_bool)
elif action == 'receive':
return_bool = receive_function("COM10", send_wallet_address, recipient, amount)
return_bool = receive_function("COM10", send_wallet_address, recipient[2:], amount)
print(return_bool)
else:
print("Invalid action. Please specify 'send' or 'receive'.")

0 comments on commit 8e917c4

Please sign in to comment.