Programming the Diffractometer

Down Arrow: 10 Down Arrow: 11 Down Arrow: 12
Down Arrow: 1


 

 


1.

File Access Block

Delete text file named "Diffract" (necessary before you can write to the file)

2.

Loop

Begin loop.

Repeat 50 times

3.

Motor

Move motor 1 degree

4.

Rotation Sensor Block

Read rotation sensor value.

Will be saved to text file.

5.

Light Sensor Block

Read light sensor value.

Will be saved to text file.

6.

Number to Text

 

Convert rotation sensor value to text.

7.

Number to Text

 

Convert light sensor value text.

8.

Text

Combine text values.

Format will be "rotation sensor value", "light sensor value"

9.

File Access Block

Write text string to file named "Diffract"

10.

File Access Block

After loop has executed 50 times, close file.

11.

Wait Block

Wait for touch sensor.

12.

Motor Block

Once touch sensor is pushed, bring motor arm back to original position.