Practice Program 2: Reading Pushbutton Input and Controlling LED - 4.2 | EXPERIMENT NO. 9 TITLE: Introduction to ARM Microcontrollers - Basic I/O and Peripherals | Microcontroller Lab
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

What does GPIO stand for?

💡 Hint: Think about how a pin can act as either input or output.

Question 2

Easy

What is the purpose of the RCC register?

💡 Hint: RCC is about 'Reset' and 'Clock'.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What is the purpose of GPIO pins?

  • Only for outputs
  • To connect to sensors
  • For input or output

💡 Hint: Remember that GPIO stands for General Purpose Input/Output.

Question 2

True or False: The IDR register is used for writing data to output pins.

  • True
  • False

💡 Hint: Recall the function of the IDR register regarding inputs.

Solve and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Write a complete C program for STM32 microcontroller that reads a pushbutton state to toggle an LED using direct register access.

💡 Hint: Don't forget the internal pull-up for the button!

Question 2

Calculate the necessary setup if the pushbutton is active-high instead of active-low. What changes in the code?

💡 Hint: What happens if the logic is inverted?

Challenge and get performance evaluation