Welcome to Processing Who does not have access to digital camera?

Slides:



Advertisements
Similar presentations
Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.
Advertisements

Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
Lesson One: The Beginning Chapter 3: Interaction Learning Processing: by Daniel Shiffman Presentation by Donald W. Smith Graphics from text.
Week 8 - Monday.  What did we talk about last time?  StdAudio.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
A Quick Introduction to Processing
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
Introduction to Sensor Technology Week Four Adam Taylor
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Lecture 3 IAT 800. Sept 15, Fall 2006IAT 8002 Suggestions on learning to program  Spend a lot of time fiddling around with code –Programming is something.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
DataInputFrom Digital PinsUsing an On/OFF button to control an LEDFrom Analog Pins Reading light intensity using a photocell and turning an LED on and.
Arduino Part 2 Topics: Serial Communication Programming Constructs: functions, loops and conditionals Digital Input.
Basic Circuits – Lab 2 Arduino and Sensors
Tele-presence – Connecting Two Processing Platforms via Internet Controlling the Screen based on Distant User Input ServerClient 1.
Review Blocks of code {.. A bunch of ‘statements’; } Structured programming Learning Processing: Slides by Don Smith 1.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Continuous February 16, Test Review What expression represents the zip car eligibility rules of at least 18 years old and no incidents?
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Processing Lecture.2 Mouse and Keyboard
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
ATLAS 2013 Super Fast Intro to Arduino and Processing Materials by Lindsay Craig, David Stillman and Ben Leduc-Mills.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Robootika lahenduste esitlus Raul Liinev Martin Ligema Siim Suu Martin Tõnne.
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
Lesson Two: Everything You Need to Know
Serial Communication. mouseX from computer to arduino processing sends a single byte of data arduino reads each byte arduino uses value to set light brightness.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
Often being different. Control flow By default Java (and therefore Processing) executes lines of a program one after the other –Doesn’t matter what happened.
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
Youn-Hee Han, In-Seok Kang {yhhan, Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology.
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
CS305j Introduction to Computing Simple Graphics 1 Topic 11 Simple Graphics "What makes the situation worse is that the highest level CS course I've ever.
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
C# SERIAL COMMUNICATION TEMPERATURE CONTROL WITH ARDUINO KAAN EREN
Serial Communication RS-232. In order to make two devices communicate, whether they are desktop computers, microcontrollers, or any other form of integrated.
Microcontroller basics Embedded systems for mortals.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
Loops. About the Midterm Exam.. Exam on March 12 Monday (tentatively) Review on March 5.
Arduino Programming. THE ARDUINO IS A MICROCONTROLLER – A LOW COST, LOW PERFORMANCE COMPUTER.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Microcontroller basics
Tele-presence – Connecting Two Processing Platforms via Internet
INC 161 , CPE 100 Computer Programming
Week 8 - Monday CS 121.
“Processing” easy coding Jens Dalsgaard Nielsen
Computation as an Expressive Medium
Mouse Inputs in Processing
More programming with "Processing"
Topics: Programming Constructs: loops & conditionals Digital Input
Lecture 7: Introduction to Processing
LCC 6310 Computation as an Expressive Medium
Continuous & Random September 21, 2009.
Presentation transcript:

Welcome to Processing Who does not have access to digital camera?

What is Processing? Screen based programming environment with a code structure very much like java. Programs are called “sketches” just like in Arduino FREE!

Draw a line line(x1, y1, x2, y2) Draws a line (a direct path between two points) to the screen. To color a line, use the stroke() function. Example: line(15, 25, 70, 90);

Increase size, change background, change stroke color size(400, 400); background(192, 64, 0); stroke(255); line(150, 25, 270, 350); This version sets the window size to 400 x 400 pixels, sets the background to an orange-red, and draws the line in white, by setting the stroke color to 255. By default, colors are specified in the range 0 to 255.

Adding Interactivity A program written as a list of statements (like the previous examples) is called a static mode sketch. Interactive programs are drawn as a series of frames, which you can create by adding functions titled setup() and draw()

Follow the mouse void setup() { size(400, 400); stroke(255); background(192, 64, 0); } void draw() { line(150, 25, mouseX, mouseY); } The setup() block runs once, and the draw() block runs repeatedly.

Changing code order void setup() { size(400, 400); stroke(255); background(192, 64, 0); } void draw() { background(192, 64, 0); line(150, 25, mouseX, mouseY); }

Adding mousePressed() void setup() { size(400, 400); stroke(255); } void draw() { line(150, 25, mouseX, mouseY); } void mousePressed() { background(192, 64, 0); }

Interfacing with Arduino Serial communication Running Processing Code to interpret data the Arduino is sending Running Arduino code to measure sensors and send info to Processing

Arduino code for interfacing with Processing int analogPin = 0; int analogValue = 0; void setup() { // start serial port at 9600 bps: Serial.begin(9600); } void loop() { // read analog input, divide by 4 to make the range 0-255: analogValue = analogRead(analogPin); analogValue = analogValue / 4; Serial.print(analogValue, BYTE); // pause for 10 milliseconds: delay(10); }

Processing code for Interfacing w/ Arduino import processing.serial.*; Serial myPort; // The serial port int graphXPos = 1; // the horizontal position of the graph: void setup () { size(400, 300); // window size // List all the available serial ports println(Serial.list()); // I know that the fisrt port in the serial list on my mac // is usually my Arduino module, so I open Serial.list()[0]. // Open whatever port is the one you're using. myPort = new Serial(this, Serial.list()[0], 9600); // set inital background: background(48,31,65); } void draw () { // nothing happens in draw. It all happens in SerialEvent() } (continued)

void serialEvent (Serial myPort) { // get the byte: int inByte = myPort.read(); // print it: println(inByte); // set the drawing color. Pick a pretty color: stroke(123,128,158); // draw the line: line(graphXPos, height, graphXPos, height - inByte); // at the edge of the screen, go back to the beginning: if (graphXPos >= width) { graphXPos = 0; // clear the screen: background(48,31,65); } else { // increment the horizontal position for the next reading: graphXPos++; }