Différences entre versions de « RASP-SENSE-HAT-ASTRO-PI-Premier »
(Page créée avec « {{RASP-SENSE-HAT-ASTRO-PI-NAV}} {{RASP-SENSE-HAT-ASTRO-PI-TRAILER}} ») |
|||
Ligne 1 : | Ligne 1 : | ||
{{RASP-SENSE-HAT-ASTRO-PI-NAV}} | {{RASP-SENSE-HAT-ASTRO-PI-NAV}} | ||
+ | |||
+ | == Premier programme == | ||
+ | Connect the Raspberry Pi peripherals (keyboard, mouse, monitor, and power), and log in using the following login information: | ||
+ | |||
+ | <nowiki>login: pi | ||
+ | password: raspberry</nowiki> | ||
+ | |||
+ | You will not see any text when typing the password; this is a security feature. | ||
+ | |||
+ | Load the graphical user interface by typing {{fname|startx}}. Now, open Python 3 using {{fname|Menu > Programming > Python 3}}. This will cause a Python Shell window to appear. Select {{fname|File > New Window}}, and type in the following code: | ||
+ | |||
+ | <nowiki>from astro_pi import AstroPi | ||
+ | ap = AstroPi() | ||
+ | ap.show_message("Hello my name is Tim Peake")</nowiki> | ||
+ | |||
+ | Select {{fname|File > Save}} and choose a file name for your program, then select {{fname|Run > Run module}}. Your message should then scroll across the LED matrix in white text. | ||
+ | |||
+ | Why not try changing the message between the double quotation marks and running your code again? | ||
{{RASP-SENSE-HAT-ASTRO-PI-TRAILER}} | {{RASP-SENSE-HAT-ASTRO-PI-TRAILER}} |
Version du 24 août 2015 à 20:40
Premier programme
Connect the Raspberry Pi peripherals (keyboard, mouse, monitor, and power), and log in using the following login information:
login: pi password: raspberry
You will not see any text when typing the password; this is a security feature.
Load the graphical user interface by typing startx. Now, open Python 3 using Menu > Programming > Python 3. This will cause a Python Shell window to appear. Select File > New Window, and type in the following code:
from astro_pi import AstroPi ap = AstroPi() ap.show_message("Hello my name is Tim Peake")
Select File > Save and choose a file name for your program, then select Run > Run module. Your message should then scroll across the LED matrix in white text.
Why not try changing the message between the double quotation marks and running your code again?
Source: Getting Started with Astro PI et Astro-Pi Guide proposé par Raspberry Pi Learning Resource (www.raspberrypi.org)
Licence Creative Commons - CC-BY-SA
The learning resource is provided for free by the Raspberry Pi Foundation under a Creative Commons licence.
Find more at raspberrypi.org/resources and github.com/raspberrypilearning.
Crédit de traduction: Toute référence, mention ou extrait de cette traduction doit également être explicitement accompagné du crédit de traduction suivant : « Traduction par MCHobby (shop.MCHobby.be) » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.