自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 C51单片机:使用十个数码管显示十位数的学号

仿真图:代码:#include <reg52.h>#define uchar unsigned charunsigned char dm[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};//数码管段码void delay();//延时函数void main()//主函数{ P1=~0x01;//开千万位,位码 P2=dm[3];//千万位赋值3 delay(); P1=~0x02;//开百万

2021-12-01 12:13:24 4608 1

原创 C51单片机:定时器控制二位数码管,每过三秒加一(多..c文件版)

c1.c#include <reg52.h>#include "c2.h"#define uchar unsigned charunsigned char dm[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};//段码uchar num=0;xh=23; //全局变量,num控制定时器时间,xh为数码管显示初始值sbit ge=P1^1; //个位sbit shi=P1^0; //十位void delay(); //

2021-11-22 23:29:16 2727

原创 linux(Ubuntu、虚拟机):点击LCD触控屏,在终端显示点击点的坐标

效果图:代码:#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <linux/input.h>#include <stdio.h>int main(int argc, char const *argv[]){ struct input_event input_buf; int

2021-11-06 17:48:42 2066

原创 linux(虚拟机、Ubuntu):在LCD上显示四张图片(田字排版)

效果图:终端编译:图片信息:代码:#include <stdio.h>#include <sys/stat.h>#include <sys/mman.h>#include <sys/types.h>#include <fcntl.h>#include <unistd.h>int main(int argc , char **argv){ int x , y ; unsigned.

2021-11-06 16:28:56 1905 5

原创 Android studio(安卓应用开发):实现微信中,“微信”和“我的”页面

效果图:(细节图片自换)代码:app-java-com.example.a1031-MainActivitypackage com.example.a1031;import android.annotation.SuppressLint;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.app.FragmentManag.

2021-11-06 11:10:13 10132 4

原创 C51单片机:定时器控制led亮3秒,灭5秒。如此循环

仿真图:代码:#include <reg52.h>#define uchar unsigned charuchar num=0; //全局变量numsbit led=P2^0;//p2.0口控制led灯void main(){ led=1;//led初始为亮 TMOD=0x01; TH0=0x3c;//高四位 TL0=0xb0;//低四位,延时50ms EA = 1;//打开总中断 ET0 = 1;//T1开,定时器溢出 TR0 =1;//开定时器..

2021-11-03 16:14:06 12090 3

原创 Android studio(安卓应用开发):简单注册页面。能输入数据,点击按键颜色变化

图片效果:代码1:drawable新建values文件<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <!-- 定义当button 处于pressed 状态时的形态。-->

2021-11-02 18:46:01 426

原创 Android studio(安卓应用开发):点击下方九张图片中任意一张,放大显示在上方

图片效果:代码1:package com.example.a0925;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ImageView;public class MainActivity extends AppCompatActivi

2021-10-31 17:30:07 1984

原创 python:定义一个类,计算两个坐标之间的距离

代码:import math #导入math class Point: #定义一个类 def __init__(self,x=0,y=0,z=0): #初始化x,y,z self.x=x self.y=y self.z=z def getx(self): #得到x坐标 return self.x def gety(self): #得到y坐标 return self.y def g

2021-10-31 17:22:12 4685

原创 python:百元百鸡

代码:

2021-10-31 17:19:06 161

原创 python:斐波那数

代码:

2021-10-31 17:17:57 74

原创 python:水仙花数

代码:

2021-10-31 17:16:37 130

原创 linux(虚拟机、Ubuntu):LCD模拟器显示图片

.c文件代码:#include <stdio.h> //printf scanf#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <fcntl.h> //open read lseek write close#include <sys/mman.h> //mmapint main(int argc, char **argv)

2021-10-31 17:09:54 4426 7

原创 linux(虚拟机、Ubuntu):LCD模拟器显示各种颜色

.c文件编码:#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <sys/mman.h>int main(int argc,char **argv){ unsigned int x,y; /*1.打开LCD设备 */ int fd_lcd

2021-10-31 17:05:50 5234 5

原创 linux(虚拟机、Ubuntu):编码实现把文件1(1.txt)复制到文件2(2.txt)

#include<sys/types.h>#include<sys/stat.h>#include <fcntl.h>#include<unistd.h>#include <stdio.h>#include <string.h>int main(int argc, char const *argv[]){ int a, b; char buff[64], buff1[58]; int fd = open("1.tx.

2021-10-31 17:01:35 1779

原创 C51单片机:数码管显示初始值0-999,按键控制初始值加,减

#include <REGX51.H>void DelayMs(unsigned int x);//延时函数声明unsigned char code Ledcode[16]={0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82,0XF8,0X80,0X90};//定义字符型数组sbit S1 = P1^0;//加按钮sbit S2 = P1^1;//减按钮void DelayMs(unsigned int x)//定义延时函数{ unsigned char i;.

2021-10-31 16:54:16 10642 1

原创 C51单片机:点击一次按键,实现LED显示状态的亮灭转变

#include <REGX52.H>sbit led=P1^0;//p1.0口接ledsbit button=P3^0;//p3.0口接控制int i,j;//整数i,jvoid main( )//主函数{ led=1;//led初始状态 while(1)//循环 { if(button==0)//按下开关 { for(i=0;i<10;i++);//延时去抖 while(button==0);//检测松手 l.

2021-10-31 16:49:25 9833

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除