• Complain

Lazar - Arduino and LEGO Projects

Here you can read online Lazar - Arduino and LEGO Projects full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA, year: 2013, publisher: Apress, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Lazar Arduino and LEGO Projects
  • Book:
    Arduino and LEGO Projects
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2013
  • City:
    Berkeley;CA
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Arduino and LEGO Projects: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Arduino and LEGO Projects" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

We all know how awesome LEGO is, and more and more people are discovering how many amazing things you can do with Arduino. In Arduino and LEGO Projects, Jon Lazar shows you how to combine two of the coolest things on the planet to make fun gadgets like a Magic Lantern RF reader, a sensor-enabled LEGO music box, and even an Arduino-controlled LEGO train set. Learn that SNOT is actually cool (it means Studs Not on Top) See detailed explanations and images of how everything fits together Learn how Arduino fits into each project, including code and explanations Whether you want to impress your friends, annoy the cat, or just kick back and bask in the awesomeness of your creations, Arduino and LEGO Projects shows you just what you need and how to put it all together.

Lazar: author's other books


Who wrote Arduino and LEGO Projects? Find out the surname, the name of the author of the book and a list of all author's works by series.

Arduino and LEGO Projects — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Arduino and LEGO Projects" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Jon Lazar Arduino and LEGO Projects 10.1007/978-1-4302-4930-6_1 Jon Lazar 2013
1. LEGO, Arduino, and The Ultimate Machine
Jon Lazar 1
(1)
NewYork, USA
Abstract
For years LEGO has produced their own computer based system known as Mindstorms. It gave a computer brain to the plastic LEGO bricks that had been around for decades. While Mindstorms has advanced in the 15 years since it was introduced, it was still limited based on the size of the LEGO Intelligent Brick and the available sensors and motors. An alternative to using the LEGO Mindstorms is the Arduino microprocessor, a small computer that can make use of any electrical components with some programming.
For years LEGO has produced their own computer based system known as Mindstorms. It gave a computer brain to the plastic LEGO bricks that had been around for decades. While Mindstorms has advanced in the 15 years since it was introduced, it was still limited based on the size of the LEGO Intelligent Brick and the available sensors and motors. An alternative to using the LEGO Mindstorms is the Arduino microprocessor, a small computer that can make use of any electrical components with some programming.
Introducing the Arduino
An Arduino (as seen in Figure ) is an open source microcontroller that allows for programming and interaction; it is programmed in C/C++ with an Arduino library to allow it to access the hardware. This allows for more flexible programmability and the ability to use any electronics that can interface with the Arduino. Because the Arduino is open source, the plans for the circuits are available online for free to anyone who wants to use and create their own based on the schematics, as long as they share what they create. This allows for a lot of customizability in projects, since people have built Arduinos of different sizes, shapes, and power levels to control their projects.
Figure 1-1 The Arduino microcontroller The main advantages of using the - photo 1
Figure 1-1.
The Arduino microcontroller
The main advantages of using the Arduino over LEGOs own motor systems are the open source base, the expandability, and the sizes. With LEGOs system, the user is locked into the pieces LEGO created. This can be a hindrance with smaller projects where the Mindstorms NXT Intelligent Brick can be too large to easily incorporate or hide the intelligence behind the project. With the smaller Arduino circuit board, less clearance is required to hold the circuit board, which means more flexibility in the design of the project. A comparison of the Arduino and the LEGO NXT brick can be seen in Figure .
Figure 1-2 The Arduino and the LEGO Mindstorms NXT Intelligent Brick The - photo 2
Figure 1-2.
The Arduino and the LEGO Mindstorms NXT Intelligent Brick
The Arduino itself may not be capable of fulfilling all the activities that you would like to carry out with it, but there are circuit boards known as shields that snap on top of the Arduino circuit board to expand the usability of the Arduino. Allowing the use of motors, adding Internet connectivity, making sounds with.wav files, and other activities can be triggered through the use of these add-on boards, thus allowing the Arduino to be programmed to carry out tasks it could not without them. As an example, Figure shows an Ethernet shield that allows the Arduino to connect to the Internet.
Figure 1-3 An Ethernet shield to allow the Arduino to talk to the Internet - photo 3
Figure 1-3.
An Ethernet shield to allow the Arduino to talk to the Internet
Your First Arduino Program
Most commonly, when someone tries out a new computer language, they make the words Hello World appear on the screen. The Arduino version of this is to make a light-emitting diode (LED) blink. By plugging the LED into two of the ports on the Arduino and writing a simple program, the Arduino can turn the light on and off.
The first step is to put the LED into the Arduino. LEDs are specific to the way they are used. The LED needs to be plugged in so that the longer end goes into a numbered pin and the shorter pin into the ground pin, or the LED will not light up. Figure shows the longer side in the socket labeled 13 and the shorter side in the ground.
Figure 1-4 The LED plugged into the Ardunio Once the LED is firmly placed - photo 4
Figure 1-4.
The LED plugged into the Ardunio
Once the LED is firmly placed in the Arduino, the next step is to connect it to a computer via USB cable. The computer must have the Arduino software installed in order to program the Arduino. The software can be downloaded for free at arduino.cc in the download section for your computer operating system of choice. Once it is downloaded and installed, open the Arduino software. The following program can be found in File Examples 01.Basics Blink or it can be entered by hand, as shown in Listing 1-1.
Listing 1-1.Basic Blink Program
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
The code in Listing 1-1 is the most basic program for an Arduino. It is read by the Arduino from the top down. The first thing in the program is a global variable definition for the pin that has the LED. A global variable is defined outside the setup() and loop() functions and can be accessed from anywhere in the program. The line int led=13; defines the global variable named led to be an integer with the value of 13. Whenever the word led is used, the program will interpret it as the number 13. Since the variable is defined before the words void setup(); it is what is referred to as a global variable, which means any part of the program can access and make changes to it. If the variable had been defined in the setup or loop sections (as defined below), it would only be a local variable that could only be accessed by that section of code. It is worth noting that anything between the symbols /* and */ or on a line after // are comments and will be ignored by the computer when it reads the program.
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
Anything between the braces after setup() will be executed when the program first runs. Anything in there will be run only once and never be looked at again. In this case, it using pinMode to tell the Arduino that it will be using pin 13, where you defined led , to be used to send a signal out. It is notable that the pins can be used for either input or output, but must be defined to do so.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Arduino and LEGO Projects»

Look at similar books to Arduino and LEGO Projects. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Arduino and LEGO Projects»

Discussion, reviews of the book Arduino and LEGO Projects and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.