231a-af Project Software Description

From CSclasswiki
Jump to: navigation, search

Project Software Description


My project will use a light sensitive resistor with the Arduino to sense how long you have been in front of the computer. It will give you warnings if you remain in front of the computer for too long, and will welcome you back when you return. After one hour in front of the computer, you should take a 15 minute break.

Arduino Sketch

Driver.c Program

  • Modifications needed for the driver.c program
    • extern int asm_main( void );
    • extern int QUIT
    • QUIT will be a integer value in the assembly program that will be initialized to 0, but will change to 1 if the user wants to stop the program
    • driver.c will have to use non-blocking input to achieve this effect

Assembly Program

  • asm_io.inc and asm_io.asm are optional, but helpful
  • My assembly program will be modeled off the ledOn.asm program that we developed in Lab 6 as well as the time of day program we wrote for Homework 10.
    • The main body of the program will be an endless loop that will run until the user enters in "quit" at the keyboard.
    • The assembly program will send commands to the Arduino to receive input using the functions described in ledOn.asm. It will get information from the IR sensor on whether the user is at the computer or not. The information will be stored in variables within the assembly program, as well in an external file.
    • Within the assembly program itself, there will be two ratios to be constantly updated - the ratio of present/not-present for the entire length of time that the program is running, and the most recent present/not-present ratio for the latest 1hr/15min ratio.
    • The external file will store information on the total ratio, as well as the specific times that the user left and returned to the computer.
    • At predetermined times, the assembly will print messages to console warning the user that their allotted amount of time is up, and begin beeping as well (0x07).


Return to Main Page