今天没有新动态
@kidultff

PAT-A 真题 – 1100 Mars Numbers

People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars.The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively. ...
  • 0
  • 0
@kidultff

PAT-A 真题 – 1108 Finding Average

The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. A legal input is a real number i ...
  • 0
  • 0
@kidultff

PAT-A 真题 – 1114 Family Property

This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we need to know the size of each family, and the averag ...
  • 0
  • 0
@kidultff

树莓派GPIO接开关按钮,并判断单击、双击、长按

树莓派接开关,只需要将一个脚接到3.3V电源,另一个脚接GPIO的输入即可。在Python中,可以通过GPIO库进行判断:import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUT)  & ...
  • 0
  • 1
@kidultff

树莓派3b强行驱动无源蜂鸣器

有源蜂鸣器:自带高频振荡,直接上电并加信号即可蜂鸣,一般引线有3根无源蜂鸣器:不带高频振荡,需要外加震荡才能工作,一般引线有两根。如果你想给树莓派加上个蜂鸣器但是又不想购买,从贺卡或闹钟拆下的蜂鸣器一般就是无源蜂鸣器。我们可以利用 ...
  • 0
  • 3