Sten-SLATE ESP. Graphical Interface

Size: px
Start display at page:

Download "Sten-SLATE ESP. Graphical Interface"

Transcription

1 Sten-SLATE ESP Graphical Interface Stensat Group LLC, Copyright

2 References 2

3 Graphical Interface In this section, you will learn how to build a simple graphical user interface. Keep the circuit and arduino code as is. It will be used in this section. Two buttons will be created to control the two LEDs. A new prorgram will be created in Processing. Open a new window in Processing. 3

4 Importing Libraries Start the Processing software. Click on the Sketch menu and select the Import Library import processing.network.*; Select the network library. The import command will appear at the top of the editor. This tells the compiler to include the library of functions to support network operations. This library will be used to access the processor over wifi. 4

5 Setting up a TCP Port The next step is to create a network object that will provide access to the wifi. The variables button1_pressed and button2_pressed are created. These will be used to indicate that the button was already pressed. The draw() function is executed repeatedly so the checks for the buttons being pressed will be true and the commands will be sent repeatedly. import processing.network.*; Client c; int button1_pressed,button2_pressed; 5

6 setup() In the setup() function, the network object is configured to talk to the robot at the IP address of using port 80. A window of 800 by 600 pixels is also created. The variables are set to zero to indicate the buttons are not pressed. import processing.network.*; Client c; int button1_pressed,button2_pressed; void setup() { size(800,600); c = new Client(this, ,80); button1_pressed = 0; button2_pressed = 0; This completes the setup() portion of the code. Next is the draw() function. 6

7 setup() A label will be created for each button. To prepare for the text, the function textalign() tells the program to center the text around the coordinates specified in the text() function otherwise the text will start at the coordinates and be shifted to the right. textsize() sets the font size. import processing.network.*; Client c; int button1_pressed,button2_pressed; void setup() { size(800,600); c = new Client(this, ,80); button1_pressed = 0; button2_pressed = 0; textalign(center); textsize(18); 7

8 Rendering the Buttons The draw() function does all the work. First, the window is cleared with the background() function and the buttons are rendered in their proper state. If a button is not pressed, it is gray. If the button is pressed, it is the color of the LED. void draw() { background(0); // black window if(button1_pressed == 0) fill(200); // set button gray else fill(100,0,0); rect(100,100,100,100,10); if(button2_pressed == 0) fill(200); else fill(0,100,0); rect(250,100,100,100,10); 8

9 Rendering the Buttons The text is rendered after the buttons are created. The order of operation is important. Any graphic created will be rendered on top of previous graphics. The text is rendered on top of the rectangles so the text() function needs to come after the rect() function. void draw() { background(0); // black window if(button1_pressed == 0) fill(200); // set button gray else fill(100,0,0); rect(100,100,100,100,10); if(button2_pressed == 0) fill(200); else fill(0,100,0); rect(250,100,100,100,10); fill(0); text( GREEN,300,155); text( RED,150,155); fill(0) sets the color of the text to black. The text() function renders the text at the specified coordinates. 9

10 User Interaction After rendering the buttons, it is time to check on the state of the buttons. The first check is if the mouse button is pressed. If true, the variable mousepressed will not be zero. void draw() { background(0); // black window if(button1_pressed == 0) fill(200); // set button gray else fill(100,0,0); rect(100,100,100,100,10); if(button2_pressed == 0) fill(200); else fill(0,100,0); rect(250,100,100,100,10); fill(0); text( GREEN,300,155); text( RED,150,155); if(mousepressed) { if((mousex > 100) && (mousex < 200)) { if((mousey > 100) && (mousey < 200)) { if(button1_pressed == 0) { c.write( F ); button1_pressed = 1; 10

11 User Interaction To determine which button if any is pressed, a simple boundary check of where the mouse position is in relation to the rectangles used for buttons is performed. First the x dimension is checked. Notice the &&. This means AND. This requires both comparisons to be true for the if() statement to be true. void draw() { background(0); // black window if(button1_pressed == 0) fill(200); // set button gray else fill(100,0,0); rect(100,100,100,100,10); if(button2_pressed == 0) fill(200); else fill(0,100,0); rect(250,100,100,100,10); fill(0); text( GREEN,300,155); text( RED,150,155); if(mousepressed) { if((mousex > 100) && (mousex < 200)) { if((mousey > 100) && (mousey < 200)) { if(button1_pressed == 0) { c.write( F ); button1_pressed = 1; 11

12 User Interaction Next, the button1_pressed variable is checked to see if it has been changed from zero. If it is zero, the command to turn on the red LED is sent and the variable is changed to 1. This is done so that next time draw() is executed and the button is still pressed, the command will not be sent again. void draw() { background(0); // black window if(button1_pressed == 0) fill(200); // set button gray else fill(100,0,0); rect(100,100,100,100,10); if(button2_pressed == 0) fill(200); else fill(0,100,0); rect(250,100,100,100,10); fill(0); text( GREEN,300,155); text( RED,150,155); if(mousepressed) { if((mousex > 100) && (mousex < 200)) { if((mousey > 100) && (mousey < 200)) { if(button1_pressed == 0) { c.write( F ); button1_pressed = 1; 12

13 User Interaction The second button is checked and processed like the first button. Only the X position is different and of course a different command is sent. rect(250,100,100,100,10); fill(0); text( GREEN,300,155); text( RED,150,155); if(mousepressed) { if((mousex > 100) && (mousex < 200)) { if((mousey > 100) && (mousey < 200)) { if(button1_pressed == 0) { c.write( F ); button1_pressed = 1; if((mousex > 250) && (mousex < 350)) { if((mousey > 100) && (mousey < 200)) { if(button2_pressed == 0) { c.write( L ); button2_pressed = 1; 13

14 User Interaction Now when the mouse button is not pressed, any buttons on the screen that was clicked on needs to be changed to the unpressed state. Variable button1_pressed is checked to see if it was a pressed button. The command to turn the LED off is sent and the variable is reset. Same thing happens to the second button. if((mousex > 250) && (mousex < 350)) { if((mousey > 100) && (mousey < 100)) { if(button2_pressed == 0) { c.write( L ); button2_pressed = 1; else { if(button1_pressed == 1) { c.write( B ); button1_pressed = 0; if(button2_pressed == 1) { c.write( S ); button2_pressed = 0; 14

15 Test Add a third LED to the processor board and update its software to accept commands to turn it on and off. Modify the processing program to add a third button to turn the third LED on and off. 15

Building a GUI From Scratch

Building a GUI From Scratch Building a GUI From Scratch 1 Processing Graphical User Interface In this lesson, you will learn how to create some simple GUI objects to control the robot. The GUI objects will be sliders and a joystick.

More information

Sten-SLATE ESP. WiFi

Sten-SLATE ESP. WiFi Sten-SLATE ESP WiFi Stensat Group LLC, Copyright 2016 1 References www.arduino.cc http://esp8266.github.io/arduino/versions/2.1.0/doc/reference.html 2 Introduction The wifi integrated in the processor

More information

CISC 1600, Lab 2.2: Interactivity in Processing

CISC 1600, Lab 2.2: Interactivity in Processing CISC 1600, Lab 2.2: Interactivity in Processing Prof Michael Mandel 1 Getting set up For this lab, we will again be using Sketchpad, a site for building processing sketches online using processing.js.

More information

CISC 1600, Lab 3.2: Interactivity in Processing

CISC 1600, Lab 3.2: Interactivity in Processing CISC 1600, Lab 3.2: Interactivity in Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1.

More information

Parts List. XBEE/Wifi Adapter board 4 standoffs ¼ inch screws Cable XBEE module or Wifi module

Parts List. XBEE/Wifi Adapter board 4 standoffs ¼ inch screws Cable XBEE module or Wifi module Rover Wifi Module 1 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the Sten-Bot kit against component

More information

Introduction to Processing

Introduction to Processing Processing Introduction to Processing Processing is a programming environment that makes writing programs easier. It contains libraries and functions that make interacting with the program simple. The

More information

Parts List. XBEE/Wifi Adapter board 4 standoffs ¼ inch screws Cable XBEE module or Wifi module

Parts List. XBEE/Wifi Adapter board 4 standoffs ¼ inch screws Cable XBEE module or Wifi module Rover Wifi Module 1 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the Sten-Bot kit against component

More information

Interaction Design A.A. 2017/2018

Interaction Design A.A. 2017/2018 Corso di Laurea Magistrale in Design, Comunicazione Visiva e Multimediale - Sapienza Università di Roma Interaction Design A.A. 2017/2018 7 Conditionals in Processing Francesco Leotta, Andrea Marrella

More information

Conditional Events. Mouse events and Operators. Dr. Siobhán Drohan Mairead Meagher. Produced by:

Conditional Events. Mouse events and Operators. Dr. Siobhán Drohan Mairead Meagher. Produced by: Conditional Events Mouse events and Operators Produced by: Dr. Siobhán Drohan Mairead Meagher Department of Computing and Mathematics http://www.wit.ie/ Topics list Mouse Events Recap: Arithmetic Operators

More information

Using Methods. Methods that handle events. Mairead Meagher Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Using Methods. Methods that handle events. Mairead Meagher Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics Using Methods Methods that handle events Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Caveat The term function is used in Processing e.g. line(),

More information

CISC 1600 Lecture 2.2 Interactivity&animation in Processing

CISC 1600 Lecture 2.2 Interactivity&animation in Processing CISC 1600 Lecture 2.2 Interactivity&animation in Processing Topics: Interactivity: keyboard and mouse variables Interactivity: keyboard and mouse listeners Animation: vector graphics Animation: bitmap

More information

CISC 1600 Lecture 2.2 Interactivity&animation in Processing

CISC 1600 Lecture 2.2 Interactivity&animation in Processing CISC 1600 Lecture 2.2 Interactivity&animation in Processing Topics: Interactivity: keyboard and mouse variables Interactivity: keyboard and mouse listeners Animation: vector graphics Animation: bitmap

More information

CISC 1600, Lab 3.1: Processing

CISC 1600, Lab 3.1: Processing CISC 1600, Lab 3.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using OpenProcessing, a site for building processing sketches online using processing.js. 1.1. Go to https://www.openprocessing.org/class/57767/

More information

CISC 1600, Lab 2.1: Processing

CISC 1600, Lab 2.1: Processing CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc

More information

mith College Computer Science CSC103 How Computers Work Week 6 Fall 2017 Dominique Thiébaut

mith College Computer Science CSC103 How Computers Work Week 6 Fall 2017 Dominique Thiébaut mith College Computer Science CSC103 How Computers Work Week 6 Fall 2017 Dominique Thiébaut dthiebaut@smith.edu Ben Fry on Processing... http://www.youtube.com/watch?&v=z-g-cwdnudu An Example Mouse 2D

More information

Exploring Processing

Exploring Processing Exploring Processing What is Processing? Easy-to-use programming environment Let s you edit, run, save, share all in one application Designed to support interactive, visual applications Something we ve

More information

The way I feel about music is that there is no right and wrong. Only true and false. Fiona Apple. true false false

The way I feel about music is that there is no right and wrong. Only true and false. Fiona Apple. true false false 5 Conditionals Conditionals 59 That language is an instrument of human reason, and not merely a medium for the expression of thought, is a truth generally admitted. George Boole The way I feel about music

More information

Real Time Data Plotting

Real Time Data Plotting Real Time Data Plotting Introduction This lesson will show how to write a program plot data on a X-Y graph. On the Arduino, write a program to sample a sensor and print the voltage to the Serial interface.

More information

Variables and Control Structures. CS 110 Eric Eaton

Variables and Control Structures. CS 110 Eric Eaton Variables and Control Structures CS 110 Eric Eaton Review Random numbers mousex, mousey setup() & draw() framerate(), loop(), noloop() Mouse and Keyboard interaccon Arcs, curves, bézier curves, custom

More information

Sten-SLATE ESP Kit. Description and Programming

Sten-SLATE ESP Kit. Description and Programming Sten-SLATE ESP Kit Description and Programming Stensat Group LLC, Copyright 2016 Overview In this section, you will be introduced to the processor board electronics and the arduino software. At the end

More information

Introduction to Processing. Sally Kong

Introduction to Processing. Sally Kong Introduction to Processing Sally Kong - Open Source Platform - Geared toward creating visual, interactive media - Created by Ben Fry and Casey Reas Basic Setup void setup() { size(800, 600); background(255);

More information

Methods (cont.) Chapter 7

Methods (cont.) Chapter 7 Methods (cont.) Chapter 7 Defining Simple Methods ReturnType Iden&fier ( ParameterList ) { Body ReturnType is the type of value returned from the method/funcbon. IdenBfier is the name of the method/funcbon.

More information

GRAPHICS PROGRAMMING. LAB #3 Starting a Simple Vector Animation

GRAPHICS PROGRAMMING. LAB #3 Starting a Simple Vector Animation GRAPHICS PROGRAMMING LAB #3 Starting a Simple Vector Animation Introduction: In previous classes we have talked about the difference between vector and bitmap images and vector and bitmap animations. In

More information

Kimberly Nguyen Professor Oliehoek Introduction to Programming 8 September 2013

Kimberly Nguyen Professor Oliehoek Introduction to Programming 8 September 2013 1. A first program // Create 200x200 canvas // Print favorite quote size(200, 200); println("it is what it is"); // Draw rectangle and a line rect(100,100,50,50); line(0,0,50,50); // Save as.pde. Can be

More information

Basic Computer Programming (Processing)

Basic Computer Programming (Processing) Contents 1. Basic Concepts (Page 2) 2. Processing (Page 2) 3. Statements and Comments (Page 6) 4. Variables (Page 7) 5. Setup and Draw (Page 8) 6. Data Types (Page 9) 7. Mouse Function (Page 10) 8. Keyboard

More information

Pick a number. Conditionals. Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary. CS Conditionals 1

Pick a number. Conditionals. Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary. CS Conditionals 1 Conditionals Boolean Logic Relational Expressions Logical Operators Numerical Representation Binary CS105 04 Conditionals 1 Pick a number CS105 04 Conditionals 2 Boolean Expressions An expression that

More information

mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut

mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut mith College Computer Science CSC103 How Computers Work Week 7 Fall 2017 Dominique Thiébaut dthiebaut@smith.edu Important Review Does the animation leave a trace? Are the moving objects move without a

More information

1 Getting started with Processing

1 Getting started with Processing cisc3665, fall 2011, lab I.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 1600 Lecture 3.1 Introduction to Processing CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists

More information

What can we do with Processing? Let s check. Natural Language and Dialogue Systems Lab Guest Image. Remember how colors work.

What can we do with Processing? Let s check. Natural Language and Dialogue Systems Lab Guest Image. Remember how colors work. MIDTERM REVIEW: THURSDAY I KNOW WHAT I WANT TO REVIEW. BUT ALSO I WOULD LIKE YOU TO TELL ME WHAT YOU MOST NEED TO GO OVER FOR MIDTERM. BY EMAIL AFTER TODAY S CLASS. What can we do with Processing? Let

More information

Basic Input and Output

Basic Input and Output Basic Input and Output CSE 120 Spring 2017 Instructor: Justin Hsia Teaching Assistants: Anupam Gupta, Braydon Hall, Eugene Oh, Savanna Yee Administrivia Assignments: Animal Functions due today (4/12) Reading

More information

CST112 Looping Statements Page 1

CST112 Looping Statements Page 1 CST112 Looping Statements Page 1 1 2 3 4 5 Processing: Looping Statements CST112 Algorithms Procedure for solving problem: 1. Actions to be executed 2. Order in which actions are executed order of elements

More information

Computer Graphics. Interaction

Computer Graphics. Interaction Computer Graphics Interaction Jordi Linares i Pellicer Escola Politècnica Superior d Alcoi Dep. de Sistemes Informàtics i Computació jlinares@dsic.upv.es http://www.dsic.upv.es/~jlinares processing allows

More information

A B C D CS105 03a Interaction

A B C D CS105 03a Interaction Interaction Function Definition Events Built-in Variables CS105 03a Interaction 1 Which image is drawn by this code? strokeweight(10); stroke(0, 255, 0); // green line(99, 0, 0, 99); stroke(200, 0, 200);

More information

Sten-SLATE ESP. Simple Web Server

Sten-SLATE ESP. Simple Web Server Sten-SLATE ESP Simple Web Server Stensat Group LLC, Copyright 2018 1 References www.arduino.cc https://github.com/esp8266/arduino 2 System Design A web server uses the client/server software model. The

More information

[ the academy_of_code] Senior Beginners

[ the academy_of_code] Senior Beginners [ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell

More information

Advanced Activities - Information and Ideas

Advanced Activities - Information and Ideas Advanced Activities - Information and Ideas Congratulations! You successfully created and controlled the robotic chameleon using the program developed for the chameleon project. Here you'll learn how you

More information

Module 01 Processing Recap. CS 106 Winter 2018

Module 01 Processing Recap. CS 106 Winter 2018 Module 01 Processing Recap CS 106 Winter 2018 Processing is a language a library an environment Variables A variable is a named value. It has a type (which can t change) and a current value (which can

More information

University of Cincinnati. P5.JS: Getting Started. p5.js

University of Cincinnati. P5.JS: Getting Started. p5.js p5.js P5.JS: Getting Started Matthew Wizinsky University of Cincinnati School of Design HTML + CSS + P5.js File Handling & Management Environment Canvas Coordinates Syntax Drawing Variables Mouse Position

More information

Basic Input and Output

Basic Input and Output Basic Input and Output CSE 120 Spring 2017 Instructor: Justin Hsia Teaching Assistants: Anupam Gupta, Braydon Hall, Eugene Oh, Savanna Yee How airlines like United choose who to kick off a flight On Sunday

More information

The Processing language

The Processing language The Processing language Developed by Ben Fry and Casey Reas at MIT in 2001 Related to the languages Logo and Java Free, open-source software processing.org contains many programming resources www.openprocessing.org

More information

Watch the following for more announcements

Watch the following for more announcements Review "plain text file" loadstrings() split() splittokens() selectinput() println(), float(), int(), can take an array argument, will return an array easy way to convert an array of Strings to an array

More information

Connecting Arduino to Processing

Connecting Arduino to Processing Connecting Arduino to Processing Introduction to Processing So, you ve blinked some LEDs with Arduino, and maybe you ve even drawn some pretty pictures with Processing - what s next? At this point you

More information

Basic Input and Output

Basic Input and Output Basic Input and Output CSE 120 Winter 2019 Instructor: Teaching Assistants: Justin Hsia Ann Shan, Eunia Lee, Pei Lee Yap, Sam Wolfson, Travis McGaha Facebook to integrate WhatsApp, Instagram and Messenger

More information

Final Exam Winter 2013

Final Exam Winter 2013 Final Exam Winter 2013 1. Which modification to the following program makes it so that the display shows just a single circle at the location of the mouse. The circle should move to follow the mouse but

More information

Bits and Bytes. How do computers compute?

Bits and Bytes. How do computers compute? Bits and Bytes How do computers compute? Representing Data All data can be represented with: 1s and 0s on/of true/false Numbers? Five volunteers... Binary Numbers Positional Notation Binary numbers use

More information

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018 StenBOT Robot Kit 1 Stensat Group LLC, Copyright 2018 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a 90 day warranty for the

More information

CMPT-166: Sample Midterm

CMPT-166: Sample Midterm CMPT 166, Fall 2016, Surrey Sample Midterm 1 Page 1 of 11 CMPT-166: Sample Midterm Last name exactly as it appears on your student card First name exactly as it appears on your student card Student Number

More information

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca COMP 1010- Summer 2015 (A01) Jim (James) Young young@cs.umanitoba.ca jimyoung.ca final float MAX_SPEED = 10; final float BALL_SIZE = 5; void setup() { size(500, 500); void draw() { stroke(255); fill(255);

More information

Module 05 User Interfaces. CS 106 Winter 2018

Module 05 User Interfaces. CS 106 Winter 2018 Module 05 User Interfaces CS 106 Winter 2018 UI is a big topic GBDA 103: User Experience Design UI is a big topic GBDA 103: User Experience Design CS 349: User Interfaces CS 449: Human-Computer Interaction

More information

Basic Input and Output

Basic Input and Output Basic Input and Output CSE 120 Winter 2018 Instructor: Teaching Assistants: Justin Hsia Anupam Gupta, Cheng Ni, Eugene Oh, Sam Wolfson, Sophie Tian, Teagan Horkan How the Facebook algorithm update will

More information

Question 1 (10 points) Write the correct answer in each of the following: a) Write a Processing command to create a canvas of 400x300 pixels:

Question 1 (10 points) Write the correct answer in each of the following: a) Write a Processing command to create a canvas of 400x300 pixels: Question 1 (10 points) Write the correct answer in each of the following: a) Write a Processing command to create a canvas of 400x300 pixels: size(400, 300); b) After the above command is carried out,

More information

The Processing language. Arduino and Processing.

The Processing language. Arduino and Processing. IAT267 Introduc/on to Technological Systems Lecture 8 The Processing language. Arduino and Processing. 1 Course Project All teams submibed very interes/ng proposals One requirement for the project is to

More information

if / if else statements

if / if else statements if / if else statements December 1 2 3 4 5 Go over if notes and samples 8 9 10 11 12 Conditionals Quiz Conditionals TEST 15 16 17 18 19 1 7:30 8:21 2 8:27 9:18 3 9:24 10:14 1 CLASS 7:30 8:18 1 FINAL 8:24

More information

cs6964 March TOOLKITS Miriah Meyer University of Utah

cs6964 March TOOLKITS Miriah Meyer University of Utah cs6964 March 8 2012 TOOLKITS Miriah Meyer University of Utah administrivia 2 feb 14-23 : proposal meetings march 7 : presentation topics due march 9 : proposals due march 27-april 3 : project updates april

More information

Name CMPS 5J Final March 17, 2010 This is a closed notes, closed book exam. Each problem is worth 1 point unless indicated otherwise.

Name CMPS 5J Final March 17, 2010 This is a closed notes, closed book exam. Each problem is worth 1 point unless indicated otherwise. Name CMPS 5J Final March 17, 2010 This is a closed notes, closed book exam. Each problem is worth 1 point unless indicated otherwise. There are 21 problems and 25 points total. There are multiple versions

More information

Recall that creating or declaring a variable can be done as follows:

Recall that creating or declaring a variable can be done as follows: Lesson 2: & Conditionals Recall that creating or declaring a variable can be done as follows:! float radius = 20;! int counter = 5;! string name = Mr. Nickel ;! boolean ispressed = true;! char grade =

More information

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created. + Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create

More information

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca COMP 1010- Summer 2015 (A01) Jim (James) Young young@cs.umanitoba.ca jimyoung.ca Don t use == for floats!! Floating point numbers are approximations. How they are stored inside the computer means that

More information

Chapter 12: Functions Returning Booleans and Collision Detection

Chapter 12: Functions Returning Booleans and Collision Detection Processing Notes Chapter 12: Functions Returning Booleans and Collision Detection So far we have not done much with booleans explicitly. Again, a boolean is a variable or expression that takes on exactly

More information

We will start our journey into Processing with creating static images using commands available in Processing:

We will start our journey into Processing with creating static images using commands available in Processing: Processing Notes Chapter 1: Starting Out We will start our journey into Processing with creating static images using commands available in Processing: rect( ) line ( ) ellipse() triangle() NOTE: to find

More information

Arduino for ODROID-GO - Hello World

Arduino for ODROID-GO - Hello World 2018/12/16 09:56 1/6 Arduino for ODROID-GO - Hello World Arduino for ODROID-GO - Hello World Make sure that you've followed the Arduino setup guide. You will write code to display Hello, ODROID-GO on your

More information

CS110 Introduction to Computing Fall 2016 Practice Exam 1

CS110 Introduction to Computing Fall 2016 Practice Exam 1 CS110 Introduction to Computing Fall 2016 Practice Exam 1 The exam will be closed-note and closed-book; please consider this fact before using your notes on this practice version. Please see the abbreviated

More information

CSE120 Wi18 Final Review

CSE120 Wi18 Final Review CSE120 Wi18 Final Review Practice Question Solutions 1. True or false? Looping is necessary for complex programs. Briefly explain. False. Many loops can be explicitly written out as individual statements

More information

5.1. Examples: Going beyond Sequence

5.1. Examples: Going beyond Sequence Chapter 5. Selection In Chapter 1 we saw that algorithms deploy sequence, selection and repetition statements in combination to specify computations. Since that time, however, the computations that we

More information

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino University of Portland EE 271 Electrical Circuits Laboratory Experiment: Arduino I. Objective The objective of this experiment is to learn how to use the Arduino microcontroller to monitor switches and

More information

What is a variable? a named location in the computer s memory. mousex mousey. width height. fontcolor. username

What is a variable? a named location in the computer s memory. mousex mousey. width height. fontcolor. username What is a variable? a named location in the computer s memory mousex mousey width height fontcolor username Variables store/remember values can be changed must be declared to store a particular kind of

More information

Windows and Events. created originally by Brian Bailey

Windows and Events. created originally by Brian Bailey Windows and Events created originally by Brian Bailey Announcements Review next time Midterm next Friday UI Architecture Applications UI Builders and Runtimes Frameworks Toolkits Windowing System Operating

More information

All program statements you write should be syntactically correct. Partial credit is not guaranteed with incorrect use of syntax.

All program statements you write should be syntactically correct. Partial credit is not guaranteed with incorrect use of syntax. With Solutions in Red CS110 Introduction to Computing Fall 2012 Section 2 Exam 1 This is an open notes exam. Computers are not permitted. Your work on this exam must be your own. Answer all questions in

More information

Class Notes CN19 Class PImage Page

Class Notes CN19 Class PImage Page 1 Images and the Graphics Window Prior to beginning the work with different parts of the libraries, we spent time with classes. One reason for that was to provide some background when we started this part

More information

CS 101 Functions. Lecture 15

CS 101 Functions. Lecture 15 CS 101 Functions Lecture 15 1 Key Processing language features so-far Basic color/shapes drawing Variables For-loops If-statements 2 Functions In the next few days, we ll be talking about Functions A Function

More information

CS 101 Media (Images, Video, etc) Lecture 20

CS 101 Media (Images, Video, etc) Lecture 20 CS 101 Media (Images, Video, etc) Lecture 20 1 Images Though we ve displayed many shapes and colors to the screen, we have yet to display an actual image! Processing has a special type called PImage, for

More information

CS110 Introduction to Computing Fall 2016 Practice Exam 1 -- Solutions

CS110 Introduction to Computing Fall 2016 Practice Exam 1 -- Solutions CS110 Introduction to Computing Fall 2016 Practice Exam 1 -- Solutions The exam will be closed-note and closed-book; please consider this fact before using your notes on this practice version. Please see

More information

void setup() { void draw() { draw a rectangle or ellipse wherever the mouse cursor is }

void setup() { void draw() { draw a rectangle or ellipse wherever the mouse cursor is } void setup() size(600,600); background(230); smooth(); //set window size //set window background color //for smooth lines void draw() draw a rectangle or ellipse wherever the mouse cursor is void setup()

More information

Interaction Design A.A. 2017/2018

Interaction Design A.A. 2017/2018 Corso di Laurea Magistrale in Design, Comunicazione Visiva e Multimediale - Sapienza Università di Roma Interaction Design A.A. 2017/2018 5 Basics of Processing Francesco Leotta, Andrea Marrella Last update

More information

Repetition is the reality and the seriousness of life. Soren Kierkegaard

Repetition is the reality and the seriousness of life. Soren Kierkegaard 6 Loops Loops 81 Repetition is the reality and the seriousness of life. Soren Kierkegaard What s the key to comedy? Repetition. What s the key to comedy? Repetition. Anonymous In this chapter: The concept

More information

Sten-SLATE ESP. Accelerometer and I2C Bus

Sten-SLATE ESP. Accelerometer and I2C Bus Sten-SLATE ESP Accelerometer and I2C Bus Stensat Group LLC, Copyright 2016 I2C Bus I2C stands for Inter-Integrated Circuit. It is a serial type interface requiring only two signals, a clock signal and

More information

Module 01 Processing Recap

Module 01 Processing Recap Module 01 Processing Recap Processing is a language a library an environment Variables A variable is a named value. It has a type (which can t change) and a current value (which can change). Variables

More information

What is a variable? A named locajon in the computer s memory. A variable stores values

What is a variable? A named locajon in the computer s memory. A variable stores values Chapter 4 Summary/review coordinate system basic drawing commands and their parameters (rect, line, ellipse,background, stroke, fill) color model - RGB + alpha Processing IDE - entering/saving/running

More information

Touch Board User Guide. Introduction

Touch Board User Guide. Introduction Touch Board User Guide Introduction The Crazy Circuits Touch Board is a fun way to create interactive projects. The Touch Board has 11 built in Touch Points for use with projects and also features built

More information

Variables One More (but not the last) Time with feeling

Variables One More (but not the last) Time with feeling 1 One More (but not the last) Time with feeling All variables have the following in common: a name a type ( int, float, ) a value an owner We can describe variables in terms of: who owns them ( Processing

More information

Getting Started with Processing by Casey Reas and Ben Fry

Getting Started with Processing by Casey Reas and Ben Fry Free Sampler Getting Started with Processing by Casey Reas and Ben Fry Copyright 2010 Casey Reas and Ben Fry. All rights reserved. Printed in the United States of America. Published by O Reilly Media,

More information

(Inter)Ac*ve Scripts. Sta*c Program Structure 1/26/15. Crea+ve Coding & Genera+ve Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar

(Inter)Ac*ve Scripts. Sta*c Program Structure 1/26/15. Crea+ve Coding & Genera+ve Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar (Inter)Ac*ve Scripts Crea+ve Coding & Genera+ve Art in Processing 2 Ira Greenberg, Dianna Xu, Deepak Kumar Slides revised by Michael Goldwasser Sta*c Program Structure // Create and set canvas size(width,

More information

EP486 Microcontroller Applications

EP486 Microcontroller Applications EP486 Microcontroller Applications Topic 2 Processing Department of Engineering Physics University of Gaziantep Sep 2013 Sayfa 1 Processing is a programming language, development environment, and online

More information

PROJECT FINAL: WEARABLE

PROJECT FINAL: WEARABLE PROJECT FINAL: WEARABLE David Snow Wearable Computing Jackson McConnell Dec/09/2014 DEVICE: iris Project iris is a device that gamifies the experience of your daily drive. This is a device for all those

More information

CS 106A, Lecture 14 Events and Instance Variables

CS 106A, Lecture 14 Events and Instance Variables CS 106A, Lecture 14 Events and Instance Variables Reading: Art & Science of Java, Ch. 10.1-10.4 This document is copyright (C) Stanford Computer Science and Marty Stepp, licensed under Creative Commons

More information

Processing Assignment Write- Ups

Processing Assignment Write- Ups Processing Assignment Write- Ups Exercise 1-1 Processing is not an elaborate series of points like connect the dots or is it? Can t be cause I got it all wrong when I mapped out each and every point that

More information

Sten-SLATE ESP. Introduction and Assembly

Sten-SLATE ESP. Introduction and Assembly Sten-SLATE ESP Introduction and Assembly Stensat Group LLC, Copyright 2016 Legal Stuff Stensat Group LLC assumes no responsibility and/or liability for the use of the kit and documentation. There is a

More information

void mouseclicked() { // Called when the mouse is pressed and released // at the same mouse position }

void mouseclicked() { // Called when the mouse is pressed and released // at the same mouse position } Review Commenting your code Random numbers and printing messages mousex, mousey void setup() & void draw() framerate(), loop(), noloop() Arcs, curves, bézier curves, beginshape/endshape Example Sketches

More information

Procedure: Determine the polarity of the LED. Use the following image to help:

Procedure: Determine the polarity of the LED. Use the following image to help: Section 2: Lab Activity Section 2.1 Getting started: LED Blink Purpose: To understand how to upload a program to the Arduino and to understand the function of each line of code in a simple program. This

More information

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca COMP 1010- Summer 2015 (A01) Jim (James) Young young@cs.umanitoba.ca jimyoung.ca order of operations with the explicit cast! int integervariable = (int)0.5*3.0; Casts happen first! the cast converts the

More information

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM

CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM CS 201 Advanced Object-Oriented Programming Lab 10 - Recursion Due: April 21/22, 11:30 PM Introduction to the Assignment In this assignment, you will get practice with recursion. There are three parts

More information

CS 106 Winter Lab 03: Input and Output

CS 106 Winter Lab 03: Input and Output CS 106 Winter 2019 Lab 03: Input and Output Due: Wednesday, January 23th, 11:59pm Summary This lab will allow you to practice input and output. Each question is on a separate page. SAVE each sketch as

More information

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

CSC 220 Object-Oriented Multimedia Programming, Spring 2017

CSC 220 Object-Oriented Multimedia Programming, Spring 2017 CSC 220 Object-Oriented Multimedia Programming, Spring 2017 Dr. Dale E. Parson, Assignment 2, Working with 3D shapes and geometric transforms. This assignment is due via D2L Dropbox Assignment 2 ShapePaint3DIntro

More information

Processing. Data Visualization Programming Language. By Rutvi Joshi. Processing Visualization Language- By Rutvi Joshi

Processing. Data Visualization Programming Language. By Rutvi Joshi. Processing Visualization Language- By Rutvi Joshi Processing Data Visualization Programming Language What is Processing? A Graphical Sketch Book and Environment, to graphically teach the fundamentals of computer science But it has evolved into a tool

More information

CS 106A, Lecture 14 Events and Instance Variables

CS 106A, Lecture 14 Events and Instance Variables CS 106A, Lecture 14 Events and Instance Variables Reading: Art & Science of Java, Ch. 10.1-10.4 This document is copyright (C) Stanford Computer Science and Marty Stepp, licensed under Creative Commons

More information

Event-driven Programming: GUIs

Event-driven Programming: GUIs Dr. Sarah Abraham University of Texas at Austin Computer Science Department Event-driven Programming: GUIs Elements of Graphics CS324e Spring 2018 Event-driven Programming Programming model where code

More information

Interaction Design A.A. 2017/2018

Interaction Design A.A. 2017/2018 Corso di Laurea Magistrale in Design, Comunicazione Visiva e Multimediale - Sapienza Università di Roma Interaction Design A.A. 2017/2018 10 Advanced in Processing Francesco Leotta, Andrea Marrella Last

More information

PROGRAMMING. We create identity

PROGRAMMING. We create identity 2 PROGRAMMING We create identity TOPICS COVERED Getting Started Setup and draw Variables mousex, mousey other system variables variable declaration types Arithmetic Predefined methods abs, max, delay Topics

More information