自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 STM32F103C8T6 CubeMX I2C EEPROM AT24C256

1. 修改usart.c,将printf转为串口打印/* USER CODE BEGIN 0 */#include "stdio.h"int fputc(int ch, FILE *f){ /* Place your implementation of fputc here */ /* e.g. write a character to the USART2 and Loop until the end of transmission */ ...

2020-08-03 17:03:11 1710

原创 STM32 HAL Custom HID

1.设置CubeMx2.代码修改usbd_custom_hid_if.c中结构体数据:__ALIGN_BEGIN static uint8_t CUSTOM_HID_ReportDesc_FS[USBD_CUSTOM_HID_REPORT_DESC_SIZE] __ALIGN_END ={ /* USER CODE BEGIN 0 */ 0x06, 0x00, 0xff, // USAGE_PAGE (Vendor D...

2020-07-29 10:35:15 1165

原创 STM32 HAL ADC轮询模式和中断模式

轮询模式:#include <stdio.h>#include <string.h>main.c/* USER CODE BEGIN 2 */uint32_t iOrder = 0;uint8_t aTxBuffer[100] = { 0 };HAL_ADCEx_Calibration_Start(&hadc1);/* USER CODE END 2 */ while (1) { /* USER COD...

2020-07-26 04:33:20 5243 1

原创 STM32 UART HAL数据发送

1. 打开CubeMX,选择ACCESS TO MCU SELECTOR.2.输入或选择stm32f103C83. 选择SYS下的 Serial Wire,提供STLink v2代码下载和调试支持,如果不选择,下次会无法下载代码(如果是这样,按住单片机上的复位键不放,点击下载代码后快速放开复位键)4.RCC下HSE和LSE选择晶振5. Connectivity下选择异步通讯模式NVIC下勾选中断6.时钟配置下直接填写727.配置项目8.

2020-07-25 00:19:06 876

原创 Android Studio Jar包使用一

编写Jar包:1. 新建工程android app下右键 New->Module修改代码如下:package net.appseed.tool1;public class LogToolA { public LogToolA() { } public static void Prints() { Sy...

2019-12-17 16:47:59 260

原创 Android Studio NDK使用一

这里使用手工编译的方式,Android Studio版本3.5.x。1. 下载配置好NDK2. 配置NDK环境变量打开命令行,输入ndk-build, 如果有以下输出,则配置正确。3. 打开Android Studio, 使用AS生成库的头文件(手工写也可以但是麻烦)新建一个默认空项目:新建一个类:新建类后,修改...

2019-12-12 15:43:23 300

原创 Android 页面跳转数据传递

由Activity PageA到 Activity PageB;A->B 传递数据:A:初始化数据:Intent itt = new Intent(MainActivity.this, Page2Activity.class);itt.putExtra("data","come in 1");//数据传递给下个ActivitystartActivityForResu...

2019-06-12 11:24:11 740

原创 Android Studio Service 篇一

最基本的Service1. 新建项目新建类代码:MyService.javapackage com.appseed.appservicedemo;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.widget....

2019-04-24 14:17:55 5637

原创 Android 自定义View

1.新建工程2.主MainActivity增加一个函数package com.appseed.app03;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.widget.Toast;public class MainActivity ext...

2019-04-03 00:33:41 283

原创 Android 页面跳转

1.新建工程2.修改界面和代码新增代码:public void Jump(View view){ Intent intent = new Intent(); intent.setClass(MainActivity.this, Main2Activity.class); startActivity(intent);}/*按钮函数响应*/...

2019-03-31 00:50:10 8188 3

原创 Android 生命周期中函数执行过程

06-26 07:45:18.677 5029-5029/cn.sofya.apptest1 I/ MainActivity 1: onCreate called.06-26 07:45:18.685 5029-5029/cn.sofya.apptest1 I/ MainActivity 1: onStart called.06-26 07:45:18.703 5029-5029/cn.s

2017-06-26 16:39:37 495

原创 Android 禁止翻转

xml version="1.0" encoding="utf-8"?>manifest xmlns:android="http://schemas.android.com/apk/res/android"package="cn.appio.testedit">application android:allowBackup="true" android:icon="@mip

2017-06-24 13:57:31 1039

原创 Android基本控件 - 文本框

android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.c

2017-06-23 16:56:55 4864

原创 Android基础控件 - 按钮

app\res\layout\xxx.xml    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_hei

2017-06-23 16:20:21 315

原创 Android ConstraintLayout总结

参考文章:  为什么ConstraintLayout代替其他布局?    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:id="@+id/constraintLayout"

2017-06-17 00:52:01 344

转载 android 获取状态栏高度

/**  * 获取状态栏高度——方法1  * */  int statusBarHeight1 = -1;  //获取status_bar_height资源的ID  int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");  if (resourceId >

2017-06-16 12:24:34 354

原创 Android代码创建控件

Android默认使用Constraint Layout布局,需要给该布局添加一个IDxml version="1.0" encoding="utf-8"?>android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app

2017-06-14 19:26:11 2089

原创 AndroidStudio 配置adb shell

1.右键电脑-属性-高级配置-环境变量2.本机搜索adb.exe,找到所在目录platform-tools 和 tools我的安装目录:C:\Users\Sofia\AppData\Local\Android\sdk\platform-toolsC:\Users\Sofia\AppData\Local\Android\sdk\tools3. 新建系统环境变量 andro

2017-06-13 20:36:25 1780

原创 AndroidSutdio本地数据存储-SharedPreferences

private class MyBtn1OnClickListener implements View.OnClickListener {        public void onClick(View v) {            SharedPreferences sp = getSharedPreferences("FanNengTec", Context.MODE_PRIVATE

2017-06-12 21:34:24 197

原创 AndroidStudio 子线程通知主线程Demo

import android.os.Handler;import android.os.Looper;import android.os.Message;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.Log;import android

2017-06-12 20:08:07 3156

原创 AndroidStudio界面和代码关联

//activity_main.xmlxml version="1.0" encoding="utf-8"?>android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.c

2017-06-12 19:20:42 2373

原创 AndroidStudio访问网络-Post方式

public boolean dealLogin() {        boolean bLogin = false;        //////////////////////////////////////////////////////////////////////////////////////        String StrResponseBody = null;

2017-06-12 19:05:50 5768 1

原创 AndroidStudio 线程

package com.example.sofia.testactivityactive;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.Log;public class MainActivity extends AppCompa

2017-06-12 18:44:27 2243

原创 AndroidStudio ImageView全屏显示

import android.content.Context;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.util.DisplayMetrics;import android.view.WindowManager;import android.widget.

2017-06-12 18:35:38 1590

原创 AndroidStudio获得屏幕分辨率

DisplayMetrics dm = getResources().getDisplayMetrics();int displayWidth = dm.widthPixels;int displayHeight = dm.heightPixels;

2017-06-12 18:29:34 1894

原创 AndroidStudio 隐藏状态栏和标题栏

public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 隐藏标题栏 if ...

2017-06-12 17:46:25 834

原创 IOS Swift3.1 界面中画定位线

//使用百分比画横线    func setHLine(pos:CGFloat) {        let rLinePos:CGFloat = pos * UIScreen.main.bounds.height        let line: UIView = UIView(frame: CGRect(x: 0, y: Int(rLinePos), width: Int(UIScr

2017-06-10 13:26:18 288

原创 IOS Swift3.1 获得文本宽度

func getStringRect(text:String, font:UIFont) -> CGRect {        let nsText: NSString = NSString( string: text )        let size:CGSize = CGSize(width: UIScreen.main.bounds.width, height: 0)     

2017-06-09 23:26:25 828

原创 IOS Swift3.1 打印系统所有字体

func PrintFonts() {                let familyNames = UIFont.familyNames        var index:Int = 0        for familyName in familyNames        {            let fontNames = UIFont.fontNames(f

2017-06-09 19:45:50 973

原创 IOS Swift3.1 打印视图生命周期

import UIKitclass ViewController: UIViewController {    override func viewDidLoad() {        super.viewDidLoad()        // Do any additional setup after loading the view, typically from a

2017-06-07 18:01:44 332

原创 IOS Swift3.1打印所有已经加载的viewcontroller

var topVC = UIApplication.shared.keyWindow?.rootViewController        while topVC != nil {            print( topVC! )            topVC = topVC?.presentedViewController        }

2017-06-06 16:46:10 308

原创 IOS Swift3.1 删除UIViewController

在某些情况下,我们需要删除VC,比如自定义的 启动画面后面一个登陆界面,这样这两个界面在等陆后就不再使用了。 class VC1: UIViewController {    override func viewDidLoad() {        super.viewDidLoad()        let lab :UILabel = UILabel(fra

2017-06-06 14:37:33 852

原创 IOS Swift3.1 手工代码编写主视图

1. 普通页面控制器func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {        // Override point for customization af

2017-06-06 11:59:01 334

原创 IOS Swift3.1保存数据

1. 配置文件内数据//读取        let b:String = UserDefaults.standard.string(forKey: "abc")!        print( b )//写入UserDefaults.standard.setValue("123", forKey: "abc")2. 全局数据,利用AppDelegate单实例特性

2017-06-05 12:22:46 311

原创 IOS Swift3.1 手动页面跳转

//跳转self.present(Page1_Spash(), animated: false, completion: nil)//返回self.dismiss(animated: false, completion: nil)

2017-06-04 22:33:35 1542

原创 IOS swift3.1 创建Swift空工程(无storyBoard)纯代码方式编写APP

1.新建工程2找到工程的TAGETS/General/Deployment Info 如下图,删除Main。.3.删除Main.storyboard,选择“Move to Trash"( 这里不需要删除info.plist中的 Main storyboard file base name项,已经不在了)4. 在AppDelegate.

2017-06-04 02:17:54 1580

原创 IOS基础控件 UISwitch swift3.1

////  ViewController.swift//  uiSwitch////  Created by hong wang on 2017/6/2.//  Copyright © 2017年 appio. All rights reserved.//import UIKitclass ViewController: UIViewControll

2017-06-03 01:50:18 575

原创 IOS基础控件 Layer swift3.1

////  ViewController.swift//  Layer////  Created by hong wang on 2017/6/2.//  Copyright © 2017年 appio. All rights reserved.//import UIKitclass ViewController: UIViewController

2017-06-03 01:00:53 368

原创 IOS基础控件 UIImageView swift3.1

////  ViewController.swift//  UIImageView////  Created by hong wang on 2017/6/2.//  Copyright © 2017年 appio. All rights reserved.//import UIKitclass ViewController: UIViewContr

2017-06-02 22:22:44 358

原创 IOS基础控件 UIButton swift3.1

////  ViewController.swift//  UIButton////  Created by hong wang on 2017/6/1.//  Copyright © 2017年 appio. All rights reserved.//import UIKitclass ViewController: UIViewControll

2017-06-02 16:38:02 830

空空如也

空空如也

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

TA关注的人

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