2 Digit Calculator with 7 Segment LED using bitwise AND, modulo and div with Raspberry pi pico W.

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025
  • Hello everyone, this is an upgrade from my previous calculator video. This calculator displays from 0-99. As you can see, I can calculate 32 + 47. You can see 2 digits. If I calculate 10 - 4, then, the calculator is smart enough to display only one digit and not the leading 0.
    I use bitwise AND to map each segment of the 7 segment display to a bit position in a byte. Recall that in this circuit 0 means on and 1 means off. I use mod 10 to calculate the remainder for the least significant digit (units). I use div 10 to calculate the tens value. The last tricky part is controlling the display. There is only 1 set of inputs for both the 7 segment LED displays. First, I have to turn the units on. During this time, the tens are off. Second, I turn off the units. Third, I turn on the tens. Fourth, I turn off the tens. Then I repeat forever, hence the “while True”. This happens so fast that your eye is tricked into believing both units and tens are on at the same time even though that is not true (only one digit is on at a time).

Комментарии •