Arduino blink Delay
/ constants won't change. Used here to
/ set pin numbers:
const int ledPin = 13; / the number of the LED pin
/ Variables will change:
int ledState = LOW; / ledState used to set the LED
long previousMillis = 0; / will store last time
Introduction to Advanced Level of Computer Science
If you arrived at this level of the lessons, you may consider yourself a novice computer
The reason is because you now have a basic knowledge of the computer as hardware, a
Flow Control Overview
A control structure is a block of programming that analyzes variables and chooses a
direction in which to go based on given parameters. The term flow control details the
direction the program takes (which way progr
How to go about implementing a problem solution as a program
Jump to: navigation, search A common misconception newcomers have to programming is that
when a programmer approaches a problem, he or she just sits down at a computer and starts
typing out stra
Operators and expressions
Assignment and Typing
Assignment is setting a variable to a value. Like common mathematics, most languages use a
simple equal sign (there are exceptions, e.g. in Pascal, the ":=" operator is used for assignment)
blah = "A str
Procedures and functions
Programming can be a repetitive task. While we have structures like loops to help us do
the exact same thing many times, there are times when we need to do something
different with only slight variation each time. Rather
The concept of Turing machines is one of the founding principles of modern computing.
Although somewhat complicated for first time learners, Turing machines (along with several
other models) are vital for representing the underlying logic behind all compu
The Internet is the worldwide "network of networks" that links millions of computers together
via copper wires, fiber-optic cables, wireless connections, and other telecommunications
channels. This publicly accessible network of interconnected computer ne
Types and variables
Jump to: navigation, search Variables A variable in any programming language is a named piece
of computer memory, containing some information inside. Think of a variable as a box with a
name, where we can "store" something. We create,
Number Systems and
"There are 10 kinds of people those who understand
binary and those who do not."
In everyday life, we use 10 digits (0-9) to count
But thats not a requirement!
Base 10 10 possible digits (0-9) 0, 1, 2, 3
From The ground Up
Selection and Decision:
The if Statement
if (sale < 25.00)
total += SHIPPING_FEE;
System.out.println("Shipping is $5.00");
Execution of this statement proceeds as follows:
From The Ground Up
Variables and Assignment
Variable and Assignments
1. How does a program obtain storage for data?
2. How does a program store data?
3. How does a program use stored data?
Introduction to Computer Science
"Computer science is as much about
computers as astronomy is about
- Edsgar Dijkstra
Computer science is
Determining what problems can be solved with a
Developing step-by-step instructions (a
From the Ground Up
Three Java constructions allow repetition in programs:
the while statement
the do-while statement
the for statement.
The while Statement
We can write a program that adds exactly 5 int
First Java Program:
Displaying things on the screen
Your first Java program with BlueJ
BlueJ and create a new project
(Project > New Project)
Give your project a name
All of your project files will be placed inside a
folder with this name
From the Ground Up
Expressions and Data Types
What is a computer program?
A computer program or application is a set of instructions,
written in a programming language, that enables a computer
to perform some specified task.
COMP 1900 Spring 2017
Number of People: Individual.
Due: Sunday, April 2nd, 2017.
Submission: Zip your BlueJ project folder into a single file and upload it to the proper folder in the
eCourseware dropbox at https:/elearn.memphis.edu.
Arrays, strings and records
To understand this section, let's study this step by step
There are two parts that you may consider while programming. The first part is how the
computer calculates or treats your data. The second part is how the user is viewin
Objective There are several definitions for the notion of an algorithm. As an introduction to the
concept, we shall study some simple applications.
By the end of this lesson, students should:
Know what an algorithm is.
Know what pseudocode is.
Be able to
This example shows how to fade an LED using the
* LED attached from digital pin 9 to ground.
Created 1 Nov 2008
By David A. Mellis
modified 30 Aug 2011
By Tom Igoe
Demonstrates analog input by reading an analog sensor on
analog pin 0 and
turning on and off a light emitting diode(LED) connected to
digital pin 13.
The amount of time the LED will be on and off depends on
the value obtained by analogRead
Udp NTP Client
Get the time from a Network Time Protocol (NTP) time server
Demonstrates use of UDP sendPacket and ReceivePacket
For more on NTP time servers and the messages needed to
communicate with them,
SCP1000 Barometric Pressure Sensor Display
Serves the output of a Barometric Pressure Sensor as a web
Uses the SPI library. For details on the sensor, see:
Each time the input pin goes from LOW to HIGH (e.g. because
of a push-button
press), the output pin is toggled from LOW to HIGH or HIGH
to LOW. There's
a minimum delay between toggles to debounce the circuit
(i.e. to ignore
Reads an analog input on pin 0, prints the result to the
Attach the center pin of a potentiometer to pin A0, and the
outside pins to +5V and ground.
This example code is in the public domain.
/ the setup routine runs
Plays a pitch that changes based on a changing analog input
* 3 force-sensing resistors from +5V to analog in 0 through
* 3 10K resistors from analog in 0 through 5 to ground
* 8-ohm speaker on digital pin 8
created 21 Jan 2010
Arduino Programs Blink
This sketch demonstrates the Keyboard library.
When you connect pin 2 to ground, it creates a new
window with a key combination (CTRL-N),
then types in the Blink sketch, then auto-formats the text
using another key combination (C
In this course you will be using MasteringPhysics, an online tutorial and homework program that
accompanies your textbook. If you have joined a MasteringPhysics course before and can still log in :
Save time by following the guide for
This sketch connects serially to a Processing sketch to
control a Pong game.
It sends the position of the slider and the states of three
pushbuttons to the
Processing sketch serially, separated by commas. The
Processing sketch uses that
This example connects to an unencrypted Wifi network.
Then it prints the MAC address of the Wifi shield,
the IP address obtained, and other network details.
* WiFi shield attached
created 13 July 2010
by dlf (Metodo2 srl)
modified 29 Feb 2012
COMP 1900 CS 1: Introduction to Computer Science Spring 2017
Bill Baggett, PhD
Office: Dunn Hall 390
Department Office: Dunn Hall 375
Office Phone: 901.678.3044
Department Phone: 901.678.5465
Email: [email protected]
The best way t