【正文】
set to zero if wrong. 55 of 69 Code Run Program ? 10. Examine the structure. ? 11. Run to test the program. ? Watch the correct run conter ? Make 2 correct, then an error, then 5 in a correct in a row (the program should stop) ? 12. Save as . 56 of 69 Code ? Code Exercise 6 Cumulative Data Collection Could you at this point? 1. Add a cumulative trial counter informing the subject that this is trial [trialcounter] of the maximum number of trials? 2. Have a practice block where the task is easier and subjects continue till they reach 90% accuracy before moving on? Short Answers are included in the Exercise Appendix 57 of 69 Code Exercise 7. Port Input Output If you need to read a digital input output bit or write one that can be done by writing code to operate with a port mand then program provides an example. It reads from a port displaying the contents and writes patterns of all bits on and off. This program requires special hardware to respond to the bits. The joystick can be used for input and printer port devices for input output. 58 of 69 Code Specification of Port Address ? 1. Load ? 2. Examine the declaration of the Port/IO 59 of 69 Code Reading a Digital Port ? 3. Examine code to read the port 60 of 69 Code Writing to a Digital Port ? 4. Examine code to write data to a port ? 5. Run the program if you have a device to show the data of the port read. For joy stick change the port address code 61 of 69 Code ? Code Exercise 7 Port I/O Questions Could you at this point? 1. Turn on the lights differentially reporting accuracy green on correct and red on wrong? 2. Terminate a block when the black box button is pushed? 3. Output a string of bits one every 20 ms. Short Answers are included in the Exercise Appendix 62 of 69 Code Exercise 8 Optional OnsetSignal ? Add OnsetSignalCondition code to signal the condition on the parallel Port to or load Note code in violet rectangle code is usually in initialization section 63 of 69 Code ? Code Exercise 8 Onset Synch Could you at this point? 1. Set the onset synch to report when the fixation occurred with a 1 code, when the stimulus occurred with a 2 code? 2. Change the data signal to reflect what stimulus was presented? Short Answers are included in the Exercise Appendix 64 of 69 Code Exercise 9 Optional Loop ? 1. Load and run ? 2. Change the and position after For mand and rerun. ? = 4 * counter + 10 ? = 4 * counter + 10 65 of 69 Code ? Code Exercise 9 Frame Loop Questions Could you at this point? 1. Add a fixation stimulus to the loop in CodeExercise9Loop? 2. Add code to exit the loop when the subject makes a correct response? Short Answers are included in the Exercise Appendix 66 of 69 Code Exercise 10 (Optional) ReSampling This exercise uses code to resample a list to sample a list and reject any repeat conditions in the list. It uses a subroutine to do the sampling. To use a user defined subroutine it must be in the User section. This will manually force a sampling from the ConditionList putting all of those conditions in the context. If this is put in a loop (e g., While) this can sample skipping unwanted runs of the same condition. 67 of 69 Code Check Out Program ? 1. Load and run ? 2. Examine the code. Note use of LastCondition to verify no repeats. ? 3. Run the program note no runs 68 of 69 Code Examine ManualSample Subroutine ? 4. Examine the User code with the subroutine for sampling. Note this subroutine uses sophisticated techniques to pass in the list name. For now, just note that this code must be placed in the User code section so you can refer to the ManuallySampleList function. 69 of 69 Code ? Code Exercise 10 ReSampling Questions Could you at this point? 1. Modify CodeExercise10Resample to have four conditions and make sure there are no repetitions? 2. Copy the subroutine from CodeExercise10Resample to another program so you could use the ManuallySampleList in another program. Short Answers are included in the Exercise Appendix