My first Raspberry Pi device

Source: Internet
Author: User

Okay, I'll admit it. This is the first example of learning from a book.

I started the raspberry Red version, version 2, see such a small card computer can do so many things, it is really surprising!

installation system, etc. are very smooth, start, installation program, Remote Desktop, SSH login, etc. are very smooth, is installed XBMC not, various versions are not, start up after the operation will hang off, do not know what is the reason, power supply no problem, 2 A, and then test it. In the future, I think it's OK to buy green version, no difference.

Today, I tried a few of the various accessories, first a small picture:

This is probably the simplest rasp the application of:-)

Bread Board is a simple series circuit, the resistance is 10K, to prevent burning led, pay attention to the LED foot for the positive, connected to the GPIO11, plug the reverse is not bright.

The other end is connected to the GPIO6.

OK, I typed the following code:

 #   import library    Rpi.gpio as GPIO  import  Span style= "color: #000000;" > time  #   The following is not in the textbook, it may be the reason I installed a different version of the Gpio  gpio.setmode (GPIO. BOARD)  #   set input output  Gpio.setup (11< Span style= "color: #000000;" >,gpio. Out)  #   make an LED flashing neon light for 2 seconds, 2 seconds to kill  Span style= "color: #0000ff;" >while   True:GPIO.output ( 11,true) time.     Sleep ( 2) Gpio.output ( 11,false) Time.sleep ( 2) 

OK, run the code, a low-end cheap low-grade small neon lights flashing up  :-)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.