电子技术论坛

 找回密码
 快速注册

QQ登录

只需一步,快速开始

搜索
搜索附件  
© 电子技术论坛 文件下载中心

遥控解码PT2262—2017-12-16.rar

 

备份一些以前编写的无线遥控资料RF315
RF315,stc15w04
androidstudio byte 16进显示测试


public  String byteToHex(byte b) {
        String strHex = Integer.toHexString(0xFF & b);
        if (strHex.length() == 1) {
            strHex = "0" + strHex;
        }
        return strHex;
    }
    //!16进字符打印
    public  void bytesToHex(byte[] bytes,int n) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append(byteToHex(bytes));
            mybyte = bytes;

        }
        mybyte_cnt = n;
//        for (byte b : bytes) {
//            sb.append(byteToHex(b));
//        }
       // return sb.toString();
        System.out.println("16进直接打印显示= " + sb.toString());
    }
    public  String bytesToHex_old(byte[] bytes,int cnt) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < cnt; i++) {
            sb.append((byteToHex(bytes)) + " ");//加空格


        }
        return sb.toString();
    }
    public  String bytesToHex_old_2(byte[] bytes) {
        StringBuilder sb = new StringBuilder();
        for (byte b : bytes) {
            sb.append(byteToHex(b));
        }
        return sb.toString();
    }

手机版|家电维修技术论坛 ( 鄂ICP备09003585号-2 )

GMT+8, 2026-6-13 19:27 , Processed in 0.061329 second(s), 6 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

CopyRight © 电子技术论坛
电子邮箱:8794149@qq.com | 联系 QQ:3081868839 | 官方网址:www.dzdu.com

Qiji. All Rights Reserved


服务条款 | 站长声明

Wuhan Qiji Technology Co., Ltd.武汉奇迹科技有限公司版权所有


鄂ICP备09003585号-2鄂公网安备42010602000420号