1 / 19

Python for intel Galileo GEN2

Learn how to download, setup, and run the "Bigger" Linux Image on your Intel Galileo GEN2 board. Follow the step-by-step instructions to install the necessary software and execute Python programs.

vskaggs
Download Presentation

Python for intel Galileo GEN2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python for intel Galileo GEN2 TYWu

  2. Software Download/Setup • "Bigger" Linux Image • Download the Arduino IDE for Galileo • https://communities.intel.com/docs/DOC-22226

  3. Software Download/Setup • Unzip SDCard.1.0.4.tar • image-full-galileo folder is generated

  4. Software Download/Setup • Copy all files/folder under image-full-galileo into your micro SD card • Your SD directory structure should look like:

  5. Running "Bigger" Linux Image (Option 1) • Unplug the USB connector of Galileo • Remove the Galileo power • Plug in the µSD card. • Then power it back up. • Plug in the USB connector • The first boot may take a little longer than average.

  6. Running "Bigger" Linux Image(Option 2) • Unplug the USB connector of Galileo • Remove the Galileo power • Plug in the µSD card. • Then power it back up. • Plug in the RS232-USB connector • The first boot may take a little longer than average. • You can use the terminal to verify that the bigger image is working. Try running Python, for example.

  7. Running "Bigger" Linux Image • RS232 to USB • Connect (RS232  Galileo) • Black Wire  GND • White Wire  TXO • Green Wire  RXI

  8. Running "Bigger" Linux Image • Install Driver • Download the File http://www.prolific.com.tw/UserFiles/files/PL2303_Prolific_DriverInstaller_v1_10_0_20140925.zip • Unzip • Install

  9. Running "Bigger" Linux Image • Install Tera Term • http://en.sourceforge.jp/projects/ttssh2/releases/ • Download teraterm-4.80.exe • Execute teraterm-4.80.exe for installation

  10. Running "Bigger" Linux Image • Open Tera Term • Select Serial • Select COMxx: Prolific … • SetupSerial Port • Change Baud rate to 115200 • SetupFont

  11. Running "Bigger" Linux Image • In the Tera Term • Entry “Enter” • Enter “root” as login name

  12. Python • The first program helloworld.py #!/usr/bin/python # Hello world python program print "Hello World!"; • Editor: vi • How to execute it? • chmod 755 helloworld.py • ./ helloworld.py

  13. Python • The second program blink.py

  14. Python • Install  wiring-x86  • In PC • Download wiring-x86-master • https://github.com/emutex/wiring-x86 • Unzip • Rename the folder name to wiring-x86 • Copy the wiring-x8 folderinto the home directory of your micro SD card

  15. Python • Install  wiring-x86  • In Galileo • Install wiring-x86 in Galileo • Change Directory • /media/mmcblk0p1/wiring-x86 • Entry • python setup.py install

  16. Python • program blink.py • Sorce • http://www.emutexlabs.com/project/209-introduction-to-wiring-x86-for-intel-edison-and-galileo-gen2

  17. Python • program blink.py #!/usr/bin/env python import time from wiringx86 import GPIOGalileoGen2 as GPIO gpio = GPIO(debug=False) pin = 13 state = gpio.HIGH # Set pin 13 to be used as an output GPIO pin. print 'Setting up pin %d' % pin gpio.pinMode(pin, gpio.OUTPUT) print 'Blinking pin %d now...' % pin

  18. Python try: while(True): # Write a state to the pin. ON or OFF. gpio.digitalWrite(pin, state) # Toggle the state. state = gpio.LOW if state == gpio.HIGH else gpio.HIGH # Sleep for a while. time.sleep(0.5) # When you get tired of seeing the LED blinking kill the loop with Ctrl-C. except KeyboardInterrupt: # Leave the LED turned off. print '\nCleaning up...' gpio.digitalWrite(pin, gpio.LOW) # Do a general cleanup. Calling this function is not mandatory. gpio.cleanup()

  19. References • https://learn.sparkfun.com/tutorials/galileo-getting-started-guide?_ga=1.175151777.2095379488.1416564981 • http://www.hksilicon.com/kb/articles/335724/x86Arduino-Intel-Galileo • http://wiring-x86.readthedocs.org/getting_started.html • http://www.emutexlabs.com/project/209-introduction-to-wiring-x86-for-intel-edison-and-galileo-gen2

More Related