Presentation is loading. Please wait.

Presentation is loading. Please wait.

“Processing” easy coding Jens Dalsgaard Nielsen

Similar presentations


Presentation on theme: "“Processing” easy coding Jens Dalsgaard Nielsen"— Presentation transcript:

1 “Processing” easy coding Jens Dalsgaard Nielsen
Section of Automation & Control Student Sat Lab Aalborg University – Denmark

2 Purpose Need an easy way to do some nice programming GUI – facilities
External link (to arduino or othe system with “serial” communication) No need for 5 years CS education :-) Up and running i 5 minuttes Nice with experience from an imperative language C, pascal, C++, java,... You need a computer Mac, windows, linux – dosnt matter – multiplatform environment :-)

3 Many many many solutions
Glade, python, .net, gtk, visual-*, Qt, tcl/tk,... None of them so easy to use for what we are heading for Easy level Medium level Adv level depending on you

4 A solution ?!?! Similar to Arduino
No religious discussions - support mac, win, linux Used by many ~= lot to be found out in the world Free

5 Your problem Learning by “doing” - all/some people to the keys
Do a (simple) design so you can do a living system A suggestion for a plan for the people who want to ... Short intro for Processing (the language/environment) Install of Processing environment Read and getting first small sketches up and running

6 First Who has coding experience (imperative coding) ???

7 ??? C ? C++ ? C# ? Java ? Python ? Matlab ? Tk/tcl ? Machine coding

8 Arduino C /C++ Processing Java, simple java

9 Material www.control.aau.dk/~jdn/edu/courses/11-2/best11
Processing.org processing.org/reference/libraries/ Processing IDE !!

10 Modes of coding in processing
Basic This mode is used drawing static images and learning fundamentals of programming. Simple lines of code have a direct representation on the screen. The following example draws a yellow rectangle on the screen: size(200, 200); background(255); noStroke(); fill(255, 204, 0); rect(30, 20, 50, 50);

11 Continuous This mode provides a setup() structure that is run once when the program begins and a draw() structure which by default continually loops through the code inside. This additional structure allows writing custom functions and classes and using keyboard and mouse events. void setup() { size(200, 200); noStroke(); background(255); fill(0, 102, 153, 204); smooth(); noLoop(); } void draw() { circles(40, 80); circles(90, 70); void circles(int x, int y) { ellipse(x, y, 50, 50); ellipse(x+20, y+20, 60, 60);

12 Java This mode is the most flexible, allowing complete Java programs to be written from inside the Processing Environment (as long as they're still subclasses of PApplet). This mode is for advanced users only and is not really recommended. Using this mode means that any additional tabs will no longer be inner classes, meaning that you'll have to do extra work to make them communicate properly with the host PApplet. It is not necessary to use this mode just to get features of the Java language. public class MyDemo extends PApplet { void setup() { size(200, 200); rectMode(CENTER); noStroke(); fill(0, 102, 153, 204); } void draw() { background(255); rect(width-mouseX, height-mouseY, 50, 50); rect(mouseX, mouseY, 50, 50);

13 Processing and GUI: controlP5
Easy to use library Radio buttons, rulers,...

14 Let's get it done

15


Download ppt "“Processing” easy coding Jens Dalsgaard Nielsen"

Similar presentations


Ads by Google