Iowa State University

CPRE 288 Laboratory

Lab 4: Interupts & Collecting Sensor Information

Lecture - Lab Connection

In lecture, you have studied the use of GPIO and interrupts. In this lab, you will use these hardware features to interface with push buttons using interupts. In this lab you will also collect data using the sensors on the Cybot. This will be very useful for your final project


  • Read through the lab description
  • Skim the reference documents below. Browse the table of contents of the Tiva TM4C123GH6PM Datasheet chapters 1, 10, 22 and 23. Chapter 10 covers the GPIO module. Similar information is covered in the textbook (e.g., chapter 2, sections 2.6.1,, 2.6.3; chapter 4, sections; chapter 7, sections 7.1-7.3). Note: Your goal is to be aware of information so that you can find and read it in more detail if and when needed.
  • Scan Sections 5.1 – 5.3 of the textbook to get a sense for were to find details about interrupts.
  • Read through the source code for botton.c & lab4_template.c.
  • Print the Lab Evaluation Form.

Reference Documents

All reference documents are also available on the Resources page of the course website.

Reference Files

Download the following files to a single folder your U: drive. (Right-click and select 'Save Target As')

You'll need to put a copy or your button.h and button.c from last lab into this project.

  • lab4_template.c: The skeleton code to implement lab 4.
  • lcd.c: A program file with a number of LCD functions
  • lcd.h: The header file for lcd.c
  • timer.c: A program file with wait functions
  • timer.h: The header file for timer.c
  • button.c: This file contains functions which you must implement if you want to read buttons.
  • button.h: The header file for button.c
  • cyBot_uart.h: Header for pre-compiled CyBot/Human UART communication
  • libcybotUART.lib: Pre-compiled Library for CyBot/Human UART communication (Note: Must change extension from .txt to .lib after copying)
  • cyBot_Scan.h: Header for pre-compiled sensor scanning
  • libcybotScan.lib: Pre-compiled Library for sensor scanning (Note: Must change extension from .txt to .lib after copying)



Lab 4 Description

  • Lab 4 Manual: A detailed description of the objectives to complete for Lab 4


Turn the power to the cyBOT platform off before charging. The Launchpad board consumes power and the battery will not charge if the robot is in full_mode (which it enters after calling oi_init, turning the power LED yellow). You will have to turn off open interface. The robot is charging when the robot's power LED is pulsing red and both green LEDS on the dock are lit.

Reference Files

Files Description
Tiva TM4C1236GH6PM Datasheet Information about the Tiva TM4C1236GH6PM Processor
Documentation on printf Documentation for the lcd_printf and printf function.
Lab Evaluation Form Evaluation form for Lab
Online Feedback Form Tell us what you think of the lab (feedback forms)