ROBOTC Basic Programming

Size: px
Start display at page:

Download "ROBOTC Basic Programming"

Transcription

1 ROBOTC Basic Programming

2 Open ROBOTC and create a new file

3 Check Compiler Target If you plan to download code to a robot, select the Physical Robot opbon. If you plan to download code to a virtual robot, select the Virtual Worlds opbon.

4 Check PlaGorm Type Choose which type of robobcs you will be programming for. Vex IQ Vex 2.0 Cortex

5 UpdaBng Firmware If this is the first Bme using a new Cortex, you may want to make sure the firmware is up to date (this can also solve random connecbvity issues). To do this, connect the Cortex to the computer using a USB A- A cable then select the appropriate opbon from the robot menu (see right). This will need to be done for the Cortex and primary joysbck.

6 Programming Rules/Syntax Code is the text writen for the program. It is instrucbons for what the robot will do. The programming language we will be using is RobotC. Syntax is an important part of wribng code punctua'on and capitaliza'on ma/er! White space (spaces in- between lines) can be added for organizabonal purposes without affecbng the code.

7 Sample RobotC Code Block Let s take a closer look at capitalizabon.

8 NoBce that task main is in lowercase. If it were capitalized, RobotC wouldn t recognize it! By convenbon, motors, variables, etc. are writen in camel case the first word is lowercase and Now the first we leter will of all take words a following closer are look uppercase, at the with syntax. no spaces. It is important to be consistent with capitalizabon.

9 Curly braces {} Surround commands in a control structure (task main, condibonals, loops). Control structure: task main directs to main body contains the code that runs. Parentheses () Follow calling a funcbon. Can be empty or contain an input for the funcbon. Also contain parameters for condibonals and loops (more on this later). Semicolon ; Marks the end of a statement. Double slash // Marks a line as a comment, or text that is not part of the code. Square brackets [] indicate which motor is used in a motor command.

10 Functions A funcbon is a block of statements that are run together when the funcbon is called in the task main(). Can be used for movements and behaviors that are used frequently, like moving forward or turning. What are some funcbons you would want a robot to be able to do?

11 FuncBons are created or declared outside of the task main() and then can be called in the task main whenever they are needed. Some funcbons use parameters which pass informabon into the funcbon to alter the command.

12 Declaring and Calling Functions Declaring a func'on Most funcbons we use will start with void since they do not have a return type. FuncBon name followed by open and closed parentheses FuncBon is contained in curly braces- - says what the robot has to do to complete the acbon (Which motors to turn on/off, etc.) Calling a Func'on Inside task main() FuncBon name followed by parentheses

13 Variables Variables are essenbally a porbon of memory dedicated to holding a piece of data. A variable s type describes what kind of data the variable holds. A variable can be declared with a statement following the format type varname; Variables can also be inibalized on declarabon using type varname = ini/alval; Boolean types (bool) store a true or a false value. Integer types (int) store a non- decimal number.

14 Function Example: Moving Forward Without a parameter The parenthesis are empty, so this funcbon does not use a parameter. With a parameter The funcbon has one parameter, t. When the funcbon is called, it must have an int (integer) in the parentheses following it. t will be set to equal this value. Wait Bme can t be adjusted within the funcbon, so it is separate in the task main(). t is used in the funcbon wherever the value of the variable will be used. The funcbon is called with t = What is inside the parentheses is called the argument.

15 We will now shic our focus to how the robot moves: motors. We have already seen motors being used in the funcbons we examined.

16 The Motors and Sensors Setup page is where you enter which motors are connected to which ports on the robot s brain. Name the motors logical names so that you will know which part of the robot it controls. These are the motor names you will use when wribng code. Remember, capitalizabon maters! It is important to communicate with the person building/wiring.

17 Motors and Movement Which motors are on and the power at which they are running determine how the robot moves. To move forward, the lec and right motors should be on at the same posibve power. To move backwards, the lec and right motors should be on at the same negabve power. To turn, one side should be on a posibve power and the other negabve. Arm lics, claws, and other features act similary.

18 Let s revisit the moveforward funcbon, this Bme focusing on how the motors are used and how to call them in the code.

19 The word motor in all lowercase. The name of the motor being called in [square brackets]. Since this funcbon is to make the robot move forward, lecmotor is set to the same power as rightmotor. wait1msec() makes the robot keep doing what ever command came before it for the number of milliseconds in parentheses. A single equal sign sets the motor, variable, etc. on the lec side of the equal sign equal to the value on the right side of the equal sign. In this case, the power of rightmotor is being set to equal 127. The highest power is 127 for VEX and 100 for VEX IQ.

20 Activity: Labyrinth Goal: Write code that will guide a robot through a maze. You will have to: 1) Use the motor set up tool (for this virtual robot, motor1 is lecmotor and motor6 is rightmotor. Both are VexIQ motors. 2) Write three funcbons: moveforward(int t), turnlec(int t), turnright(int t) 3) Use these funcbons and appropriate wait Bmes to navigate a robot through the labyrinth.

21 How to Run Your Code in a Virtual World 1) Choose Virtual Worlds as your Compiler Target (Robot>Compiler Target>Virtual Worlds). 3) Compile code and download to robot. 4) The Curriculum Companion window will appear. Click log in locally then log in as guest. Then from the top bar click movement, and click Labryrinth Challenge from the lec column. Click start acbvity. 2) Select Curriculum Companion as the Virtual World (Window> Select Virtual Word to Use> Curriculum Companion 4.2.7).

22 This code makes use of the functions to the left to autonomously move the virtual robot from the red dashed area Autonomous Robot Virtual World Labyrinth below to the black dashed area. A wait time is used to make this function run for the specified amount of time t.

23 SomeBmes you don t want to run all of the code you ve writen in the order you ve writen it every Bme you run the program. SomeBmes you only want the robot to do certain tasks if certain condi'ons are true. In these cases we use condi'onal statements.

24 Conditional Statements If Statements executes code in curly braces only if the condibon in parentheses is true. Important symbols: == (double equal signs) checks for equality (doesn t set one thing equal to the other)!= does not equal or (only one of the condibons has to be true) && and (both/all condibons have to be true)

25 Conditional Statements Continued If, Else if statements: will first check if the condibons are true for the first statement. If so it will execute that code, then stop. If the condibons are not met, it will move on and repeat this process for each else if unbl the condibons for one of them is met and execute that block of code Else: will execute this code block if the condibons are not met for any of the preceding if/else if s. Does not have any condibons to check.

26 While Loops SomeBmes you want to execute a block of code over and over again as long as a certain condibon is met. In these cases you use while loops If the condibon in parentheses is true, it will execute the code block then check the original condibon again. If the condibon is sbll true, it will execute the code block again. This process repeats unbl the condibon is no longer true.

27 This is the code used for driving a robot with a remote control. It uses both while loops and if/ else if/ else statements. If the These value two of the lines upper of right code buton simply is equal set to 1 (the the buton power is pressed) of the then right the and braced lec line of code If the motors will condibon run. to the This for line the of code previous value sets of the if statement the power right of isn t the arm met, and motor it lec will to joysbcks, move 127 onto (makes this the code respecbvely. arm block. raise If up). the lower right buton is pressed, If neither then of the above braced condibons line of are sabsfied, code will it will run run and the the braced Once it reaches the end of the arm line of code will lower. which sets the power while loop, it goes back up to of the armmotor to 0. the top to check if the condibon is sbll true (it is) The condibon for the while loop is always true, so this block of code will run indefinitely.

28 Single Controller Driver Control (Vex IQ) This section of the program will control the armmotor of the robot and will move it up and down based on what button is pressed. If a button is not pressed, the armmotor speed is set to 0. This section of the program will make the rightmotor and leftmotor move based on the value received from the joystick vertical channels A and D. Values range from -127 to 127.

29 This section of the program will control the armmotor of the robot with controller 2 and will move it This section of the program will make the rightmotor and leftmotor move based on the value received from the joystick vertical Dual Controller Driver up and down based Control what button (Vex EDR) is pressed. If a button is not pressed, the armmotor speed is set to 0. channels 2 and 3 on Controller 1. Values range from -127 to 127. Controller 2 Adding Xmtr2 to the end of a button name will allow you to only use it on your 2 nd controller. Controller 1

30 Summer Camp Program Template This template will allow for timing-based competition control. It starts by doing nothing until Btn6U is pressed (called an idle loop). Next, it clears a timer and runs through the autonomous code until 15 seconds are up, then does nothing again until the button is pressed. Finally, it clears the timer again and repeats the driver code until time runs out.

31 Additional Resources Robotc.net EducaBon>Vex IQ Curriculum> View Curriculum Go through the lessons or look at the teacher s guide for more informabon and pracbce.

RobotC for VEX. By Willem Scholten Learning Access Institute

RobotC for VEX. By Willem Scholten Learning Access Institute RobotC for VEX By Willem Scholten Learning Access Institute 1 RobotCgetStarted.key - February 5, 2016 RobotC for VEX Section 1 - RobotC How to switch between VEX 2.0 Cortex and VEX IQ Section 2 - RobotC

More information

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run Getting Started in RobotC // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run Learning Objectives Explore Computer Programming using by controlling a virtual robot. Understand

More information

Programming in ROBOTC ROBOTC Rules

Programming in ROBOTC ROBOTC Rules Programming in ROBOTC ROBOTC Rules In this lesson, you will learn the basic rules for writing ROBOTC programs. ROBOTC is a text-based programming language Commands to the robot are first written as text

More information

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run Getting Started in RobotC // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run Understand Motion Learning Objectives Motors: How they work and respond. Fuses: Understand why

More information

Movement using Shaft Encoders

Movement using Shaft Encoders Movement using Shaft Encoders Configure (Motors and Sensors Setup) We will look at the following in this section SensorValue[] while Conditions (, =,!=, ==) Quadrature/Shaft/Rotation Encoder 360

More information

2

2 1 2 3 4 5 6 7 8 9 Robot C Settings for Programming in VEX IQ Text Mode Setup the software for Vex IQ: Platform Tab: Platform Type [Vex Robotics] [VEX IQ] Quick

More information

RobotC. Remote Control

RobotC. Remote Control RobotC Remote Control Learning Objectives: Focusing on Virtual World with Physical Examples Understand Real-Time Joystick Mapping Understand how to use timers Understand how to incorporate buttons into

More information

Activity Basic Outputs Programming VEX

Activity Basic Outputs Programming VEX Activity 3.1.2 Basic Outputs Programming VEX Introduction Computer programs are used in many applications in our daily life. Devices that are controlled by a processor are called outputs. These devices

More information

Activity Basic Outputs Programming VEX

Activity Basic Outputs Programming VEX Activity 3.1.2 Basic Outputs Programming VEX Introduction Computer programs are used in many applications in our daily life. Devices that are controlled by a processor are called outputs. These devices

More information

If you note any errors, typos, etc. with this manual or our software libraries, let us know at

If you note any errors, typos, etc. with this manual or our software libraries, let us know at Oregon State University Robotics Club ORK 2011 Programming Guide Version 1.0 Updated: 10/28/2011 Note: Check back for more revisions and updates soon! If you note any errors, typos, etc. with this manual

More information

Troubleshooting ROBOTC with Cortex

Troubleshooting ROBOTC with Cortex This guide is to designed to be used by a student or teacher as a reference for help troubleshooting ROBOTC software issues. Troubleshooting Topics Computer will not Recognize the VEX Cortex Not able to

More information

Step 1: Connect the Cortex to your PC

Step 1: Connect the Cortex to your PC This is a guide for configuring the VEX Cortex system to be programmed wirelessly using a VEXNet connection. These steps are required the first time you use your computer to program a specific VEX Cortex,

More information

Activity Basic Outputs Programming Answer Key (VEX) Introduction

Activity Basic Outputs Programming Answer Key (VEX) Introduction Activity 1.2.3 Basic Outputs Programming Answer Key (VEX) Introduction Computer programs are used in many applications in our daily life. Devices that are controlled by a processor are called outputs.

More information

G. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC

G. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC RoboCup Rescue EV3 Workshop Part 1 Introduction to RobotC Why use RobotC? RobotC is a more traditional text based programming language The more compact coding editor allows for large programs to be easily

More information

Activity While Loops and If-Else Structures VEX

Activity While Loops and If-Else Structures VEX Activity 3.1.4 While Loops and If-Else Structures VEX Introduction One of the powerful attributes of a computer program is its ability to make decisions. Although it can be argued that only humans are

More information

Activity Variables and Functions VEX

Activity Variables and Functions VEX Activity 3.1.5 Variables and Functions VEX Introduction A program can accomplish a given task in any number of ways. Programs can quickly grow to an unmanageable size so variables and functions provide

More information

Activity While Loops and If-Else Structures Answer Key (VEX) Introduction

Activity While Loops and If-Else Structures Answer Key (VEX) Introduction Activity 1.2.5 While Loops and If-Else Structures Answer Key (VEX) Introduction One of the powerful attributes of a computer program is its ability to make decisions. Although it can be argued that only

More information

The Maze Runner. Alexander Kirillov

The Maze Runner. Alexander Kirillov The Maze Runner URL: http://sigmacamp.org/mazerunner E-mail address: shurik179@gmail.com Alexander Kirillov This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.

More information

Colin Harman and Jonathan Kim

Colin Harman and Jonathan Kim Colin Harman and Jonathan Kim 2-6-10 Getting RobotC 1. Go to robotc.net/robofest 2. Enter coach information including Robofestteam ID 3. The coach will get an email with a link to download RobotC(90-day

More information

Activity Basic Inputs Programming - VEX Clawbot

Activity Basic Inputs Programming - VEX Clawbot Activity 3.1.3 Basic Inputs Programming - VEX Clawbot Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense

More information

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals

VENTURE. Section 1. Lexical Elements. 1.1 Identifiers. 1.2 Keywords. 1.3 Literals VENTURE COMS 4115 - Language Reference Manual Zach Adler (zpa2001), Ben Carlin (bc2620), Naina Sahrawat (ns3001), James Sands (js4597) Section 1. Lexical Elements 1.1 Identifiers An identifier in VENTURE

More information

Variables and Functions. ROBOTC Software

Variables and Functions. ROBOTC Software Variables and Functions ROBOTC Software Variables A variable is a space in your robots memory where data can be stored, including whole numbers, decimal numbers, and words Variable names follow the same

More information

Activity Robot Behaviors and Writing Pseudocode

Activity Robot Behaviors and Writing Pseudocode Activity 2.3.2 Robot Behaviors and Writing Pseudocode Introduction A behavior is anything your robot does: turning on a single motor is a behavior, moving forward is a behavior, tracking a line is a behavior,

More information

Activity Guide - Will it Crash?

Activity Guide - Will it Crash? Unit 5 - Lesson 9 Name(s) Period Date Activity Guide - Will it Crash? Let s play a game: Will it Crash? Each row in the table below presents a small program that uses if-statements and robot commands.

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

Programming Preset Heights in ROBOTC for VEX Robotics By George Gillard

Programming Preset Heights in ROBOTC for VEX Robotics By George Gillard Programming Preset Heights in ROBOTC for VEX Robotics By George Gillard Introduction Programming a button that lifts an arm (or other mechanism for that matter) to a specific preprogrammed point can be

More information

Logic & program control part 2: Simple selection structures

Logic & program control part 2: Simple selection structures Logic & program control part 2: Simple selection structures Summary of logical expressions in Java boolean expression means an expression whose value is true or false An expression is any valid combination

More information

Testing VEX Cortex Robots using VEXnet

Testing VEX Cortex Robots using VEXnet Testing VEX Cortex Robots using VEXnet This document is an inspection guide for VEX Cortex based robots. Use this document to test if a robot is competition ready. Method I. Using the ROBOTC Competition

More information

Chapter 1: Getting Started

Chapter 1: Getting Started Chapter 1: Getting Started Hello, and welcome to RBE 1001! This book will help you learn about how to use your Arduino to control a robot, including how to use various types of motors and sensors with

More information

TETRIX Getting Started Guide. Harvester and Transporter Programming Guide (ROBOTC )

TETRIX Getting Started Guide. Harvester and Transporter Programming Guide (ROBOTC ) Introduction: In this guide, the Ranger Bot will be programmed to follow a line, pick up an object using the harvester, and put the object into the transporter. It will also count the number of objects

More information

APCS Semester #1 Final Exam Practice Problems

APCS Semester #1 Final Exam Practice Problems Name: Date: Per: AP Computer Science, Mr. Ferraro APCS Semester #1 Final Exam Practice Problems The problems here are to get you thinking about topics we ve visited thus far in preparation for the semester

More information

Mr. Monroe s Guide to Mastering Java Syntax

Mr. Monroe s Guide to Mastering Java Syntax Mr. Monroe s Guide to Mastering Java Syntax Getting Started with Java 1. Download and install the official JDK (Java Development Kit). 2. Download an IDE (Integrated Development Environment), like BlueJ.

More information

TETRIX Getting Started Guide. Launcher Programming Guide (ROBOTC )

TETRIX Getting Started Guide. Launcher Programming Guide (ROBOTC ) Introduction: In this guide, the Ranger Bot will be programmed to follow a line while carrying a ball. Upon sensing a bin with its ultrasonic sensor, it will launch the ball into the bin. This guide is

More information

Introduction to C Programming

Introduction to C Programming 1 2 Introduction to C Programming 2.6 Decision Making: Equality and Relational Operators 2 Executable statements Perform actions (calculations, input/output of data) Perform decisions - May want to print

More information

The Maze Runner Zumo version. Alexander Kirillov

The Maze Runner Zumo version. Alexander Kirillov The Maze Runner Zumo version Alexander Kirillov URL: http://sigmacamp.org/mazerunner-zumo E-mail address: shurik179@gmail.com This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

16-311: Getting Started with ROBOTC and the. LEGO Mindstorms NXT. Aurora Qian, Billy Zhu

16-311: Getting Started with ROBOTC and the. LEGO Mindstorms NXT. Aurora Qian, Billy Zhu 16-311: Getting Started with ROBOTC and the LEGO Mindstorms NXT Aurora Qian, Billy Zhu May, 2016 Table of Contents 1. Download and Install 2. License Activation 3. Wireless Connection 4. Running Programs

More information

Control Structures. Code can be purely arithmetic assignments. At some point we will need some kind of control or decision making process to occur

Control Structures. Code can be purely arithmetic assignments. At some point we will need some kind of control or decision making process to occur Control Structures Code can be purely arithmetic assignments At some point we will need some kind of control or decision making process to occur C uses the if keyword as part of it s control structure

More information

Autonomy/Encoders Forward for Distance

Autonomy/Encoders Forward for Distance nomy/encoders Forward for Distance In this lesson, you will learn how to use an Encoder to more accurately control the distance that the robot will travel. 1. Your robot should have one encoder hooked

More information

RobotC primer. Alexander Kirillov

RobotC primer. Alexander Kirillov RobotC primer version 1.1, September 2013 Alexander Kirillov IslandBots robotic club URL: http://islandbots.org/robotc/ E-mail address: shurik179@gmail.com This work is licensed under the Creative Commons

More information

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j;

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j; General Syntax Statements are the basic building block of any C program. They can assign a value to a variable, or make a comparison, or make a function call. They must be terminated by a semicolon. Every

More information

Activity Basic Inputs Programming VEX

Activity Basic Inputs Programming VEX Activity 3.1.3 Basic Inputs Programming VEX Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense the environment

More information

Activity Basic Inputs Programming VEX

Activity Basic Inputs Programming VEX Activity 3.1.3 Basic Inputs Programming VEX Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense the environment

More information

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple

More information

The Beginners Guide to ROBOTC. Volume 2, 3 rd Edition Written by George Gillard Published: 18-July-2016

The Beginners Guide to ROBOTC. Volume 2, 3 rd Edition Written by George Gillard Published: 18-July-2016 The Beginners Guide to ROBOTC Volume 2, 3 rd Edition Written by George Gillard Published: 18-July-2016 Introduction ROBOTC is an application used for programming robots. There are many different versions

More information

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...

2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)... Remembering numbers (and other stuff)... Let s talk about one of the most important things in any programming language. It s called a variable. Don t let the name scare you. What it does is really simple.

More information

CHIL CSS HTML Integrated Language

CHIL CSS HTML Integrated Language CHIL CSS HTML Integrated Language Programming Languages and Translators Fall 2013 Authors: Gil Chen Zion gc2466 Ami Kumar ak3284 Annania Melaku amm2324 Isaac White iaw2105 Professor: Prof. Stephen A. Edwards

More information

C Programming with Mini Sumo Robots

C Programming with Mini Sumo Robots C Programming with Mini Sumo Robots Editing and Compiling a Program -Open Programmer s Notepad. This will bring up a tool for editing and compiling your program: -Start Menu -> Programmers Notepad -> Programmers

More information

2. Within your four student group, form a two student team known as Team A and a two student team known as Team B.

2. Within your four student group, form a two student team known as Team A and a two student team known as Team B. Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense the environment in a variety of ways such as physical

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

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In

More information

Review Chapter 6 in Bravaco. Short Answers 1. This type of method does not return a value. a. null b. void c. empty d. anonymous

Review Chapter 6 in Bravaco. Short Answers 1. This type of method does not return a value. a. null b. void c. empty d. anonymous Assignment 3 Methods Review CSC 123 Fall 2018 Notes: All homework must be submitted via e-mail. All parts of assignment must be submitted in a single e-mail with multiple attachments when required. Notes:

More information

Activity Basic Inputs Programming Answer Key (VEX)

Activity Basic Inputs Programming Answer Key (VEX) Activity 1.2.4 Basic Inputs Programming Answer Key (VEX) Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense

More information

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture - 23 Introduction to Arduino- II Hi. Now, we will continue

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 17 January 2019 SP1-Lab1-2018-19.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

More information

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators Objectives Chapter 4: Control Structures I (Selection) In this chapter, you will: Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)

More information

In Java, data type boolean is used to represent Boolean data. Each boolean constant or variable can contain one of two values: true or false.

In Java, data type boolean is used to represent Boolean data. Each boolean constant or variable can contain one of two values: true or false. CS101, Mock Boolean Conditions, If-Then Boolean Expressions and Conditions The physical order of a program is the order in which the statements are listed. The logical order of a program is the order in

More information

Counter & LED (LED Blink)

Counter & LED (LED Blink) 1 T.R.E. Meeting #1 Counter & LED (LED Blink) September 17, 2017 Contact Info for Today s Lesson: President Ryan Muller mullerr@vt.edu 610-573-1890 Learning Objectives: Learn how to use the basics of Arduino

More information

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132) BoredGames Language Reference Manual A Language for Board Games Brandon Kessler (bpk2107) and Kristen Wise (kew2132) 1 Table of Contents 1. Introduction... 4 2. Lexical Conventions... 4 2.A Comments...

More information

9. MATHEMATICIANS ARE FOND OF COLLECTIONS

9. MATHEMATICIANS ARE FOND OF COLLECTIONS get the complete book: http://wwwonemathematicalcatorg/getfulltextfullbookhtm 9 MATHEMATICIANS ARE FOND OF COLLECTIONS collections Collections are extremely important in life: when we group together objects

More information

K Force The Kristin Robotics Team Introductory Programming Tutorial 2014 For use with the teams squarebot training robots.

K Force The Kristin Robotics Team Introductory Programming Tutorial 2014 For use with the teams squarebot training robots. K Force The Kristin Robotics Team Introductory Programming Tutorial 2014 For use with the teams squarebot training robots. K Force Squarebot Programming Course - 2014 Robot moves forward for two seconds

More information

Competitive VEX Robot Designer. Terminal Objective 5.1: program functions for VEX Robots

Competitive VEX Robot Designer. Terminal Objective 5.1: program functions for VEX Robots Skill Set 5: Programmer II Competitive VEX Robot Designer Terminal Objective 5.1: program functions for VEX Robots Performance Objective: Using a bumper switch, line follower, and potentiometer, program

More information

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University AN OVERVIEW OF C, PART 3 CSE 130: Introduction to Programming in C Stony Brook University FANCIER OUTPUT FORMATTING Recall that you can insert a text field width value into a printf() format specifier:

More information

Open and respond to this poll: PollEv.com/comp110. Calling Methods Mr. Roboto

Open and respond to this poll: PollEv.com/comp110. Calling Methods Mr. Roboto Open and respond to this poll: PollEv.com/comp110 Lecture 1 Calling Methods Mr. Roboto Fall 2016 Special thanks to Dr. Andy van Dam, my grad school advisor, and Brown s CS15 course for this fantastic method

More information

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail Reacting to Sensors In this tutorial we will be going over how to program the Arduino to react to sensors. By the end of this workshop you will have an understanding of how to use sensors with the Arduino

More information

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d.

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d. Chapter 4: Control Structures I (Selection) In this chapter, you will: Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)

More information

Programming Language. Functions. Eng. Anis Nazer First Semester

Programming Language. Functions. Eng. Anis Nazer First Semester Programming Language Functions Eng. Anis Nazer First Semester 2016-2017 Definitions Function : a set of statements that are written once, and can be executed upon request Functions are separate entities

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

Logical Operators and switch

Logical Operators and switch Lecture 5 Relational and Equivalence Operators SYS-1S22 / MTH-1A66 Logical Operators and switch Stuart Gibson sg@sys.uea.ac.uk S01.09A 1 Relational Operator Meaning < Less than > Greater than

More information

IT 374 C# and Applications/ IT695 C# Data Structures

IT 374 C# and Applications/ IT695 C# Data Structures IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation

More information

Brought to you by WIRED Les Quiocho September 30, 2017

Brought to you by WIRED Les Quiocho September 30, 2017 Brought to you by WIRED Les Quiocho September 30, 2017 Objectives To learn where to find necessary resources To recognize the basic electronic components of the BEST returnables kit To understand the software

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 6: User-Defined Functions I

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 6: User-Defined Functions I C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 6: User-Defined Functions I In this chapter, you will: Objectives Learn about standard (predefined) functions and discover

More information

Software Design & Programming I

Software Design & Programming I Software Design & Programming I Starting Out with C++ (From Control Structures through Objects) 7th Edition Written by: Tony Gaddis Pearson - Addison Wesley ISBN: 13-978-0-132-57625-3 Chapter 4 Making

More information

COMS W4115 Programming Languages & Translators GIRAPHE. Language Reference Manual

COMS W4115 Programming Languages & Translators GIRAPHE. Language Reference Manual COMS W4115 Programming Languages & Translators GIRAPHE Language Reference Manual Name UNI Dianya Jiang dj2459 Vince Pallone vgp2105 Minh Truong mt3077 Tongyun Wu tw2568 Yoki Yuan yy2738 1 Lexical Elements

More information

PLT Fall Shoo. Language Reference Manual

PLT Fall Shoo. Language Reference Manual PLT Fall 2018 Shoo Language Reference Manual Claire Adams (cba2126) Samurdha Jayasinghe (sj2564) Rebekah Kim (rmk2160) Cindy Le (xl2738) Crystal Ren (cr2833) October 14, 2018 Contents 1 Comments 2 1.1

More information

These are notes for the third lecture; if statements and loops.

These are notes for the third lecture; if statements and loops. These are notes for the third lecture; if statements and loops. 1 Yeah, this is going to be the second slide in a lot of lectures. 2 - Dominant language for desktop application development - Most modern

More information

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary GATE- 2016-17 Postal Correspondence 1 C-Programming Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts, Analysis

More information

3.DEFINITION. examples being the finite sets. However, we will have to consider infinite sets as well.

3.DEFINITION. examples being the finite sets. However, we will have to consider infinite sets as well. 3.DEFINITION Discrete Mathema6cs is the Math needed in decision making in noncon6nuous situa6ons. Thus, it mainly deals with discrete objects, their best examples being the finite sets. However, we will

More information

Java Programming Fundamentals - Day Instructor: Jason Yoon Website:

Java Programming Fundamentals - Day Instructor: Jason Yoon Website: Java Programming Fundamentals - Day 1 07.09.2016 Instructor: Jason Yoon Website: http://mryoon.weebly.com Quick Advice Before We Get Started Java is not the same as javascript! Don t get them confused

More information

egrapher Language Reference Manual

egrapher Language Reference Manual egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

More information

Boolean Expressions (Conditions)

Boolean Expressions (Conditions) Boolean Expressions (Conditions) Boolean Expressions: Boolean expressions evaluate to either True or False. Boolean expressions are constructed using relational operators, which allow for comparison between

More information

Droide Multi Language Platform. NXT S.D.K. - Java Documentation 2.1.8

Droide Multi Language Platform. NXT S.D.K. - Java Documentation 2.1.8 Droide Multi Language Platform NXT S.D.K. - Java Documentation 2.1.8 May 31, 2008 1 Introduction This document is intended to be used as the Java API documentation. Here you can nd a small technical description

More information

TETRIX Getting Started Guide FTC Extension

TETRIX Getting Started Guide FTC Extension Introduction In this guide, code created with the FTC templates will be explored and then run using the Field Control Software (FCS). An FTC game begins with an autonomous period where only autonomous

More information

Java Bytecode (binary file)

Java Bytecode (binary file) Java is Compiled Unlike Python, which is an interpreted langauge, Java code is compiled. In Java, a compiler reads in a Java source file (the code that we write), and it translates that code into bytecode.

More information

Fundamentals of Programming Session 4

Fundamentals of Programming Session 4 Fundamentals of Programming Session 4 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2011 These slides are created using Deitel s slides, ( 1992-2010 by Pearson Education, Inc).

More information

Flow Control. CSC215 Lecture

Flow Control. CSC215 Lecture Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements

More information

CSCE 121 ENGR 112 List of Topics for Exam 1

CSCE 121 ENGR 112 List of Topics for Exam 1 List of Topics for Exam 1 If statements o How is an if statement constructed? o Does every if need an else? Looping o While loop! What does a while loop look like?! How do you ensure you will not have

More information

Making Decisions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies

Making Decisions. C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies 5 ec Making Decisions s C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Chapter Objectives Learn about conditional expressions

More information

Kebot: Robot Simulator

Kebot: Robot Simulator Kebot: Robot Simulator » Completion of consent forms» Introduction to the research project» Structure of the workshop session» Advantages of taking part» Workshop has been designed for complete novices

More information

FRAC: Language Reference Manual

FRAC: Language Reference Manual FRAC: Language Reference Manual Justin Chiang jc4127 Kunal Kamath kak2211 Calvin Li ctl2124 Anne Zhang az2350 1. Introduction FRAC is a domain-specific programming language that enables the programmer

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 11 January 2018 SP1-Lab1-2017-18.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

More information

CST112 Variables Page 1

CST112 Variables Page 1 CST112 Variables Page 1 1 3 4 5 6 7 8 Processing: Variables, Declarations and Types CST112 The Integer Types A whole positive or negative number with no decimal positions May include a sign, e.g. 10, 125,

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Getting Started with the FTC SDK. Jaxon Brown August 5, 2017

Getting Started with the FTC SDK. Jaxon Brown August 5, 2017 Getting Started with the FTC SDK Jaxon Brown August 5, 2017 Goals Install the Software Development Kit (SDK) Learn the Java basics How is the FTC SDK structured? Creating a basic Teleop Program Creating

More information

CS Introduction to Data Structures How to Parse Arithmetic Expressions

CS Introduction to Data Structures How to Parse Arithmetic Expressions CS3901 - Introduction to Data Structures How to Parse Arithmetic Expressions Lt Col Joel Young One of the common task required in implementing programming languages, calculators, simulation systems, and

More information

Key Differences Between Python and Java

Key Differences Between Python and Java Python Python supports many (but not all) aspects of object-oriented programming; but it is possible to write a Python program without making any use of OO concepts. Python is designed to be used interpretively.

More information

Language Reference Manual

Language Reference Manual ALACS Language Reference Manual Manager: Gabriel Lopez (gal2129) Language Guru: Gabriel Kramer-Garcia (glk2110) System Architect: Candace Johnson (crj2121) Tester: Terence Jacobs (tj2316) Table of Contents

More information

SOFT 161. Class Meeting 1.6

SOFT 161. Class Meeting 1.6 University of Nebraska Lincoln Class Meeting 1.6 Slide 1/13 Overview of A general purpose programming language Created by Guido van Rossum Overarching design goal was orthogonality Automatic memory management

More information

6.096 Introduction to C++

6.096 Introduction to C++ MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.096 Lecture 3 Notes

More information