I.Dezember 2009 www.processing.org P R O C E S S I N G programmierenvironment für visuell orientierte, interaktive applikationen.

Slides:



Advertisements
Ähnliche Präsentationen
Der Stinger 1. Wohin geh ihr denn? 2. Kenn du das Mädchen da?
Advertisements

Word Order in German Subordiante Clauses
M a r c – o l i v e r p a h l Informatik I – Kapitel 7 Klassen und höhere Datentypen Zusammenfassung des Kapitel 7 Küchlin, Weber, Einführung in die Informatik,
DNS-Resolver-Mechanismus
Agenda Sitzung 2 für den Programmaufbau
PKJ 2005/1 Stefan Dissmann Vorwoche - Klasse public class Studierende { private String name, vorname, studiengang; private int matNr, semester; private.
Dieses Spiel heisst mit Lehrer... deinem GegenteileVerben & Wortschatz SätzeSonstigeswerden Grammatik.
Aufgabenbesprechung Programming Contest. Order 7 Bo Pat Jean Kevin Claude William Marybeth 6 Jim Ben Zoe Joey Frederick Annabelle 0 SET 1 Bo Jean Claude.
Intelligente Dateisysteme Einführende Bemerkungen Manfred Thaller, Universität zu Köln Köln 17. Oktober 2013.
Prof. Dr.-Ing. habil. B. Steinbach - Informatik / Softwaretechnologie und Programmierungstechnik - Institut für Informatik Verteilte Software - Java -
Formation of Questions in German
Java: Dynamische Datentypen
Praktikum Entwicklung und Einsatz von Geosoftware I - Sitzung 9 IO – Streams in Java Sommersemester 2003 Lars Bernard.
Three minutes presentation I ArbeitsschritteW Seminar I-Prax: Inhaltserschließung visueller Medien, Spree WS 2010/2011 Giving directions.
Modulare Programmierung
DVG Verkettete Listen Verkettete Listen. DVG Verkettete Listen 2 Primitive Datentypen Vorteile: –werden direkt vom Prozessor unterstützt.
Munz – IT/TG - Lörrach. Goals of this intensive lecture To learn: To learn: –What does it means programming in Java ? –What is JAVA good/bad for ? –Which.
Comparative Adjectives. The term comparison of adjectives is used when two or more persons or things have the same quality (height, size, color, any characteristic)
Using the Mean as a Measure of Center Lesson 3 1.
Das Perfekt Wiederholen (hoffentlich!). Think of 5 things you did in your holidays but think of sentences in the PRESENT TENSE. 1.Am Montag schlafe ich.
Zu + Infinitiv : eine Erklärung
Question words and word order By the end of this lesson you will have revised question words By the end of this lesson you will be able to use question.
Laurie Clarcq The purpose of language, used in communication, is to create a picture in the mind and/or the heart of another.
Was ich alles tun würde! All the things I would do!
Relative clauses What is a relative clause?
Meine Erste Wohnung! My First Aparment!
OO implementieren Teil IV Objekte erzeugen. © René ProbstModul 226IV - 2 Von der Klasse zum Objekt Plan Bau Objekt Klasse Instanzierung Objekt Das Objekt.
| DC-IAP/SVC3 | © Bosch Rexroth Pneumatics GmbH This document, as well as the data, specifications and other information set forth in.
Das Perfekt (Present Perfect Tense). Think of 5 things you did in your holidays but think of sentences in the PRESENT TENSE. 1.Am Montag schlafe ich viel.
Plural Forms of Nouns & Wie viel? or Wie viele?
BAS5SE | Fachhochschule Hagenberg | Daniel Khan | S SPR5 MVC Plugin Development SPR6P.
Raimond Reichert Einführung in die Verwendung von Processing innerhalb von Eclipse.
The free XML Editor for Windows COOKTOP Semistrukturierte Daten 1 Vortrag Semistrukturierte Daten 1 COOKTOP The free XML-Editor for Windows
Prototyping Augmented Reality Universität zu Köln Historisch-Kulturwissenschaftliche Informationsverarbeitung Medien zwischen Technik und Gesellschaft.
Deutsch 1 G Stunde. Donnerstag, der 25. Oktober 2012 Deutsch 1, G Stunde Heute ist ein B- Tag Unit: Family & homeFamilie & Zuhause Objectives: Phrases.
Deutsch 1 G Stunde. Dienstag, der 16. Oktober 2012 Deutsch 1, G Stunde Heute ist ein B- Tag Unit: Family & homeFamilie & Zuhause Objectives: Getting to.
Deutsch 1 G Stunde. Montag, der 10. September 2012 Deutsch 1 (G Stunde)Heute ist ein D - Tag Unit: Introduction to German & Germany Objectives: Introducing.
You need to use your mouse to see this presentation
You need to use your mouse to see this presentation © Heidi Behrens.
Algorithmen und Datenstrukturen Übungsmodul 6
Equals, Hashcode und CompareTo Micha Kessler
Dynamische Datentypen
Ein Projekt des Technischen Jugendfreizeit- und Bildungsvereins (tjfbv) e.V. kommunizieren.de Blended Learning for people with disabilities.
Design Patterns Ein Muster (pattern) ist eine Idee, die sich in einem praktischen Kontext als nützlich erwiesen hat und dies auch in anderen sein wird.
Hätte gern vs. Möchte gern
External Labels – The rules For all external labels the following rules apply (external labels are all labels which are not inside of a shape) - all labels.
Gestern hat mich ein Regentropfen getroffen Yesterday a rain drop met me. ;) und gab meinem Kopf einen nassen Kuss. And gave my head a wet kiss. Ohne Warnung,
© Boardworks Ltd of 8 Time Manner Place © Boardworks Ltd of 8 This icon indicates that the slide contains activities created in Flash. These.
By: Jade Bowerman. German numbers are quite a bit like our own. You start with one through ten and then you add 20, 30, 40 or 50 to them. For time you.
Visual Design mit Processing Übung Visualisierung semantischer Information.
Can you tell me about your school?
Adjectiv Endungen Lite: Adjective following articles and pre-ceeding nouns. Colors and Clothes.
Learning By Doing Konstruktoren Gleicher Name wie die Klasse Zur Initialisierung des Objekts, insbesondere mit Parametern Wir immer bei der Objekterzeugung.
1 Chapter 7: Selected Algorithms 7.1 External Search 7.2 External Sorting 7.3 Text searching.
AVL-Trees (according to Adelson-Velskii & Landis, 1962) In normal search trees, the complexity of find, insert and delete operations in search.
Sentence Structure Subject and verb are always together. Subject and verb are always together. Subject and verb must agree Subject and verb must agree.
So ist das Leben Treffpunkt Deutsch Sixth Edition
Separable Verbs Turn to page R22 in your German One Book R22 is in the back of the book There are examples at the top of the page.
Plusquamperfekt The past of the past.
Launch ON Global.vi System ID object name classname Services to suscribe Observer Control Ref vi-path Service name Step 1 : Objects register to the Global.vi´s,
THE PERFECT TENSE IN GERMAN
By Martin L. Loeffler.  The basic sentence has a subject and a verb.  The subject and verb need to be together.  The subject and verb need to agree.
Warm-up: Kickers ‘ob’, ‘dass’, ‘weil’
THE CONVERSATIONAL PAST
Someone who wants to help you might ask:Your response might be: Was soll ich jetzt tun? What should I do now? Geh für mich einkaufen! Go shopping for me.
Inf K1/2 Sj 13/14 GZG FN W.Seyboldt 1 SFZ FN Sj. 13/14 Python Klassen und Objekte.
Here‘s what we‘ll do... Talk to the person sitting in front of you. Introduce each other, and ask each other questions concerning the information on your.
Großvater Großmutter Großvater Großmutter Tante/Onkel Vater Mutter.
Was hast du gemacht? What did you do?
Ich - Projekt Due Monday, September 19..
 Präsentation transkript:

I.Dezember P R O C E S S I N G programmierenvironment für visuell orientierte, interaktive applikationen

I.Dezember Warum selbst programmieren? kreativere lösungen ökonomischer politisch korrekt zugänglich mehr verständnis

I.Dezember

I.Dezember

I.Dezember

I.Dezember

I.Dezember

I.Dezember

I.Dezember J a v a b a s i e r t size(400, 400); background(192, 64, 0); stroke(255); line(150, 25, 270, 350);

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

I.Dezember h i n t e r g r u n d n e u z e i c h n e n void setup() { size(400, 400); stroke(255); } void draw() { line(150, 25, mouseX, mouseY); } void mousePressed() { background(255, 247, 3); }

I.Dezember e x p o r t File Export Application File Export Öffne index.html um den sketch im browser zu sehen saveFrame("output.png")

I.Dezember size(400, 400); // falsche art die position anzugeben ellipse(200, 200, 50, 50); // immer in der mitte, egal wie sich die size() line verändert ellipse(width/2, height/2, 50, 50);

I.Dezember size(400, 400, JAVA2D); size(400, 400, P2D); size(400, 400, P3D); size(400, 400, OPENGL); size(400, 400, PDF, "output.pdf");

I.Dezember // JPEGs hineinladen // daten von einer datei hineinladen String[] lines = loadStrings(irgendein.txt"); PImage image = loadImage(meinBild.jpg");

I.Dezember l i b r a r i e s Sketch Import Library PDF Export

I.Dezember Primitives Float (32 bit information) (floating-point numbers: E+38) Int (32 bit) numbers without a decimal point: -2,147,483,647 Bol (true or flase) Char (Each char is two bytes (16 bits) (typographic symbols such as A, d, and $)

I.Dezember object-oriented programming (OOP) : : Objekte haben Eigenschaften und Funktionen : : sie werden über Klassen classes definiert : : Die class ist die Keksform, der Keks ist das object

I.Dezember Beispiel cars pseudo code normal Data (Global Variables): Auto Farbe Auto x Position Auto y Position Auto x Geschwindigkeit Setup: Initialisiere Auto Farbe. Initialisiere Auto Standort am Anfang. Initialisiere Auto Geschwindigkeit Draw: Füll den Hintergrund Zeig das Auto am richtigen Ort mit der richtigen Farbe Verändere die Autoposition mit der richitgen Geschwindigkeit

I.Dezember color c = color(0); float x = 0; float y = 100; float speed = 1; void setup() { size(200,200); } void draw() { background(255); move(); display(); } void move() { x = x + speed; if (x > width) { x = 0; } void display() { fill(c); rect(x,y,30,10); }

I.Dezember Pseudo code object orientiert Data (Global Variables): Auto Objekt. Setup: Initialisiere Auto Objekt. Draw: Füll den Hintergrund Zeig das Auto Objekt. Bewege das Auto Objekt.

I.Dezember

I.Dezember Car myCar; void setup() { myCar = new Car(); } void draw() { background(255); myCar.move(); myCar.display(); }

I.Dezember C L A S S - E L E M E N T E 1.name - mach keksform class car { 2.Data - nenne variablen 3.Constructor - mach den keks Car myCar = new Car();" 4. methods definier die funktionen durch methods

I.Dezember

I.Dezember Class ist ein block, den du überall hinstellen kannst, solange er außerhalb von setup () und draw () ist void setup() { } void draw() { } class Car { }

I.Dezember // Step 1. Deklariere das Objekt Car myCar; void setup() { // Step 2. Initialisiere das Objekt. myCar = new Car(); } void draw() { background(255); // Step 3. Rufe die Funktionen des Objekts auf myCar.move(); myCar.display(); }

I.Dezember Objekt Variable deklarieren Car myCar;

I.Dezember Primitives v.s. compex data types komplexen Datentypen, weil sie mehrere Informationen beinhalten (die Daten und Funktionalitäten. Primitive speichern nur Daten)

I.Dezember Objekt initialisieren Wenn man eine normale primitive Variable (zum Beispiel eine integer) initiert gibst du ihr einfach einen Wert: // Variable Initialization var = 10; // var equals 10 Um ein Objekt zu initialisieren, muss du etwas mehr tun, nicht nur Wert zu weisen, sondern als ganzes konstruieren construct. Du konstruierst ein Objekt mit dem neuen Operator // Object Initialization myCar = new Car(); // The new operator is used to make a new object. "myCar" ist der Objektname "= zeigt an, dass wir etwas neues kreieren, ein neues Keksobjekt, der constructor ruft eine spezielle Funktion namens Car() auf. Diese Funktion initialisiert automatisch alle Variablen des Objekts. Sie bekommen den Wert null, der aber überhaupt nicht 0 heißt, sondern einfach gar nichts. Leere. Die Fehlermeldung "NullPointerException" kommt meist daher, dass du vergessen hast das Objekt zu initialisieren.

I.Dezember Nützung des Objekts Autos fahren, Blumen wachsen, Sonnen strahlen: spezielle Objekte haben spezielle Funktionen syntax: variableName.objectFunction(Function Arguments); // Functions are called with the "dot syntax". myCar.draw(); myCar.display();

I.Dezember constructor für mehere objekte nützen Car myCar = new Car(color(255,0,0),0,100,2);

I.Dezember ARGUMENTS Arguments sind lokale Variablen, die nur im Inneren einer Funktion verwendet werden und mit Werten gefüllt werden, wenn die Funktion aufgerufen wird.

I.Dezember Sie haben nur einen Zweck: Die Variablen in einem Objekt zu initialisieren. Das sind die wichtigen Variablen, die die eigentliche Farbe oder die temporäre Position des Autos beinhalten. Die Arguments des constructors sind nur temporär und existieren nur um den Wert vom Entstehungsort des Objekts zum Objekt selbst weiterzuleiten.

I.Dezember ARGUMENTS Car(color tempC, float tempXpos, float tempYpos, float tempXspeed) { c = tempC; xpos = tempXpos; ypos = tempYpos; xspeed = tempXspeed; }

I.Dezember durch diese arguments kannst du mit dem selben constructor viele verschiedene objekte herstellen

I.Dezember g a n z e r c o d e : s/chapter-8/example-8-2/

I.Dezember P R O C E S S I N G M I T A R D U I N O V E R B I N D E N

I.Dezember Beispiel Code Examples- Libraries- Serial – Serial call and response-

I.Dezember schaltkreis int firstSensor = 0; // first analog sensor int secondSensor = 0; // second analog sensor int thirdSensor = 0; // digital sensor int inByte = 0; // incoming serial byte

I.Dezember processing code import processing.serial.*; int bgcolor; // Background color int fgcolor; // Fill color Serial myPort; // The serial port int[] serialInArray = new int[3]; // Where we'll put what we receive int serialCount = 0; // A count of how many bytes we receive int xpos, ypos; // Starting position of the ball boolean firstContact = false; // Whether we've heard from the microcontroller void setup() { size(256, 256); // Stage size noStroke(); // No border on the next thing drawn xpos = width/2; // Set the starting position of the ball (middle of the stage) ypos = height/2; println(Serial.list()); // Print a list of the serial ports, for debugging purposes String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600); } void draw() { background(bgcolor); fill(fgcolor);// Draw the shape ellipse(xpos, ypos, 20, 20); } void serialEvent(Serial myPort) {// read a byte from the serial port: int inByte = myPort.read(); // if this is the first byte received, and it's an A, // clear the serial buffer and note that you've // had first contact from the microcontroller. // Otherwise, add the incoming byte to the array: if (firstContact == false) { if (inByte == 'A') { myPort.clear(); // clear the serial port buffer firstContact = true; // you've had first contact from the microcontroller myPort.write('A'); // ask for more } else { serialInArray[serialCount] = inByte; serialCount++; // If we have 3 bytes: if (serialCount > 2 ) { xpos = serialInArray[0]; ypos = serialInArray[1]; fgcolor = serialInArray[2]; println(xpos + "\t" + ypos + "\t" + fgcolor); myPort.write('A'); serialCount = 0; }

I.Dezember int firstSensor = 0; // first analog sensor int secondSensor = 0; // second analog sensor int thirdSensor = 0; // digital sensor int inByte = 0; // incoming serial byte void setup() { // start serial port at 9600 bps: Serial.begin(9600); pinMode(2, INPUT); // digital sensor is on digital pin 2 establishContact(); // send a byte to establish contact until Processing responds } void loop() { // if we get a valid byte, read analog ins: if (Serial.available() > 0) { // get incoming byte: inByte = Serial.read(); // read first analog input, divide by 4 to make the range 0-255: firstSensor = analogRead(0)/4; // delay 10ms to let the ADC recover: delay(10); // read second analog input, divide by 4 to make the range 0-255: secondSensor = analogRead(1)/4; // read switch, multiply by 155 and add 100 // so that you're sending 100 or 255: thirdSensor = (155 * digitalRead(2)); // send sensor values: Serial.print(firstSensor, BYTE); Serial.print(secondSensor, BYTE); Serial.print(thirdSensor, BYTE); } void establishContact() { while (Serial.available() <= 0) { Serial.print('A', BYTE); // send a capital A delay(300); } Arduino code

I.Dezember Zur Erinnerung :

I.Dezember Wichtig für selbstgemachte sensoren:

I.Dezember

I.Dezember L Ö T E N Rule #1: Die beiden zu verbindenen Teile festklemmen (helping hands)

I.Dezember Rule #2: verwende den lötkolben solange er die richtige temperatur hat

I.Dezember Rule #3: erhitze den zu lötenden teil, nicht den lötdraht

I.Dezember Rule #4: überprüfe die verbindung unter einem vergrößerungsglas

I.Dezember

I.Dezember cold joints

I.Dezember T u t o r i a l

Arduina und Processing verbinden Processing sends a byte out the serial port, and reads 3 bytes in. Sets foregound color, xpos, and ypos of a circle onstage using the values returned from the serial port of the Arduina I.Dezember

I.Dezember

Kopiert bitte den Arduino Code, der unter dem Processing Code auskommentiert wurde, ins Arduino Fenster. I.Dezember