Skip to content

Commit

Permalink
Merge pull request #60 from drepetto/screen_size
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman authored May 4, 2023
2 parents 6bb275a + 5b1cbc5 commit b938669
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions extmod/tulip/py/tulip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


# Bring in all c-defined tulip functions
from _tulip import *
from _tulip import *
from world import world

class Colors:
Expand Down Expand Up @@ -117,11 +117,11 @@ def screenshot(filename=None):


def ansi_fg(pal_idx):
# ESC[38;5;{ID}m
# ESC[38;5;{ID}m
return("\033[38;5;%dm" % (pal_idx))

def ansi_bg(pal_idx):
# ESC[48;5;{ID}m
# ESC[48;5;{ID}m
return("\033[48;5;%dm" % (pal_idx))

def color(r,g,b):
Expand All @@ -142,7 +142,7 @@ def ip():
try:
import network
except ImportError:
return "127.0.0.1" # we are on local and it's ok
return "127.0.0.1" # we are on local and it's ok
sta_if = network.WLAN(network.STA_IF)
if(sta_if.isconnected()):
return sta_if.ifconfig()[0]
Expand All @@ -158,7 +158,7 @@ def set_time():


def wifi(ssid, passwd, wait_timeout=10):
import network, time
import network, time
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
sta_if.connect(ssid, passwd)
Expand All @@ -168,5 +168,6 @@ def wifi(ssid, passwd, wait_timeout=10):
time.sleep(1)
return ip()



def screen_size():
s_s = timing()
return (s_s[0], s_s[1])

0 comments on commit b938669

Please sign in to comment.