/ese5190-2022-lab1-firefly-1

Lab 1: Yihan Wang, Worked with Xiayu Zeng

Primary LanguageRoffMIT LicenseMIT

Part 3:

In part 3, we use APDS9960 to detect color and display the detection results on RP2040. We enable the color detection function on APDS9960 and store the data in r, g, b and c, which represent red, green, blue and clear data detected by APDS9960’s sensor respectively. To display APDS9960’s sensor readings in real time, we have to change the number of samples for each sensor reading. In APDS9960’s data sheet, it shows that the value of color_integration_time determines time between readings. The default value is 256 and we could set this value small to speed up the sensor readings.

screenshot1

screenshot2 3 2

The display result is shown below:

4_4record_AdobeExpress

Clearer gifs are in the gif folder

Part 4:

In part 4, we visualize APDS9960’s brightness reading by sending keyboard output and displaying them on the laptop. The sensor reads brightness twice in a very short time and the data are saved in different variables. By comparing these variables, the controller knows whether the environment is getting brighter or darker. And when the brightness increases, the keyboard will output "Crazy Thursday !!!", press the "RETURN" key and the green LED on RP2040 blinks, while the brightness decreases, the keyboard will output "V me 50", press the "RETURN" key and the blue LED on RP2040 blinks. To break the program, an 'escape hatch' is settled as if the light intensity is too low, the code stops running.

The display result is shown below:

4 4 (1)

Clearer gifs are in the gif folder

diagram that showws how the components interact is showing below:

The111