html5-img
1 / 5

Record

/* * 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);

hao
Download Presentation

Record

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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

More Related