Pi2Go

Pi2Go är en Raspberry Pi kontrollerad bil avsedd för att programmeras och styras med program utvecklade med programspråken Scratch eller Python. Bilen levereras färdigmonterad med SD-programkort men utan Raspberry Pi datorkort.

Allt du behöver göra är att montera in ett Raspberry Pi B+  (art nr 20-154)
och börja programmera!

Raspberry Pi B+ (art nr 20-154) samt sex AA batterier köpes separat.
Använd gärna uppladdningsbara batterier.

Bilen har en genomskinlig kaross som skyddar komponenterna och också gör att du kan se på lysdioder vad som händer när den följer instruktioner som du har programmerat in.

Det finns ett stort antal ingångar och utgångar som kan användas vid programmering, vilket gör Pi2Go
till en lämplig produkt för projektbaserat arbete. Låt eleverna utveckla, planera och skriva in sitt program och när de är klara och övertygade om att det kommer att fungera, prova det på Pi2Go!
Pi2Go kan styras och programmeras trådlöst via WiFi eller genom att program laddas ner via USB-anslutning.

Lämplig för årskurs 4 och uppåt.

Instruktioner för att komma igång finns i nedladdningsbara filer (text på engelska):

How to Program Pi2Go in Python

Download document Programming Pi2Go_in_Python.pdf
 

How to Assemble a Pi2Go with a Raspberry Pi B

Download document Assembling_Pi2Go__Raspberry_Pi_Model_B.pdf
 

How to Assemble a Pi2Go with a Raspberry Pi B+

Download document Assembling_a_Pi2Go_Raspberry_Pi_Model_B+.pdf
 

Establishing a wireless connection with Pi2Go

Download document Establishing_a_wireless_connection_with_Pi2Go.pdf
 

How to Run Example Scratch Files

Download document How_to_Run_Example_Scratch_Files.pdf
 

 

Python Software: Library & Examples

If you are setting up a new SD card, please follow the instructions in this PDF

We have created a python library module that allows you to use the same software to drive either the Pi2Go or the Pi2Go-Lite. Some functions can be directly mapped between the two products, but other functions will only work one one model or the other.

  • Download the latest version of the software using wget like this from a command line (eg. LXTerminal):
    wget http://4tronix.co.uk/pi2go.sh -O pi2go.sh
    bash pi2go.sh
  • This will create a new folder on your Pi in the /home/pi folder called pi2go
  • Run the example files using the following (example is for motorTest):
    sudo python motorTest.py
  • You need to use sudo as admin rights need to allow access to the GPIO pins

 

Library Functions, example:

#======================================================================
# General Functions
#
# init(). Initialises GPIO pins, switches motors and LEDs Off, etc
# cleanup(). Sets all motors and LEDs off and sets GPIO to standard values
# version(). Returns 1 for Full Pi2Go, and 2 for Pi2Go-Lite. Invalid until after init() has been called
#======================================================================

#======================================================================
# Motor Functions
#
# stop(): Stops both motors
# forward(speed): Sets both motors to move forward at speed. 0 # reverse(speed): Sets both motors to reverse at speed. 0 # spinLeft(speed): Sets motors to turn opposite directions at speed. 0 # spinRight(speed): Sets motors to turn opposite directions at speed. 0 # turnForward(leftSpeed, rightSpeed): Moves forwards in an arc by setting different speeds. 0 # turnreverse(leftSpeed, rightSpeed): Moves backwards in an arc by setting different speeds. 0 # go(leftSpeed, rightSpeed): controls motors in both directions independently using different positive/negative speeds. -100 # go(speed): controls motors in both directions together with positive/negative speed parameter. -100 #======================================================================

#======================================================================
# RGB LED Functions
# (Full Pi2Go only)
#
# setLED(LED, Red, Green, Blue): Sets the LED specified to required RGB value. 0 >= LED # setAllLEDs(Red, Green, Blue): Sets all LEDs to required RGB. 0 #======================================================================

#======================================================================
# WHITE LED Functions
#
# LsetLED(LED, value): Sets the LED specified to OFF == 0 or ON >= 1
# LsetAllLEDs(value): Sets both LEDs to OFF == 0 or ON >= 1
#======================================================================

#======================================================================
# IR Sensor Functions
#
# irLeft(): Returns state of Left IR Obstacle sensor
# irRight(): Returns state of Right IR Obstacle sensor
# irCentre(): Returns state of Centre IR Obstacle sensor (Full Pi2Go Only)
# irAll(): Returns true if any of the Obstacle sensors are triggered
# irLeftLine(): Returns state of Left IR Line sensor
# irRightLine(): Returns state of Right IR Line sensor
#======================================================================

#======================================================================
# UltraSonic Functions
#
# getDistance(). Returns the distance in cm to the nearest reflecting object. 0 == no object
#======================================================================

#======================================================================
# Light Sensor Functions
#
# getLight(Sensor). Returns the value 0..1023 for the selected sensor, 0 # getLightFL(). Returns the value 0..1023 for Front-Left light sensor
# getLightFR(). Returns the value 0..1023 for Front-Right light sensor
# getLightBL(). Returns the value 0..1023 for Back-Left light sensor
# getLightBR(). Returns the value 0..1023 for Back-Right light sensor
#======================================================================

#======================================================================
# Servo Functions
#
# startServos(). Initialises the servo background process
# stop Servos(). terminates the servo background process
# setServo(Servo, Degrees). Sets the servo (0 or 1) to position in degrees -90 to +90
#======================================================================

#======================================================================
# Switch Functions
#
# getSwitch(). Returns the value of the tact switch: True==pressed
#======================================================================

 

Filer


Tipsa en vän
Art.nr: 20-144
Antal i lager: 5
1 378,00 SEK

Tipsa en vän


Copyright Hands-On Science AB