Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON with a raspberry pi pico using digitalio NOT RPi.GPIO Function that displays a digit Write a function that takes an integer argument in the

PYTHON with a raspberry pi pico using digitalio NOT RPi.GPIOimage text in transcribedimage text in transcribed

Function that displays a digit Write a function that takes an integer argument in the range 0-9 and turns on the appropriate bars on the display chip to create that digit's shape. You have some artistic freedom. Some people like to be able to represent not only arguments 0-9 as shapes 0123456789, but also arguments 10-15 in hexadecimal (base 16). They use AbCdEF for the additional 6 digit shapes. You can make this possible in your function, or not. What do you want your function to do if it is called with an argument outside the range it can display? Think about how to code this efficiently! It should not have ten sections of code, one for each digit. Surely you can find a way to store information for which bars need to be lit to make the shape of each requested digit. List of lists? Dictionary of lists? List of sets? Show that your function can be called in turn with each digit, and displays them all properly. Do something with it Ok that was quite a bit of work already so let's keep this simple. Pick any one of these to implement: 1. Dice roller. While you hold down a PB switch, the display counts rapidly 123456123.. etc, counting pretty fast, but not so fast that you can't recognize the digits as they fly by. When you release the PB switch the display stops changing; that's your dice roll. You don't need a debouncing capacitor here; why do you not care if the switch opens/closes/opens a few times when you poke or release it? 2. Up/down counter. Use two PB switches connected to two digital inputs configured as counters. When you poke one PB switch ("up") the displayed digit increments, when you poke the other ("down") it decrements. What should it do if the poke count is >9 or

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions