|
18 | 18 | raise |
19 | 19 |
|
20 | 20 | #--| USER CONFIG |-------------------------- |
21 | | -STATION_ID = "0245" # tide location, find yours from admiralty website |
| 21 | +STATION_ID = "0245" # tide location, find yours from admiralty website |
22 | 22 | PLOT_SIZE = 2 # tide plot thickness |
23 | 23 | PLOT_COLOR = 0x00FF55 # tide plot color |
24 | 24 | MARK_SIZE = 6 # current time marker size |
|
37 | 37 |
|
38 | 38 | # determine the current working directory needed so we know where to find files |
39 | 39 | cwd = ("/"+__file__).rsplit('/', 1)[0] |
| 40 | + |
| 41 | +if board.board_id == "pyportal_titano": |
| 42 | + bg_image_path = "/images/tides_bg_graph_480-320.bmp" |
| 43 | +else: |
| 44 | + bg_image_path = "/images/tides_bg_graph.bmp" |
| 45 | + |
40 | 46 | pyportal = PyPortal(url=DATA_SOURCE, |
41 | 47 | headers={"Ocp-Apim-Subscription-Key":secrets['Ocp-Apim-Subscription-Key']}, |
42 | 48 | json_path=DATA_LOCATION, |
43 | 49 | status_neopixel=board.NEOPIXEL, |
44 | | - default_bg=cwd+"/images/tides_bg_graph.bmp") |
| 50 | + default_bg=cwd+bg_image_path) |
45 | 51 |
|
46 | 52 | # Connect to the internet and get local time |
47 | 53 | pyportal.get_local_time() |
|
65 | 71 | date_label = Label(date_font, text="0000-00-00", color=DATE_COLOR, x=7, y=14) |
66 | 72 | pyportal.splash.append(date_label) |
67 | 73 |
|
| 74 | +if board.board_id == "pyportal_titano": |
| 75 | + x_pos = 394 |
| 76 | +else: |
| 77 | + x_pos = 234 |
| 78 | + |
68 | 79 | # Setup time label |
69 | | -time_label = Label(date_font, text="00:00:00", color=TIME_COLOR, x=234, y=14) |
| 80 | +time_label = Label(date_font, text="00:00:00", color=TIME_COLOR, x=x_pos, y=14) |
70 | 81 | pyportal.splash.append(time_label) |
71 | 82 |
|
72 | 83 | # Setup current time marker |
|
0 commit comments