[ev3 × Java] leJOS development environment construction (Eclipse on Mac OSX / bluetooth)

I will write about the preparation for running ev3 in Java.

table of contents

  1. What is leJOS?
  2. What you need
  3. Reference article
  4. Preparation of microSD
  5. bluetooth connection
  6. SSH connection
  7. Eclipse preparation and program execution Finally

What is 0.leJOS?

A system that provides a Java programming environment for LEGO Mindstorms robots.

This time, I will run ev3 on ** Mac OS X ** using ** bluetooth **. In addition, a program is created and processed using ** Eclipse **, which is a Java integrated development environment.

1. What you need

◯ ev3 (tank) ◯ Personal computer (Eclipse) ◯ bluetooth ◯ microSD ◯ leJOS-API


2. Reference article

I think it's best to read this article and proceed.

[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction first part] [LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]


3. Preparation of microSD

** 1 **. Download the latest from sourceforge / lejos ev3.

** 2 **. Unzip the downloaded one → Unzip sd500.zip.

** 3 **. Use Ethcher to write sd500.img to the sd card.

** 4 **. Unzip lejosimage.zip → Write all the files inside to the SD card. (Drag and drop to move the file to the root directory (top level space) of the SD card.)

** 5 **. Download Java for lejos from Oracle JRE.

** 6 **. Move the downloaded file to the root directory (top level space) of the SD card as it is.

** 7 **. Insert the SD card into ev3 and boot.


4. Make a bluetooth connection

@ev3-brick

** 1 **. Select PAN ** 2 **. Select BT Client ** 3 **. Select the computer you want to connect to ** 4 **. Successful connection when IP address is displayed


5. SSH connection

◯ It is not necessary to execute a general program. Please do it when you need it.

@Terminal

** 1 **. Enter root @ 192. ~. ~. ~

** 2 ** .Enter key

** 3 **. Confirmation If successful, it will look like ↓ root@EV3:~#

If it doesn't work

** Edit the config file with a vi editor **.

@Terminal

** 1 **. Type cd / etc

** 2 ** .Check if there is a .config file Type `ʻopen ssh``

** 3 **. Access the .config file cd ssh sudo vi ssh_config Enter your computer password

** 4 ** Edit with .vi editor

Press the i key (INSERT = command to enter characters) Add the following code at the bottom Host 10.0.1.1 192.~.~.~ KexAlgorithms +diffie-hellman-group1-sha1 Ciphers aes128-cbc

Press esc Press the : key Type wq (command to save and exit) Press enter

** 5 **. Check connection ssh root@192.~.~.~

[Reference article] Lego EV3 Tutorial with leJOS on macOS How to use the vi command

6. Eclipse preparation and program execution

It is very easy to understand, so please refer to this. [LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]

◯ Sample code example

//Import the required code
import lejos.hardware.*;

//Create a class
public class HelloWorld
{
    //Create a static method
    public static void main(String[] args)
    {
        //Hello World!!And output to the screen of ev3
        System.out.println("Hello World!!");
        //Wait until any button is pressed
        Button.waitForAnyPress();
    }
}

Finally

Thank you for reading. Next time, I would like to write about the control of a single motor. If you find any mistakes or improvements, please let us know.

Recommended Posts

[ev3 × Java] leJOS development environment construction (Eclipse on Mac OSX / bluetooth)
Java development environment construction memo on Mac
Java development environment (Mac, Eclipse)
Install Java development environment on Mac
Build a Java development environment on Mac
java development environment construction
Rails6 development environment construction [Mac]
Create a Java development environment using jenv on Mac
Build Java development environment with VS Code on Mac
Java development environment construction on Mac-JDK Install (2020 preservation version)
[Mac] VS Code development environment construction (Java, Gradle, Node.js)
Java development environment construction (Mac + Pleiades All in One Eclipse 4.7 + Spring Boot + Gradle (Buildship))
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
[Eclipse Java] Development environment setting memo
Build Java development environment (for Mac)
[Java & SpringBoot] Environment Construction for Mac
Java development environment (Mac, VS Code)
[Processing x Java] Construction of development environment
Spring Boot environment construction memo on mac
Laravel development environment construction with Docker (Mac)
Play Framework 2.6 (Java) environment construction in Eclipse
What is Java and Development Environment (MAC)
Spring Boot + Docker Java development environment construction
Run jooby's Eclipse development environment on Gradle
JSP + Eclipse + Jetty development environment construction that even Java beginners can do
[Java] Environment construction
Java environment construction
Java development environment
[Java] Build Java development environment on Ubuntu & check execution
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction part 2]
[Environment construction] Eclipse installation
[Environment construction] Ruby on Rails 5.2 system development environment construction [within 1 hour]
Java development environment memo
Install Java on Mac
[Java] Environment construction procedure for developing struts 1.3 with Eclipse
Learn the meaning of "passing the PATH" by building a Java development environment on Mac
[Environment construction Mac] Ruby on Rails (+ Webpacker handles errors)
[For beginners] Until building a Web application development environment using Java on Mac OS
[Even beginners can do it! ] How to install Eclipse on Windows 10 (Java environment construction)
Run kuromoji on Win10 + Eclipse + Java environment (January 2020 version)
[Environment construction] Build a Java development environment with VS Code!
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
[LeJOS] Let's program mindstorm-EV3 in Java [Environment construction first part]
Web application development environment construction in Java (for inexperienced people)
[Procedure 1 for beginners] Ruby on Rails: Construction of development environment
[Environment construction] Get the Ruby on Rails 6 development environment within 1 hour
Eclipse installation and code completion enhancements (Mac for Java development)
Create a Java and JavaScript team development environment (gradle environment construction)
AtCoder Challenge Environment Construction (Java 8)
First Java development in Eclipse
[Rails / MySQL] Mac environment construction
Install tomcat + eclipse on mac
Ruby on Rails --From environment construction to simple application development on WSL2
Ruby on Rails development environment construction with Docker + VSCode (Remote Container)
I just want to write Java using Eclipse on my Mac
I tried to create a Spring MVC development environment on Mac
If you want to change the Java development environment from Eclipse
Notes on building Kotlin development environment and migrating from Java to Kotlin
Using Java on OSX 10.15 (Catalina) β
Environment construction for Servlet application development
Ruby environment construction summary ~ mac version ~