Print

Activity

Analyzing Finch Data II

Record Finch data as a function of time!

Teacher Materials

Get Access

ADVANCED: Going Further

Required lessons: Variables, Lists, Timers

Use timers to record Finch sensor data and timestamp it. Write a program that takes 100 light measurements with the Finch and stores them in a list. For each light measurement, the program should also record the value of the timer when that measurement was taken. This data should be saved in a second list. The program should wait 0.1 seconds between pairs of measurements.

Next, find the maximum value of light that was recorded. By checking the value at the same position in the list of timer measurements, you can find the time at which this light value was recorded! At the end of the program, display both the maximum light value and the time at which it was recorded.

Hint: If you are programming with MakeCode, you may need to use the find index of block of the Arrays menu . This block finds the position of a value within an array. For example, this block will return the position of the first value equal to max in the array lightList: