Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept."— Presentation transcript:

1 Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.

2 Processing Tutorial 1 Getting Started INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. The Processing equivalent of a "Hello World" program is simply to draw a line: line(35, 25, 70, 90);

3 Processing Tutorial 1 Getting Started INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. Static programming command lines size(400, 400); background(192, 64, 0); stroke(255); line(150, 25, 270, 350);

4 Processing Tutorial 1 Getting Started INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. Interactive Programming, adding setup(), draw() and HELLO MOUSE void setup() { size(400, 400); stroke(255); background(192, 64, 0); } void draw() { line(150, 25, mouseX, mouseY); }

5 Processing Tutorial 1 Getting Started INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. Interactive Programming, adding setup(), draw() and HELLO MOUSE void setup() { size(400, 400); stroke(255); background(192, 64, 0); } void draw() { background(192, 64, 0); line(150, 25, mouseX, mouseY); }

6 Processing Tutorial 1 Getting Started INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. Interactive Programming, adding setup() and draw() and HELLO MOUSE void setup() { size(400, 400); stroke(255); background(192, 64, 0); } void draw() { line(150, 25, mouseX, mouseY); } void mousePressed() { background(192, 64, 0); }

7 Processing Tutorial 2 Variables tutorial2 Variable Declaration: int var; // type name Variable Initialization: var = 10; // var equals 10 Using Variable: var = var+1; INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept. Data Primitive boolean byte char color double float int long Composite Array ArrayList HashMap Object String XMLElement

8 Processing Tutorial 3 for() void setup() { size(470, 200); println(Hello World); } void draw() { background(off); stroke(on); for (int i = 0; i <= 13; i++) { rect(420 - i * 30, 30, 20, 20); } INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.

9 Processing Tutorial 3 Objects tutorial3. Human data * Height. * Weight. * Gender. * Eye color. * Hair color. Human functions * Sleep. * Wake up. * Eat. * Ride some form of transportation. INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.

10 Processing Tutorial 4 Processing - Arduino Handshake Download Library Files From Download Processing Library: processing-arduino-0017.zip processing-arduino-0017.zip INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.

11 Processing Tutorial 4 Processing - Arduino Handshake Instructions Unzip the library and copy the "arduino" folder into the "libraries" sub-folder of your Processing Sketchbook. (You can find the location of your Sketchbook by opening the Processing Preferences. If you haven't made a "libraries" sub-folder, create one.) Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board. Configure Processing for serial: In Processing, open one of the examples that comes with with the Arduino library. Edit the example code to select the correct serial port. Run the example.Run the example. INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.

12 Processing Tutorial 4 Processing - Arduino Handshake INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.


Download ppt "Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept."

Similar presentations


Ads by Google