2 261 octets ajoutés
, 24 août 2015 à 21:03
{{RASP-SENSE-HAT-ASTRO-PI-NAV}}
{{bloc-etroit|text=Astro Pi is an add-on board for the Raspberry Pi, which adds the ability to sense all kinds of things and output information using a built-in 8x8 LED matrix. You can find out more about Astro Pi by following the [[RASP-SENSE-HAT-ASTRO-PI|Astro Pi Guide]], which will show you how to connect and test your Astro Pi board. It also has some helpful explanations and examples of what the different inputs and outputs can do.
Once you are set up and have run your first program using the guide, you can begin to experiment further using this worksheet. In order to write your programs you will need to boot your Raspberry Pi to the desktop and start IDLE3, like you did in the guide.}}
<nowiki>sudo idle3 &</nowiki>
== Afficher du Texte ==
{{bloc-etroit|text=When following [[RASP-SENSE-HAT-ASTRO-PI-Premier|the guide]] you will have written a sample program which scrolls text across the LED matrix. The program contains two crucial lines, which import the Astro Pi software and create an {{fname|ap}} object which represents the Astro Pi board.}}
<nowiki>from astro_pi import AstroPi
ap = AstroPi()</nowiki>
The third line is the one that makes the Astro Pi do something:
<nowiki>ap.show_message("Hello my name is Tim Peake")</nowiki>
You have probably already discovered that you can easily change the message to your own text, but there are more things that we can do.
'''1.''' We can expand the {{fname|ap.show_message}} command to include some extra '''parameters''' which will change the behaviour of the message.
{| class="wikitable"
| align="center" style="background:#f0f0f0;"|'''Parameter'''
| align="center" style="background:#f0f0f0;"|'''Effect'''
|-
| scroll_speed ||The scroll_speed parameter affects how quickly the text moves on the screen. The default value is 0.1. The bigger the number, the slower the speed
|-
| text_colour ||The text_colour parameter alters the colour of the text and is specified using 3 values for Red, Green, Blue. Each value can be between 0 - 255, so [255,0,255] would be Red + Blue = Purple
|-
| back_colour ||The back_colour parameter alters the colour of the background and works in the same way as the text_colour
|}
{{RASP-SENSE-HAT-ASTRO-PI-TRAILER}}