forked from duino-coin/duino-coin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuploadavrminer.py
More file actions
49 lines (44 loc) · 1.72 KB
/
uploadavrminer.py
File metadata and controls
49 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import sys
board = input("Enter your board name (Uno, Nano, Mega): ")
port = input("Enter the port where the board is: ")
def windows():
if board == "Nano" or "Uno":
os.system(f".\\avrdude\\avrdude.exe -c arduino -P {port} -p atmega328p -b 115200 -U flash:w:avrminer.hex")
print("Done!")
exit()
elif board == "Mega":
mega_model = input("Enter your mega model (1280, 2560): ")
if mega_model == "1280" or "2560":
os.system("cd Arduino_Code")
os.system(f"\\avrdude\\avrdude.exe -c arduino -P {port} -p atmega{mega_model} -b 115200 -U flash:w:avrminer.hex")
print("Done!")
exit()
else:
print("Your mega model isn't correct, please try again.")
exit()
else:
print("Your board isn't correct, please re-run the script and enter the correct options")
exit()
def linux():
if board == "Nano" or "Uno":
os.system(f"avrdude -c arduino -P {port} -p atmega328p -b 115200 -U flash:w:avrminer.hex")
print("Done!")
exit()
elif board == "Mega":
mega_model = input("Enter your mega model (1280, 2560): ")
if mega_model == "1280" or "2560":
os.system("cd Arduino_Code")
os.system(f"avrdude -c arduino -P {port} -p atmega{mega_model} -b 115200 -U flash:w:avrminer.hex")
print("Done!")
exit()
else:
print("Your mega model isn't correct, please try again.")
exit()
else:
print("Your board isn't correct, please re-run the script and enter the correct options")
exit()
if sys.platform == "win32":
windows()
else:
linux()