Class Logo 


EEL 2880 - C Programming for Embedded Systems

Course Objectives

Through successful completion of the course, the student will:

* Understand the stages of the engineering problem solving process and their relationship to the development of software for its implementation.

* Learn the C programming language, as a vehicle for the solution of engineering problems.





Links for Class Lectures

Instructions:
ReadMeFirst RVC - Online

General Syllabus - Fall 2024
Note: The source for ALL due dates
(lectures, assignments, exams, exercises)
are on the course syllabus calendar.

Iitems on this web page are categorized for reference only

How to Get the Most Out of Studying

This course has gone Paperless
Anyone Can View (video)
All submissions MUST comply with requirements

EEL 2880 Assignment Submission Form Fall 2024
Homework links are at bottom of this web page
All submissions must have name, date, time for credit

Do the work and you will get a good grade
Homework Completion vs Course Grade

"C" Programming Language: Brian Kernighan

Blog: Learn the basics of programming with C - cheat sheet

TIOBE Software Index

History
  Module 1A

Blink an LED

RoboMindAcademy.com

Dennis Ritchie - home page
Dennis Ritchie - invented C language


Dennis Ritchie's video interview June 2011
Dennis Ritchie video award
1982 AT&T Archived Unix Video

The C Programming Language
by Brian W. Kernighan and Dennis M. Ritchie.

Historical C-Ref Manual; Dennis Ritchie
that came with 6th Edition Unix (May 1975)

The Hello World Collection

Flow Chart Programming
Module  1B
Youtube: Programming C Robot Simulator
you can do this too........
C Robot download Function Details

SFC - A Structured Flow Chart Editor (original site)
Dr. Tia Watts

SFC manual


SFC download

Lecture example: ForIf
Example #1


HW #1 Flow Chart
Integrated Development Enviromments
  Module 2
Integrated Development Environment

Compile Process Outline

Compiler, Assembler, Linker, Loader
The Edit-Compile-Link-Execute Process
IDE Parts

An Integrated Development Environment (IDE) brings all of the programmers tools into one convenient place. There was a time when programmers had to edit files, save the files out, run the compiler, then the linker, build the application then run it through a debugger.

Today's IDEs bring editor, compiler, linker and debugger into one place along with project management tools to increase programmer productivity.

Installing IDE

Install Code::Blocks IDE with MinGW
Download the binary release
Screen Capture of correct choice

system("PAUSE");

magic.c

HW #2 IDE



Archive Information

Code::Blocks official home site
YouTube - How to set up Code::Blocks

Installing and Configuring C/C++ support for NetBeans
NetBeans with C/C++ support (Multiplatform)

Qt IDE & Development System
Eclipse IDE

Express - Visual C++

Online Compile:
CompileOnline.com
Objects / Expressions
  Module 3
A: (lecture examples)
ForIf
Objects, Operators, Expressions, Statements, Scope
Printf
Escape Squences
Data Types
Ascii
sizeof()


B: (lecture example)
Scope1
Scope2


Reference:
Basic Syntax
Data Types
Operators
Scope
Program Flow - If, Switch
Loops
Printf
scanf()
current standard C (11) Language
Tic-Tac-Toe

HW #3 Operators
Place answers (ABC or D) on answer sheet and submit same procedure as homework (select Quiz1 as assignment)
Quiz1
Ans40Sheet.pdf Ans40Sheet.doc
Expression & Statements
  Module 4
A: (lecture example)
1) CountDigits.c
2) GetDigits.c
3) PrintPi

Reference:
Understanding moving the decimal
Finding the number of digits of an integer



B:
Burglar Alarm
Reference:
Basic Bitwise Operators Tutorial #8
RIMS Example code
LaunchPad Push button to turn on red LED
Burglar Alarm Wiring

Bit Masks
Logical bitwise operators



Reference:
Decimal and Binary and Hex
Binary, Decimal, Hexadecimal Numbers
Hex - Binary - Decimal Converter
Bitwise Operators

HW #4 Binary Print
Module  5 Statements

A:
While loop and Switch decision
SelectIf
SelectSwitch
SwitchWhile - Interactive console menu
McDucks.c

B:
For/If condition expressions
ForExamples

Reference:
Switch and If
While loop
puts

Quiz 2
Ans45Sheet.pdf Ans45Sheet.doc
Module  6
A: Review
B: Exam 1
Module  7
Arrays Strings
Functions Pointers
Begin Exercise 1
A:
What is a histogram?
Histogram.c
Histogram code highlighted
Array, Funtion & Pointer Summary
B:
TiresAndApples.c
TiresAndApples Concepts

Reference:

Pointers are a fundamental part of C. If you cannot use pointers properly then you have basically lost all the power and flexibility that C allows. The secret to C is in its use of pointers.

C Programming/Pointers and arrays
Is it a Value or Pointer?

C uses pointers a lot. Why?:

  • It is the only way to express some computations.
  • It produces compact and efficient code.
  • It provides a very powerful tool.

C uses pointers explicitly with:

  • Arrays,
  • Structures,
  • Functions.


Variables
Pointers
Pointer Arithmetic
Arrays
Strings
Functions
1) Call by Value
2) Pointers to functions
3) Call by Reference SWAP
Calling Convention - machines
The Call Stack - YouTube video

Pointer tutorials
Pointers - Tutorial
Learning Pointers for Dummies

Boston Videos: Playlist
Pointers
Functions
Pass Arguments to Functions
Pass by Reference vs by Value

HW #5 Comments
Module  8
Card Deck
A: Introduce Deck
Deck of Cards
Fisher-Yates Shuffle
Swapping Integers
Call by Reference - pointers swap integers

Two dimension arrays - C language
Variations - Functions & 2D arrays

B: Begin code development
DeckBeginning.c

PrintStates - Example of array of pointers to text


HW 6: DeckShuffle
Module  09

A: Review Deck Shuffle and Play Cards
APF Review
Histogram Example

B: PointerOrValue?

HW: HW 7: PlayCards
Quiz3MCQ
Quiz3(Old)
AnswerSheet60
Module  10
Review/ Exam 2
Module  11
Structures
A: Structures in C
What is a structure?
BluePrint
SilverCar, BlueCar, RedCar, More RedCar
C Programming Tutorial Video
Structure Examples
Cornell Structure Explanation
cardShuffleStructures


B:
C: Malloc()
C Memory management
Operator New Dynamic Memor
Pointer notation for structures
Linked List Baumann
Linked List BlogSpot

SimpleSimpleLinkedList
SimpleLinkedList.c


HW8Structures
Module  12
File I/O - Text and Binary Blocks
A: stdio.h
File I/O
Text File I/O
TextOutput.c
TextDump.c
HexDump.c
NameHeightBlocked.c

SimpleLinkedListFileIO.c

B: Simple Example: BinaryFiles.c
Binary read from a file
Example: Corrected source code for above BinaryRW
Binary write to a file
Example: Random access files in C
Binary File I/O in C
Writing into and reading from a binary file in C

Video:
Read and writing data to File I/O in C
Random Access File Method in C

fopen
fread-text
fseek-text
fwrite-block
rewind
fprintf()
fgets()

HW9: File I/O
Generate output file test.txt with TextOutput.c
Then adopt HexDump.c to save analysis
of test.txt to a disk text file hdp.txt
Turn in a screen shot of Notepad showing hdp.txt contents

Module  13
Matlab overview
See Matlab references below
Mathworks.com
SciLab.org

Object Oriented overview
Alice.org

File I/O
HW 10: Plumbing Database
Quiz 4
These examples are for Quiz 4 Questions 21-29
Quiz4Named.c
Quiz4Ptr.c
Module  14
Q/A and Thanksgiving
Module  15
Review, Exam 3,




References


**Cplusplus.com

C Programming
A comprehensive look at the C programming language and its features.

C in Depth: The Complete C Programming Guide for Beginners

*C Library Reference Guide Eric Huss

*An Introduction to C Programming - Cornell Virtual Workshop

C Programming Tutorial - TutorialsPoint

C Programming Tutorial

New Boston Youtube videos

C Courseware - Professor A D Marshall

Practical Programming in C - MIT

Essential C - Stanford

GNU C Programming Tutorial

GNU C Reference Manual

comp.lang.c Frequently Asked Questions


CRC for PNG


Program Parts




Individual Project


Allegro 5 project instructions

Exercise 1 - Build Allegro 5 using TDM-GCC and CMake
Video: Build the Allegro Library (using above instructions)


Exercise 2 - Build SquareNoids game
SquareNoidSound.zip
(right click to download zip file)

Exercise 3
Build CosmicProtector
CosmicProtector.zip

Reference:
TINS Competitions
SpeedHack



Allegro Gaming Allegro 5

Allegro downloads
Allegro Wiki: Getting Started
Allegro 5 Reference Manual w Source code
Allegro 5 Wiki: Tutorials


Structures What is a structure?
Gnu Programming Tutorial
Pointer notation for Structures
Operator New Dynamic Memory
Dynamic Memory in C/C++
Linked List Easy
Linked List Baumann
Employee Linked List
BluePrint
SilverCar, BlueCar, RedCar
Alice.org
Matlab References Matlab Documentation
Matlab Tutorial
Matlab Notes
Matlab with electrical circuits
Matlab Control Tutorials
Simple Matlab Graph Tutorial
Matlab Signal Analysis Tutorial
Matlab Operators
Java References
Java Tutorials
Learning the Java Language
COP 2210 Syllabus

Hello World for NetBeans
Java Dialog Box Output
JOptionPane Examples
Closer Look at "Hello World"
Deck of Cards
Learning Java (Book & Resources)

Java Beginner Book Tutorial
Four Hour Java Tutorial

Moving from C++ to Java
PrintScrn PrintScrn Instructions
PDFCreator PDFCreator easily creates PDFs from any Windows program. Use it like a printer in Word or any other Windows application
Download PDFCreator
also
PDFTK Builder




Programs

Introductory
Random.c , Expenses.c
BubbleSort.cpp, Bubble2.cpp

Expressions
Anatomy.c, ConstDefine.c, IntArith.c
IntWrap.c, Sizeof.c, TypeCast.c

Statements
Bottles.c, For.c, Forcomma.c
Infinite.c, McDucks.c

Arrays and Strings
Preincr.c, PreWhile.c, StringFuncs.c
SimpleText.c, GradesData.c, TicTacToe.c
StringDatabase2.c


Individual Study Examples

Structures
Example1: Structure with Arrays, Structure with Arrays (ptr)
Example 2: Structure to Function, Structure to Function (ptr)
Example 3: Array of Structures
Example 3: Step thru Array of Structures
Example 3: Structure of Structures

File I/O
Example 4: Fread Fwrite, Fgets Fputs
Example 4: EOF, Fseek


Lecture Examples
Scope1
Scope2
ForIf
PrintPi
SelectIf
SelectSwitch
SwitchWhile
ForExamples
Histogram
PtrUpperCase
LinkedList
Memory



Homework Assignments


HW #1 Flow Chart

HW #2 IDE

HW #3 Operators

HW #4 Binary Print

Array, Funtion & Pointer Summary
Histogram.c
TiresAndApples.c
HW #5

Array, Function & Pointer Examples
MultiDim.c
ValPointer.c
ChangeVal.c

Deck of Cards
HW 6: DeckShuffle
Fisher-Yates Shuffle
Swapping Integers

StringOrPointer
HW 7: PlayCards

HW 8: HW8Structures

HW9: File I/O
Generate output file test.txt with TextOutput.c
Then adopt HexDump.c to save analysis
of test.txt to a disk text file hdp.txt
Turn in a screen shot of Notepad showing hdp.txt contents

File I/O
HW 10: Plumbing Database



Final Exam Review Examples
1 Structure with Arrays Ex: 1
2 Structure to Function Ex: 2
3 Array of Structures Ex: 3
4 Pointer Array of Structures Ex: 3
5 Structure of Structures Ex: 3
6 File I/O Ex: 4
7 Fseek & EOF Ex: 4