Neon Realm

Day 9: Return with the Elixir – Storing and Retrieving Data

Day 9: Return with the Elixir – Storing and Retrieving Data


Welcome to Day 9 of your adventure with Kai and Orion! Today, we’ll learn how to store and retrieve data using the Raspberry Pi Pico W. This skill is essential for future missions as we prepare to restore Neon City’s power completely. Let’s dive into our mission!


Learning Objectives


By the end of this lesson, you will:


  • Understand how data storage works and the types of memory used in electronics.
  • Write and upload code to store and retrieve data using the Raspberry Pi Pico W.
  • Develop skills in managing data storage for future projects.


Materials Needed


  • Raspberry Pi Pico W
  • USB cable
  • Breadboard
  • Multiple LEDs
  • Photoresistors
  • Buttons
  • Resistors (220 ohm, 1K, 10K, 100K)
  • Jumper wires (Male to Male)


Story:


Scene Introduction:

The resistance headquarters buzzed with activity as Kai and Orion arrived. The air was filled with a mix of hope and urgency. They had disabled the energy drain, but their mission was far from over.


“Orion, how do we store the data we’ve gathered?” Kai asked, determination in his voice.


Orion’s eyes glowed with purpose. “Kai, we need to learn how to store and retrieve data using the Raspberry Pi Pico W. This will be essential for our final mission to restore the city’s power grid.”


Kai: “Data storage? How do we do that with the Pico W?”

Orion: “Data storage allows us to save information for future use. Using the Pico W’s memory, we can store and retrieve data, which will be crucial for our upcoming tasks.”


“Let’s get started,” Kai said, his hands already reaching for the breadboard.


Orion hovered closer, projecting a holographic display to guide Kai through the process. “First, we need to understand how data storage works and the types of memory we can use.”


Activity: Gather Materials and prepare your workspace


Kai: Arranging the components on the workbench “Okay, I’ve got everything we need. What’s next, Orion?”

Orion: Hovering near the workbench, his eyes glowing with excitement “First, we need to understand how data storage works and the different types of memory. Let’s begin.”


Learn a New Concept: Data Storage


Orion’s Explanation of Data Storage:


Orion: “Data storage involves saving information in a way that can be retrieved later. There are different types of memory, such as RAM (volatile memory) and Flash (non-volatile memory), each with its own applications.”

Kai: Examining the hologram “Got it. How do we use the Pico W’s memory to store data?”

Orion: “We’ll use the Pico W’s Flash memory to store data. Let’s start by writing a program to store and retrieve some basic information.”


Activity: Wire Your Circuit:

Circuit Diagram

Orion’s Tutorial on Wiring the Components:


1. Photoresistor:


  • Orion: “Place the photoresistor on the breadboard, ensuring each leg is on a different row.”
  • Orion: “Connect one leg of the photoresistor to a 3.3V pin on the Raspberry Pi Pico W using a jumper wire.”
  • Orion: “Connect the other leg of the photoresistor to one leg of the 10K ohm resistor.”
  • Orion: “Connect the other leg of the 10K ohm resistor to a ground (GND) pin on the Raspberry Pi Pico W.”
  • Orion: “Connect the junction between the photoresistor and the 10K ohm resistor to an ADC pin (e.g., GPIO pin 26) on the Raspberry Pi Pico W.”



2. Button:


  • Orion: “Place the button on the breadboard, ensuring each leg is on a different row.”

  • Orion: “Connect one leg of the button to a ground (GND) pin on the Raspberry Pi Pico W using a jumper wire.”

  • Orion: “Connect the other leg of the button to GPIO pin 16 on the Raspberry Pi Pico W using another jumper wire.”


Kai: