Download
record n.
Skip this Video
Loading SlideShow in 5 Seconds..
Record PowerPoint Presentation

Record

125 Views Download Presentation
Download Presentation

Record

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. /* * Function record * This function will record the input from the joystick to memory * */ void record(void) { int i; i=0; asm_main(); // call the assembly function for(;;) { DELAY_100ms(); path [i]= (PTAD & 0x0F); if (i == 500) { path[i]=0x00; // stores all zeros to memory break; //breaks out after 50 seconds of looping } i++; } // waits until the switch button is neutral DUMPROUTINE(); Record

  2. /* * Function playback * This function will playback the information recorded in memory * */ void playback(void) { int i; i=0; // call the assembly function // allows us to write to the whole port T DDRAD = 0x0F; RDRAD = 0x0F; for(;;) { if (path[i] == 0x00) break;//checks to see if byte is all zeros if so exits out PTAD = path[i]; // stores memory location in port T i++; DELAY_100ms() ; // waits 100ms } DUMPROUTINE(); DDRAD = 0; //add to wait until switch is recentered return; } Play Back

  3. Dump Bucket • ; ---------------------------------------- • ; Subroutine DUMPROUTINE: • ; ---------------------------------------- • DUMPROUTINE: • BSET PTT,P1_DUMPMOTORBIT ;changes direction of motor • BCLR PTT, E1_DUMPMOTORBIT ;turn dump motor on • LDX #50000 ;delay for 5 second • JSR DELAY_X100 • BSET PTT,E1_DUMPMOTORBIT ;turn off dump motor • LDX #50000 ;delay for 5 second • JSR DELAY_X100US • BCLR PTT,P1_DUMPMOTORBIT ;changes direction of motor • BCLR PTT, E1_DUMPMOTORBIT ;turn on dump motor • LDX #50000 ;delay for 5 second • JSR DELAY_X100US • BSET PTT,E1_DUMPMOTORBIT ;turn off dump motor • RTS

  4. Status Reportas of October 19, 2005