Saturday, December 28, 2013

Install python-setuptools on Ubuntu

python-setuptools (setuptools) is a tools easy download, build, install, upgrade, and uninstall Python packages.

To download and install it, enter the command:

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | sudo python

Tuesday, December 17, 2013

Free download Arduino Uno poster

A brand new Arduino Uno 'blueprint' Poster is available to download, for FREE! produced by Elektor for element14 & YOU.

This ‘blueprint poster’ will give all you need to know on the Arduino Uno in one view, including some cheats and coding to get you booting up with this unique hardware platform.

Arduino Uno Poster
Arduino Uno Poster
Download here.

Thursday, December 5, 2013

Install Arduino IDE running on Raspberry Pi

To install Arduino IDE running on Raspberry Pi, enter the command:
$ sudo apt-get install arduino

After installed, you can start Arduino IDE from Start menu of Raspberry Pi desktop > Electronics > Arduino IDE.



Or enter the command in Terminal:
$ arduino

The installed version is 1.0.1.


Cross post with Hello Raspberry Pi

Friday, November 15, 2013

Communication between Arduino and Raspberry Pi (in Python)

This example show how to write a simple Python program on Raspberry Pi to get keyboard input and send to Arduino via USB. In Arduino, send back the received chars to Raspberry Pi, then print on screen in Pi side.



In this example, Raspberry Pi act as host and Arduino Due act as device, and connect with USB on Programming USB Port.

Python code in Raspberry Pi:
import serial
ser = serial.Serial('/dev/ttyACM1', 9600)

name_out = raw_input("Who are you?\n")
ser.write(name_out + "\n")
name_return = ser.readline()
print(name_return)

Code in Arduino side:
int pinLED = 13;
boolean ledon;

void setup() {
  Serial.begin(9600);
  pinMode(pinLED, OUTPUT);
  ledon = true;
  digitalWrite(pinLED, ledon = !ledon);
}
 
void loop() {
  if(Serial.available() > 0){
    Serial.print("Hello ");
    
    while(Serial.available()>0){
      char charIn = (char)Serial.read();
      Serial.print(charIn);
      if (charIn == '\n')
        break;
    }
    
    digitalWrite(pinLED, ledon = !ledon);
  }
}

Cross-post with my another blog: Hello Raspberry Pi

Wednesday, November 6, 2013

Getting Started with BeagleBone: Linux-Powered Electronic Projects With Python and JavaScript

Getting Started with BeagleBone
Getting Started with BeagleBone
Getting Started with BeagleBone: Linux-Powered Electronic Projects With Python and JavaScript

Many people think of Linux as a computer operating system, running on users' desktops and powering servers. But Linux can also be found inside many consumer electronics devices. Whether they're the brains of a cell phone, cable box, or exercise bike, embedded Linux systems blur the distinction between computer and device.

Many makers love microcontroller platforms such as Arduino, but as the complexity increases in their projects, they need more power for applications, such as computer vision. The BeagleBone is an embedded Linux board for makers. It's got built-in networking, many inputs and outputs, and a fast processor to handle demanding tasks. This book introduces you to both the original BeagleBone and the new BeagleBone Black and gets you started with projects that take advantage of the board's processing power and its ability to interface with the outside world.

Tuesday, October 29, 2013

butterflUI: Open Source Graphical User Interface Library for Arduino in Processing

butterflUI is Open Source Graphical User Interface Library for Arduino in Processing, Control and Monitoring for Physical Computing.

The subject of physical computing, especially in the field of robotics, is a fascinating area that has already begun its triumphant in universities, schools and hobby applications and is developing with impressive speed. It is highly interesting that Pyhsical Computing and Robotics, more than any other area, can merge many different areas (engineering, design, psychology, biology and many other areas).



Link: http://butterflui.org/

Building iPhone and iPad Electronic Projects: Real-World Arduino, Sensor, and Bluetooth Low Energy Apps in techBASIC

Building iPhone and iPad Electronic Projects
Building iPhone and iPad Electronic Projects: Real-World Arduino, Sensor, and Bluetooth Low Energy Apps in techBASIC

Why simply play music or go online when you can use your iPhone or iPad for some really fun projects, such as building a metal detector, hacking a radio control truck, or tracking a model rocket in flight? Learn how to build these and other cool things by using iOS device sensors and inexpensive hardware such as Arduino and a Bluetooth Low Energy (LE) Shield.
This hands-on book shows you how to write simple applications with techBASIC, an Apple-approved development environment that runs on iOS devices. By using code and example programs built into techBASIC, you’ll learn how to write apps directly on your Apple device and have it interact with other hardware.
  • Build a metal detector with the iOS magnetometer
  • Use the HiJack hardware platform to create a plant moisture sensor
  • Put your iPhone on a small rocket to collect acceleration and rotation data
  • Hack a radio control truck with Arduino and Bluetooth LE
  • Create an arcade game with an iPad controller and two iPhone paddles
  • Control a candy machine with an iOS device, a micro servo, and a WiFi connection
September 2013  1449363504  978-1449363505

Friday, October 25, 2013

ArduBlock - a graphical programming language for Arduino

Ardublock is a graphical programming environment to make programming physical computing with Arduino as easy as drag and drop.

link: http://blog.ardublock.com/

Setup ArduBlock with Arduino IDE

- Open Arduino IDE

- Click File -> Preferences

- Record the Sketchbook location, and make sure the "Check for updates on startup" box is checked.

- Close Arduino IDE

- Download ardublock-all.jar from http://blog.ardublock.com/engetting-started-ardublockzhardublock/, or direct link at http://cloud.github.com/downloads/taweili/ardublock/ardublock-all.jar.

- Copy the downloaded ardublock-all.jar to the directory <Sketchbook location>/tools/ArduBlockTool/tool/

Try ArduBlock from Arduino IDE

- Restart Arduino IDE.

- Click Tools -> ArduBlock to start ArduBlock.

- Drag and Drop something in ArduBlock, click Upload to update Sketch in Arduino IDE.

- Sketch code in Arduino IDE updated accordingly.

Thursday, October 24, 2013

The Makerspace Workbench: Tools, Technologies, and Techniques for Making

The Makerspace Workbench
The Makerspace Workbench: Tools, Technologies, and Techniques for Making
Create a dynamic space for designing and building DIY electronic hardware, programming, and manufacturing projects. With this illustrated guide, you’ll learn the benefits of having a Makerspace—a shared space with a set of shared tools—that attracts fellow makers and gives you more resources to work with. You’ll find clear explanations of the tools, software, materials, and layout you need to get started—everything from basic electronics to rapid prototyping technology and inexpensive 3D printers.

A Makerspace is the perfect solution for many makers today. While you can get a lot done in a fully-decked out shop, you’ll always have trouble making space for the next great tool you need. And the one thing you really miss out on in a personal shop is the collaboration with other makers. A Makerspace provides you with the best of both worlds.

Perfect for any maker, educator, or community, this book shows you how to organize your environment to provide a safe and fun workflow, and demonstrates how you can use that space to educate others.

September 24, 2013  1449355676  978-1449355678

Saturday, October 19, 2013

Saturday, October 12, 2013

Getting Started with Arduino

A casual video give an overview about how they work, what you can do with them, and how the varying models differ from each other. No scary programming involved!



Read our practical starter guide from Tested to the most popular Arduino kits here: http://www.tested.com/tech/robots/456466-know-your-arduino-guide-most-common-boards/

Maker Faire Rome 2013: launch of Arduino Robot video tutorials

Maker Faire Rome 2013: launch of Arduino Robot video tutorials
Watch the video of the launch of the new Arduino Robot at Maker Faire Rome 2013 with Massimo Banzi and David Cuartielles.

Tuesday, October 8, 2013

Beginning Arduino 2nd Edition

Beginning Arduino 2nd Edition
Beginning Arduino 2nd Edition
Want to light up a display? Control a touch screen? Program a robot? The Arduino is a microcontroller board that can help you do all of these things, plus nearly anything you can dream up. Even better, it's inexpensive and, with the help of Beginning Arduino, Second Edition, easy to learn.

In Beginning Arduino, Second Edition, you will learn all about the popular Arduino by working your way through a set of 50 cool projects. You'll progress from a complete Arduino beginner to intermediate Arduino and electronic skills and the confidence to create your own amazing projects. You'll also learn about the newest Arduino boards like the Uno and the Leonardo along the way. Absolutely no experience in programming or electronics required!

Each project is designed to build upon the knowledge learned in earlier projects and to further your knowledge of Arduino programming and electronics. By the end of the book you will be able to create your own projects confidently and with creativity. You'll learn about:
  • Controlling LEDs
  • Displaying text and graphics on LCD displays
  • Making a line-following robot
  • Using digital pressure sensors
  • Reading and writing data to SD cards
  • Connecting your Arduino to the Internet
This book is for electronics enthusiasts who are new to the Arduino as well as artists and hobbyists who want to learn this very popular platform for physical computing and electronic art.

Please note: The print version of this title is black and white; the eBook is full color. The color fritzing diagrams are available in the source code downloads on http://www.apress.com/9781430250166 


Monday, October 7, 2013

Intel Galileo Board Hardware Overview

Intel® Galileo Board Hardware Overview
This how-to video provides a hardware overview of the Intel® Galileo Board. This video shows the physical location of the various hardware components on the board and describes each one.

Download Intel Galileo Board Getting Started Guide

The document, Intel Galileo Board Getting Started Guide, explains how to connect your Intel® Galileo board to a computer, install the software on your computer, and upload your first sketch. This includes details such as downloading the environment, installing the Arduino* IDE application, updating the firmware, etc.

Intel Galileo Board Getting Started Guide
Intel Galileo Board Getting Started Guide

Download for free: Intel Galileo Board Getting Started Guide, in PDF format.

Arduino Intel Galileo Board

Arduino introduce the new Galileo Board from Intel. It's part of the Arduino Certified product line. You can find the official product page here.

Arduino Intel Galileo Board
Arduino Intel Galileo Board
Galileo is a microcontroller board based on the Intel® Quark SoC X1000 Application Processor, a 32-bit Intel Pentium-class system on a chip. It’s the first board based on Intel® architecture designed to be hardware and software pin-compatible with Arduino shields designed for the Uno R3. Digital pins 0 to 13 (and the adjacent AREF and GND pins), Analog inputs 0 to 5, the power header, ICSP header, and the UART port pins (0 and 1), are all in the same locations as on the Arduino Uno R3. This is also known as the Arduino 1.0 pinout.

Galileo is designed to support shields that operate at either 3.3V or 5V. The core operating voltage of Galileo is 3.3V. However, a jumper on the board enables voltage translation to 5V at the I/O pins. This provides support for 5V Uno shields and is the default behavior. By switching the jumper position, the voltage translation can be disabled to provide 3.3V operation at the I/O pins.

Of course, the Galileo board is also software compatible with the Arduino Software Development Environment (IDE), which makes usability and introduction a snap. In addition to Arduino hardware and software compatibility, the Galileo board has several PC industry standard I/O ports and features to expand native usage and capabilities beyond the Arduino shield ecosystem. A full sized mini-PCI Express slot, 100Mb Ethernet port, Micro-SD slot, RS-232 serial port, USB Host port, USB Client port, and 8MByte NOR flash come standard on the board.

Friday, October 4, 2013

Two in one: Arduino TRE

With the 1-GHz Texas Instruments Sitara AM335x ARM Cortex-A8 processor, Arduino developers get up to 100 times more performance with the Sitara-processor-based TRE than they do on the Arduino Leonardo or Uno. This performance opens the doors to more advanced Linux-powered applications. The Sitara-processor-based Linux Arduino can run high-performance desktop applications, processing-intensive algorithms or high-speed communications.

The Arduino TRE is two Arduinos in one: the Sitara-processor-based Linux Arduino plus a full AVR-based Arduino, while leveraging the simplicity of the Arduino software experience. The integration of the AVR Arduino enables the Arduino TRE to use the existing shield ecosystem so that innovators can expand the Arduino TRE to develop a wide range of high-performance applications such as 3D printers, gateways for building automation and lighting automation, telemetry hubs that collect data from nearby sensors wirelessly, and other connected applications that require host control plus real-time operations.

In addition, the Arduino TRE is partially the result of a close collaboration between Arduino and the BeagleBoard.org foundation. These open hardware pioneers share a passion for expanding open source development and making technology accessible for artists, designers and hobbyists. The TRE design builds upon the experience of both Arduino and BeagleBoard.org, combining the benefits of both community based boards.

The Arduino TRE is expected to be available in spring 2014.

Arduino Tre product page: http://arduino.cc/en/Main/ArduinoBoardTre

Two in one: Arduino TRE
Two in one: Arduino TRE


Light You Can Touch | LYT by Second Story - demo mobile phones + Intel Galileo microprocessor board



With exciting implications for glowing furniture of the future, interactive studio Second Story has created a collaborative drawing canvas that allows users to control ambient lighting using their mobile phones via the new Intel® Galileo microprocessor board.

Learn more: Introducing the Galileo Development Board

See more of the LYT project here: http://thecreatorsproject.vice.com/blog/processor-galileo-helps-creators-innovate-in-unchartered-waters

Sunday, September 29, 2013

Processing 2 example: pushMatrix() and popMatrix()

Example of using pushMatrix() and popMatrix() of Processing 2:



void setup() {  // setup() runs once
  size(400, 300);
  background(255);
}

void draw() {
  
  pushMatrix();
  translate(200, 50);
  ellipse(50, 50, 100, 100);
  popMatrix();
  ellipse(50, 50, 100, 100);
}


Processing 2 example: translate()

Example of using translate(x, y) of Processing 2:

Processing 2 example: translate()
Processing 2 example: translate()


void setup() {  // setup() runs once
  size(400, 300);
  background(255);
}

void draw() {
  rect(50, 50, 100, 100);
  translate(200, 50);
  rect(50, 50, 100, 100);
}


Saturday, September 28, 2013

Arduino Projects For Dummies

Arduino Projects For Dummies
Arduino Projects For Dummies

Discover all the amazing things you can do with Arduino

Arduino is a programmable circuit board that is being used by everyone from scientists, programmers, and hardware hackers to artists, designers, hobbyists, and engineers in order to add interactivity to objects and projects and experiment with programming and electronics. This easy-to-understand book is an ideal place to start if you are interested in learning more about Arduino's vast capabilities. Featuring an array of cool projects, this Arduino beginner guide walks you through every step of each of the featured projects so that you can acquire a clear understanding of the different aspects of the Arduino board.
  • Introduces Arduino basics to provide you with a solid foundation of understanding before you tackle your first project
  • Features a variety of fun projects that show you how to do everything from automating your garden's watering system to constructing a keypad entry system, installing a tweeting cat flap, building a robot car, and much more
  • Provides an easy, hands-on approach to learning more about electronics, programming, and interaction design for Makers of all ages
Arduino Projects For Dummies is your guide to turning everyday electronics and plain old projects into incredible innovations.

Get Connected! To find out more about Brock Craft and his recent Arduino creations, visit www.facebook.com/ArduinoProjectsForDummies

June 4, 2013  1118551478  978-1118551479 1


Friday, September 27, 2013

Getting started with Arduino Yún

Getting started with Arduino Yún - tutorial

The Arduino Yún is a microcontroller board based on the ATmega32u4 (datasheet) and the Atheros AR9331. The Atheros processor supports a Linux distribution based on OpenWRT named Linino. The board has built-in Ethernet and WiFi support, a USB-A port, micro-SD card slot, 20 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator, a micro USB connection, an ICSP header, and a 3 reset buttons.

More info
http://blog.arduino.cc/2013/09/10/its-time-to-enjoy-the-arduino-yun-now-available-for-purchase/

Tuesday, September 24, 2013

Arduino 1.5.4 beta with Arduino Yun supported

If you have the new Yún or Due Board you must download the 1.5.4 version. Read release notes.

Download the Arduino Software.

Arduino 1.5.4 beta
Arduino 1.5.4 beta



Sunday, September 22, 2013

Arduino Community Logo is up

Arduino Community Logo
Arduino Community Logo
You can use the Arduino Community Logo as it is or adding the name of your group. Visit http://arduino.cc/en/Trademark/CommunityLogo to know more about Arduino Community Logo, download, and how to use it.

Tuesday, September 17, 2013

Zero to Maker: Learn (Just Enough) to Make (Just About) Anything

Zero to Maker: Learn (Just Enough) to Make (Just About) Anything
Zero to Maker: Learn (Just Enough) to Make (Just About) Anything
Zero to Maker: Learn (Just Enough) to Make (Just About) Anything
Are you possessed by the urge to invent, design, and make something that others enjoy, but don’t know how to plug into the Maker movement? In this book, you’ll follow author David Lang’s headfirst dive into the Maker world and how he grew to be a successful entrepreneur. You’ll discover how to navigate this new community, and find the best resources for learning the tools and skills you need to be a dynamic maker in your own right.
Lang reveals how he became a pro maker after losing his job, and how the experience helped him start OpenROV—a DIY community and product line focused on open source undersea exploration. It all happened once he became an active member of the Maker culture. Ready to take the plunge into the next Industrial Revolution? This guide provides a clear and inspiring roadmap.
  • Take an eye-opening journey from unskilled observer to engaged maker-entrepreneur
  • Enter the Maker community to connect with experts and pick up new skills
  • Use a template for building a maker-based entrepreneurial lifestyle
  • Learn from the organizer of the first-ever Maker Startup Weekend
  • Be prepared for exciting careers of the future


Saturday, September 7, 2013

Set frame rate of draw()

This example set frame rate (2 frames per second) by calling frameRate() in setup(). Also display the duration between draw() called. After frame rate set, draw() will be called in around 500ms.

Set frame rate of draw()
Set frame rate of draw()


long lastTime;

void setup() {
  size(300, 200);
  lastTime = System.currentTimeMillis() - lastTime;
  
  frameRate(2);  //set 2 frames/sec
}

void draw() { 
  long curTime = System.currentTimeMillis();
  long duration = curTime - lastTime;
  lastTime = curTime;
  println(duration);
}

Atmel and Arduino Inspiring the Maker Movement

Atmel - Atmel and Arduino Inspiring the Maker Movement

Bob Martin, Atmel MCU Applications Manager, discusses Atmel's unique relationship with Arduino, Maker Faire and the Maker Movement.

Atmel® has been inspiring the Maker Movement, also known as the maker culture, since 2005. Atmel microcontrollers (MCUs) have been powering almost every Arduino board on the market today. Our easy-to-use 8- and 32-bit MCUs are powering the worldwide Maker communities.

Atmel attributes the success of Arduino to its easy-to-use, free cross-platform toolchain, and its simple do-it-yourself packages with Atmel's MCUs. These factors helped initially steer the Arduino team to choose our AVR microcontrollers—and today, both our AVR® and ARM®-based MCUs.

For more information, please visit http://www.atmel.com/atmel-makes/default.aspx

Friday, September 6, 2013

Get the time of the program has run

The following code get the number of milliseconds a program has run using millis(), then print to the text area of the Processing environment's console using println().

void setup() {
  size(300, 200);
}

void draw() { 
  int t = int(millis());
  println(t);
}

Print the time of the program has run
Print the time of the program has run, in millisecond.

Wednesday, September 4, 2013

ArduinoDroid - Arduino IDE on Android


ArduinoDroid - Arduino IDE for Android

Features:
* open/edit arduino sketches
* example sketches and libraries included
* configurable code syntax highlighting
* compile sketches (no root required)
* upload sketches (FTDI-based board and Arduino Uno are supported at this time only, android devices with USB-host support required)
* works offline (internet connection is not required)

On first launch ArduinoDroid downloads and extracts SDK (about 30Mb), so about 100Mb of internal storage space is required.

Monday, September 2, 2013

Arduino Audio Circuits

Arduino Audio Circuits
Arduino Audio Circuits
Arduino Audio Circuits
August 31, 2013  1430245786  978-1430245780 1

Let's say you have an LED display, and you want it to indicate volume from your TV, MP3 player, or other sound source. How do you make it work? With Discover Audio with Arduino, you'll learn exactly that.

You will build simple to intermediate volume unit (VU) meters using LEDs, analog
meters & circuits, LCDs, and the Arduino. You'll also build simple amplifier circuits to enhance monitoring sound of radios, TVs, and MP3 players. You'll even learn how to use he online simulation tool CircuitLab to analyze simple amplifier circuits for VU projects and experiments.

What you’ll learn

  • How to combine sound and LED displays
  • How to do sound experiments with Arduino
  • How to test amplifier circuits with CircuitLab
  • How to build an Arduino-based volume unit meter

Who this book is for

Arduino and electronics hobbyists who want to learn more about working with audio displays and volume monitoring.


Arduino Software 1.5.3 BETA released

If you have the new Due Board you must download the 1.5.3 version. Once you get the software follow this instruction to get started with the Arduino Due.

WARNING: This software is a beta version, you may encounter bugs or unexpected behaviours. Please discuss any issues in the Due forum.

Release note

Download Arduino Software.

Wednesday, August 28, 2013

Device to Cloud: Prototyping Platforms

Device to Cloud, Hands-On. Part 1: Prototyping Platforms

It's the first part of a series of episode. A range of embedded systems prototyping platforms will be explored. and also how to connect tiny devices into the cloud for fun, scale, and security.

In today's episode I'm going to give an overview of the prototyping platforms I'm going to explore in the upcoming few weeks. I'm initially going to focus on platforms that are cheap to buy and have existing communities, so that you can play along if you like: Arduino, Gadgeteer, Netduino, Android ADK, Seeedstudio Grove, and Raspberry Pi. Later this year, we'll also take a look at prototyping/evaluation platforms for industrial microcontrollers.

Today and in the next few episodes, I'll be starting with the Arduino Ethernet board, which I bought as part of a Fritzing Starter Kit. Fritzing.org is an open-source hardware design initiative by the Interaction Design Lab at the University of Applied Sciences in Potsdam, Germany.

Source: http://channel9.msdn.com/Blogs/Subscribe/Device-to-Cloud-Hands-On-Part-1-Prototyping-Platforms

Thursday, August 22, 2013

Processing example: simple animation of sin()

Processing example: simple animation of sin()
Processing example: simple animation of sin()


int x = 0;

void setup(){
  size(400, 300);
  background(200);
  stroke(0);

}

void draw() {
  
  x += 1;
  if(x > width){
    x = 0;
    background(200);
  }
  
  int center = height/2;
  float angle = x * 4 * PI /width;
  int l = (int)(sin(angle)*height/2);
  line(x, center, x, l + center); 
}



Processing on desktop vs Processing for Android

It's the same code (from last post, Processing example: curve()) run on Android for Processing.

Run on Android device, Nexus One.
Run on Android device, Nexus One.




Cross post: Android-er blog - Processing on desktop vs Processing for Android

Wednesday, August 21, 2013

Processing example: curve()

Processing example: curve()
Processing example: curve()

void setup(){
  size(400, 300);
  background(0);
  stroke(255);
}

void draw() {

  noFill();
  
  if(mousePressed){
    background(0);
    point(mouseX, mouseY);
    line(80, 50, mouseX, mouseY);
    line(50, 200, 350, 250);
    curve(80, 50, mouseX, mouseY, 50, 200, 350, 250);

  }
  
}

Processing example: bezier()

Processing example: bezier()
Processing example: bezier()

void setup(){
  size(400, 300);
  background(0);
  stroke(255);
}

void draw() {

  noFill();
  
  if(mousePressed){
    background(0);
    point(mouseX, mouseY);
    line(80, 50, mouseX, mouseY);
    line(50, 200, 350, 250);
    bezier(80, 50, mouseX, mouseY, 50, 200, 350, 250);

  }
  
}

Monday, August 19, 2013

Processing 2: Create sketch video with Movie Maker

Processing 2 build-in with Movie Maker function, you can easy create video for your sketch. The tool creates QuickTime movie from a sequence of images.

To run Movie Maker, click Processing menu Tools > Movie Maker.

Processing's Movie Maker
Processing's Movie Maker


Video created with Processing 2 Movie Maker from images saved in last example "Capture images of sketch with saveFrame()".

Processing example: Capture images of sketch with saveFrame()

saveFrame() saves a numbered sequence of images, one image each time the function is run. The following example save frames of the sketch when mouse pressed. The images will be saved in the sketch folder with name "draw-######.png".

void setup() {  // setup() runs once
  size(400, 300);
  background(0);
  stroke(255);
}

void draw() {
  if(mousePressed){
    point(mouseX, mouseY);
    
    //Saves a numbered sequence of images
    saveFrame("draw-######.png");
  }
}

sketch captured with saveFrame()
sketch captured with saveFrame()
With the saved images, you can create video with Processing 2 build-in Movie Maker.

Saturday, August 17, 2013

Processing example: free draw something with mouse

Free draw something with mouse
Free draw something with mouse


void setup() {
  size(400, 300);
  background(0);
  stroke(255);
}

void draw() {
  if(mousePressed){
    point(mouseX, mouseY);
  }
}


Processing 2.0.2 is available now

Processing updated 2.0.2. Visit: https://processing.org/download/ to download.


Thursday, August 15, 2013

Processing exercise: convert image to grayscale using filter()

Example to convert image to grayscale,  black and white, using filter().

Processing exercise: convert image to grayscale using filter()
Processing exercise: convert image to grayscale using filter()


PImage myImage1, myImage2;

void setup() {
  myImage1 = loadImage("http://goo.gl/MMeu0o", "png");
  myImage2 = loadImage("http://goo.gl/MMeu0o", "png");
  myImage2.filter(GRAY);
  
  size(450, 300);
  smooth();
}

void draw() {

  image(myImage1, 0, 0);
  image(myImage2, myImage1.width, 0);

}


Wednesday, August 14, 2013

Processing exercise: draw rotated and translated image

Processing exercise: draw rotated and translated image
Processing exercise: draw rotated and translated image


PImage myImage;

void setup() {
  myImage = loadImage("http://goo.gl/MMeu0o", "png");
  size(400, 400);
  smooth();
}

void draw() {
  //draw in rotated/translated
  rotate(PI/4.0);
  translate(100, 0);
  image(myImage, 0, 0);
  
  //back to original 
  translate(-100, 0);
  rotate(-PI/4.0);
  
  //draw image in half size
  image(myImage, 0, 0, myImage.width/2, myImage.height/2);
}


Smart Home Automation with Linux and Raspberry Pi, Second Edition

Smart Home Automation with Linux and Raspberry Pi, Second Edition
Smart Home Automation with Linux and Raspberry Pi, Second Edition
Smart Home Automation with Linux and Raspberry Pi shows you how to automate your lights, curtains, music, and more, and control everything via a laptop or mobile phone.

You'll learn how to use Linux, including Linux on Raspberry Pi, to control appliances and everything from kettles to curtains, including how to hack game consoles and even incorporate LEGO Mindstorms into your smart home schemes. 

You’ll discover the practicalities on wiring a house in terms of both and power and networking, along with the selection and placement of servers. There are also explanations on handling communication to (and from) your computer with speech, SMS, email, and web. Finally, you’ll see how your automated appliances can collaborate to become a smart home.

Smart Home Automation with Linux was already an excellent resource for home automation, and in this second edition, Steven Goodwin will show you how a house can be fully controlled by its occupants, all using open source software and even open source hardware like Raspberry Pi and Arduino.

What you’ll learn

  • Control appliances like kettles and curtains both locally and remotely.
  • Find and harness data sources to provide context-aware living.
  • Hack/change existing hardware/software to better fit your needs.
  • Integrate various technologies into a function greater than the whole.
  • Set up a home network, for both network and audio/video traffic.
  • Learn how to incorporate Raspberry Pi, Arduino, and even LEGO Mindstorms into your smart home.

Who this book is for

This book is for amateur and professional Linux users and electronics enthusiasts who want to control their homes and their gadgets.

Table of Contents

  1. Appliance Control: Making Things Do Stuff 
  2. Appliance Hacking: Converting Existing Technology  
  3. Media Systems: Incorporating the TV and the HiFi 
  4. Home is Home: The Physical Practicalities
  5. Communication: Humans Talk, Computers Talk 
  6. Data Sources: Making Homes Smart 
  7. Control Hubs: Bringing It All Together 
  8. Working with Raspberry Pi
June 12, 2013  143025887X  978-1430258872 2

Tuesday, August 13, 2013

processing exercise: load image from internet

Example to load image from internet:

PImage myImage;

void setup() {
  myImage = loadImage("http://goo.gl/MMeu0o", "png");
  size(myImage.width, myImage.height);
  smooth();
}

void draw() {
  image(myImage, 0, 0);
}

processing exercise: load image from internet
processing exercise: load image from internet


ARM TechCon 2013

Ranked one of the top three must-attend events in the embedded industry, ARM® TechCon™ is more than a conference. ARM TechCon’s unique 360-degree interactive training ground seeded to connect, instruct, advise and enable the world of electronic and ARM-based computer design provides attendees with a comprehensive understanding of ARM-based technology.

Through technical sessions, hands-on labs, exhibits, demonstrations, keynote and panel discussions, chip designers, system implementation engineers and software developers obtain exclusive access to trending design strategies, methodologies and tools for building ARM-based products.

This year, ARM TechCon connects software to hardware communities, and both to ARM Ecosystem Partners. As hardware engineers and software developers continue to collaborate on designs and integrate technologies these communities now work synergistically to accelerate time to market and optimize their designs utilizing both hardware and software.


ARM TechCon 2013 combines sessions for chip designers, system implementation engineers, and software developers in a shared venue, facilitating communities’ interaction, learning and collaboration.

link: http://www.armtechcon.com/

Tuesday, August 6, 2013

Learning Java, 4th Edition

Learning Java, 4th Edition
Learning Java, 4th Edition
Learning Java

Java is the preferred language for many of today’s leading-edge technologies—everything from smartphones and game consoles to robots, massive enterprise systems, and supercomputers. If you’re new to Java, the fourth edition of this bestselling guide provides an example-driven introduction to the latest language features and APIs in Java 6 and 7. Advanced Java developers will be able to take a deep dive into areas such as concurrency and JVM enhancements.

You’ll learn powerful new ways to manage resources and exceptions in your applications, and quickly get up to speed on Java’s new concurrency utilities, and APIs for web services and XML. You’ll also find an updated tutorial on how to get started with the Eclipse IDE, and a brand-new introduction to database access in Java.


Saturday, August 3, 2013

processing exercise: display image

To display image in Processing, the image file(s) have to be added in sketch's "data" folder. In Processing IDE, click Sketch from the menu bar, select Add File...



Browse to select the image file, click OK.


Example code:

PImage myImage;

void setup() {
  myImage = loadImage("Arduino-er2.png");
  size(myImage.width, myImage.height);
  smooth();
}

void draw() {
  image(myImage, 0, 0);
}

processing exercise: display image
processing exercise: display image


processing exercise: rectMode()

rectMode() modifies the location from which rectangles are drawn by changing the way in which parameters given to rect() are intepreted.

processing exercise: rectMode()
processing exercise: rectMode()

size(250, 250);
smooth();
strokeWeight(3);

fill(255, 0, 0);
rectMode(CORNER);  // Default Mode
/* the first two parameters of rect() as the location of one 
corner, and the third and fourth parameters as the location 
of the opposite corner.*/
rect(100, 100, 80, 80);

noFill();
stroke(200, 0, 0);  //set stroke color = red
rectMode(CENTER);
/* the first two parameters of rect() as the shape's center 
point, while the third and fourth parameters are its width 
and height. */
rect(100, 100, 80, 80);

stroke(0, 200, 0);  //set stroke color = green
rectMode(RADIUS);
/* uses the first two parameters of rect() as the shape's 
center point, but uses the third and fourth parameters to 
specify half of the shapes's width and height.*/
rect(100, 100, 80, 80);


Related: processing exercise: rect()

processing exercise: rect()

processing exercise: rect()
processing exercise: rect()


size(500, 300);
smooth();
strokeWeight(3);

//rect(a, b, c, d)
rect(50, 50, 100, 100);

//rect(a, b, c, d, r)
rect(200, 50, 100, 100, 20);
noFill();
rect(350, 50, 100, 100, 50);

fill(100, 100, 100);
//rect(a, b, c, d, tl, tr, br, bl)
rect(50, 200, 50, 50, 10, 0, 0, 0);
rect(150, 200, 50, 50, 0, 10, 0, 0);
rect(250, 200, 50, 50, 0, 0, 10, 0);
rect(350, 200, 50, 50, 0, 0, 0, 10);
rect(370, 220, 50, 50, 10, 0, 10, 0);
noFill();
rect(390, 240, 50, 50, 0, 10, 0, 10);


Related: processing exercise: rectMode()

Friday, August 2, 2013

Install Android Mode on Processing

Processing for Android is aim to make it easy to create Android apps using the Processing API. With Android developer tools and Processing installed on your machine, you can simply write a line of code, hit Run (Ctrl-R or Cmd-R), and have your sketch show up in the emulator as a working Android app. Select Run on Device (Ctrl-Shift-R or Cmd-Shift-R) to have it run on an Android device that you have plugged into your machine.

Steps to install Android Mode on Processing (2.0.1 currently):

- click on the Mode Selection Box on top-right.


- Select Add Mode...


- Install Android Mode.



- Close and re-start Processing, you can new Android option on the Mode Selection Box.


- In the first time running in Android mode, you will be ask to select the location of Android SDK, just click Yes.


- Browse to select sdk folder of Android SDK. If you cannot browse in the folder using mouse, just type in the Selection box manually.


- Click on the Run icon.


- It is the code of last example "processing exercise: arc()" running on Android.