Difference between revisions of "CSC231 Homework 8"

From dftwiki3
Jump to: navigation, search
(Reading Files)
Line 40: Line 40:
 
which will clear Pins 2 to 8 then turn 2, 3, 4, ... 8 ON, one after the other, then turn them off in the reverse order.  You could imagine having a huge file with thousands of lines for creating an interesting light show!
 
which will clear Pins 2 to 8 then turn 2, 3, 4, ... 8 ON, one after the other, then turn them off in the reverse order.  You could imagine having a huge file with thousands of lines for creating an interesting light show!
  
Save your program in a file called hw8.asm, and submit it along with arduino-serial.c as follows:
+
==Submission==
 +
Save your program in a file called '''hw8.asm''', and submit it along with '''arduino-serial.c''' as follows:
  
 
  submit hw8 hw8.asm
 
  submit hw8 hw8.asm
 
  submit hw8 arduino-serial.asm
 
  submit hw8 arduino-serial.asm
 +
 +
For this assignment, I would ask you '''not''' to modify the [[CSC231 arduino_loop_new.pde | arduino_loop.pde]] sketch.  You will be free to modify the sketch for your final project, but not for this assignment.

Revision as of 07:14, 7 November 2008

(c) --DT 13:42, 30 October 2008 (UTC)

The deadline for this assignment is Fri. Nov 14th, at 11:59 p.m. plus 1 minute.

Reading Files

Write an assembly language program that is compatible with the arduino-serial.c program of Lab 7 and which reads a file of commands and sends them to the Arduino.

The file will be called "arduino.cmd", always, so no need to ask the user for it: you can hard code this string in your program.

The commands supported will be of the form:

  • w d p n where n is either 0 or 1, and p is a pin number.
  • r d

So, a command file could be something like this:

w d 2 0
w d 3 0
w d 4 0
w d 5 0
w d 6 0
w d 7 0
w d 8 0
w d 2 1
w d 3 1
w d 4 1
w d 5 1
w d 6 1
w d 7 1
w d 8 1
w d 8 0
w d 7 0
w d 6 0
w d 5 0
w d 4 0
w d 3 0
w d 2 0

which will clear Pins 2 to 8 then turn 2, 3, 4, ... 8 ON, one after the other, then turn them off in the reverse order. You could imagine having a huge file with thousands of lines for creating an interesting light show!

Submission

Save your program in a file called hw8.asm, and submit it along with arduino-serial.c as follows:

submit hw8 hw8.asm
submit hw8 arduino-serial.asm

For this assignment, I would ask you not to modify the arduino_loop.pde sketch. You will be free to modify the sketch for your final project, but not for this assignment.