LEGO MINDSTORMS and Raspberry Pi Communicator

Slides:



Advertisements
Similar presentations
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Switches.
Advertisements

Calibrating Color Sensors
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: EV3 Basics Introduction to the EV3 Brick and Software.
By Droids Robotics INTERMEDIATE EV3 PROGRAMMING LESSON SIMPLE & OPTIMIZED ULTRASONIC WALL FOLLOW.
By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi Communicator.
Bonus EV3 Programming Lessons LEGO MINDSTORMS EV3Dev and Raspberry Pi Communicator.
PixyCam for MINDSTORMS Introduction
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics PROPORTIONAL ULTRASONIC WALL FOLLOWER © 2015, EV3Lessons.com, Last edit 11/17/2015.
Introduction to ev3dev: Setup
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi IR Light controller.
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
Building a Robot for Our Lessons
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
EV3 & Swift: Getting STARTED
Proportional Control with the Sound Sensor
BEGINNER PROGRAMMING LESSON
By Sanjay and Arvind Seshan
BEGINNER EV3 PROGRAMMING Lesson
Parallel Beam Synchronization
Beginner programming Lesson
BEGINNER PROGRAMMING LESSON
SIMPLE & OPTIMIZED ULTRASONIC WALL FOLLOW
BEGINNER EV3 PROGRAMMING Lesson
Introduction to EV3Dev: Setup with Python
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
SIMPLE & OPTIMIZED ULTRASONIC WALL FOLLOW
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
By Sanjay and Arvind Seshan
Downloading & Uploading Files
Gyro Move Straight & Gyro Wall Follow
BEGINNER PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
By Sanjay and Arvind Seshan
By Sanjay and Arvind Seshan
Repeating Actions (Loops)
BEGINNER PROGRAMMING LESSONS
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING Lesson
Downloading & Uploading Files
Proportional Control with the Sound Sensor
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
BEGINNER PROGRAMMING LESSONS
BEGINNER EV3 PROGRAMMING Lesson
By Sanjay and Arvind Seshan
Menu System.
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Presentation transcript:

LEGO MINDSTORMS and Raspberry Pi Communicator

Objectives Learn how to make the EV3 communicate with a Raspberry Pi Prerequisites: Must have basic Python programming knowledge Must be comfortable using a Raspberry Pi (Unix/Linux commands & GPIO) Must be familiar with EV3 Bluetooth Messaging © EV3Lessons 2016 (Last Update: 2/4/2016)

Materials Raspberry Pi (Tested on Model B Edition 1 using Raspbian) EV3 brick USB Bluetooth (for the Raspberry Pi) © EV3Lessons 2016 (Last Update: 2/4/2016)

Step 1: Pi Setup Install software on the Raspberry Pi sudo apt-get update sudo apt-get upgrade sudo reboot sudo apt-get install bluetooth bluez-utils blueman © EV3Lessons 2016 (Last Update: 2/4/2016)

Step 2: Bluetooth EV3 to Pi Run hcitool scan to find the mac address of EV3 (will look something like this: 00:16:53:3F:2F:C3) Run bluetooth-agent 1234 & :proxy for entering passcode for ev3 Run sudo rfcomm connect /dev/rfcomm0 MAC_ADDRESS & :to connect the ev3 (press enter if any message(s) appears on the screen) Replace MAC_ADDRESS with the Mac Address If you are not returned to a terminal, try pressing “Return/Enter”. If that did not work you probably forgot the & symbol. © EV3Lessons 2016 (Last Update: 2/4/2016)

Step 3: Base Code Download Pi Base Code This code will decipher EV3 Bluetooth messages on the Pi The code only deciphers text messages © EV3Lessons 2016 (Last Update: 2/4/2016)

Challenge 1: Send a Message From the EV3 to the Pi Create EV3 test program to send “hello” to the name of your Pi Play the base code on the Pi and the code you made on the EV3. You should then see the message you sent on the Pi. If there are errors that probably means that the Bluetooth is not connected properly © EV3Lessons 2016 (Last Update: 2/4/2016)

Challenge 1: Solution © EV3Lessons 2016 (Last Update: 2/4/2016)

Challenge 2: Run Actions Based on the EV3 Message Use Python to print “Hello EV3” if the EV3 message is “hi” Hint: to make the if statement work in this scenario you will need to use if ‘hi’ in message: instead of if message == ‘hi’: You can use the base code to collect EV3 messages provided by EV3Lessons.com (See Slide 10) Be sure to read the comments to understand how the code works Download solution code from EV3Lessons.com © EV3Lessons 2016 (Last Update: 2/4/2016)

Extra: Send Message from the RPi to the EV3 The message, mailbox name and the message type needs to be encoded into a format that the EV3 can understand The data needs to be sent over Bluetooth to the EV3 We have the code for this posted on EV3Lessons.com You will need this code for Challenge 3 © EV3Lessons 2016 (Last Update: 2/4/2016)

Challenge 3: Receive RPi Message Make an EV3 program that will receive the RPi’s message and print it on the screen Play the program on the Raspberry Pi and the EV3 © EV3Lessons 2016 (Last Update: 2/4/2016)

Challenge 3 Solution © EV3Lessons 2016 (Last Update: 2/4/2016)

CREDITS This tutorial was created by Sanjay Seshan and Arvind Seshan from Droids Robotics. More lessons are available at www.ev3lessons.com Author’s Email: team@droidsrobotics.org Credits: gipprojects for the code to connect a Raspberry Pi to an EV3                           This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. © EV3Lessons 2016 (Last Update: 2/4/2016)