In a previous article we created some flags at http://www.pibits.net/code/display-simple-flag-images-on-a-sense-hat.php
Anyway we have created some more flags for you to try on a sense hat
Japan
An attempt at the flag of Japan
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w,
w,w,w,r,r,w,w,w,
w,w,r,r,r,r,w,w,
w,w,r,r,r,r,w,w,
w,w,w,r,r,w,w,w,
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w
]
sense.set_pixels(image)
[/codesyntax]
Poland
This is an attempt at the Polish flag
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r
]
sense.set_pixels(image)
[/codesyntax]
Ukraine
The flag of the Ukraine this time
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y
]
sense.set_pixels(image)
[/codesyntax]
Colombia
The flag of Colombia this time
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y,
y,y,y,y,y,y,y,y,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r
]
sense.set_pixels(image)
[/codesyntax]
Denmark
The Danish flag is not too difficult to do
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
r,r,w,w,r,r,r,r,
r,r,w,w,r,r,r,r,
r,r,w,w,r,r,r,r,
w,w,w,w,w,w,w,w,
w,w,w,w,w,w,w,w,
r,r,w,w,r,r,r,r,
r,r,w,w,r,r,r,r,
r,r,w,w,r,r,r,r
]
sense.set_pixels(image)
[/codesyntax]
Thailand
An attempt at the Thailand flag
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
r,r,r,r,r,r,r,r,
w,w,w,w,w,w,w,w,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
b,b,b,b,b,b,b,b,
w,w,w,w,w,w,w,w,
r,r,r,r,r,r,r,r
]
sense.set_pixels(image)
[/codesyntax]
Chile
This is about as good as I could do for Chile
[codesyntax lang=”python”]
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0)
o = (255, 127, 0)
y = (255, 255, 0)
g = (0, 255, 0)
b = (0, 0, 255)
i = (75, 0, 130)
v = (159, 0, 255)
e = (0, 0, 0)
w = (255, 255, 255)
image = [
b,b,b,w,w,w,w,w,
b,b,b,w,w,w,w,w,
b,b,b,w,w,w,w,w,
b,b,b,w,w,w,w,w,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r
]
sense.set_pixels(image)
[/codesyntax]