Gronk Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to display an image, eg happy face

A

display.show(Image.HAPPY)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to scroll text

A

display.scroll(‘Fiiiiiiich!’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to display 2 images after one another

A

display.show(Image.GIRAFFE)
sleep(2000)
display.show(Image.DUCK)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to send a radio message

A

import radio
radio.on()
radio.send(‘Fish5Life’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to loop an image?

A

Add while True:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to receive a scroll message?

A

radio.on()
while True:
message = radio.receive()
if message:
display.scroll(message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to set a channel for the radio and how to log in?

A

radio.on()
radio.config(channel=7)
radio.send(“Hi!”)

To log in, just radio.send(username:password)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to snoop passwords?

A

radio.config(channel=42)
radio.on()

while True:
msg=radio.receive()
if msg:
display.scroll(msg)
display.show(Image.GHOST)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the code for buttons?

A

if button_a.was_pressed():
if button_b.was_pressed():

Always add while True:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to add addresses?

A

Just add A: to a message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to log in on multiple devices?

A

PASSWORD_A = ‘n8KZmCAQ’
PASSWORD_B = ‘d9W2hrDJ’

radio.on()
while True:
if button_a.was_pressed():
msg = (‘A:’) + PASSWORD_A
radio.send(msg)
if button_b.was_pressed():
msg = (‘B:’) + PASSWORD_B
radio.send(msg)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to listen to any message without the destination?

A

while True:
msg = radio.receive()
if msg:
destination, msg = msg.split(“:”)
display.scroll(msg)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly