const gzipHeader = Buffer.from([0x1f, 0x8b])

本文解释了出现constgzipHeader=Buffer.from([0x1f,0x8b])错误的原因,通常是因为使用了过旧的Node.js版本。解决方法是访问Node.js官方网站下载并安装最新版或推荐版本。

出现const gzipHeader = Buffer.from([0x1f, 0x8b])的错误是因为node的版本太低,可以到node官网(https://nodejs.org/en/)下载最新版或者官网推荐版本。

重新安装即可。

#include <stdio.h> #include "esp_log.h" #include "driver/i2c.h" static const char *TAG = "i2c-simple-example"; #define I2C_MASTER_SCL_IO 17 /*!< GPIO number used for I2C master clock */ #define I2C_MASTER_SDA_IO 18 /*!< GPIO number used for I2C master data */ #define I2C_MASTER_NUM 0 /*!< I2C master i2c port number, the number of i2c peripheral interfaces available will depend on the chip */ #define I2C_MASTER_FREQ_HZ 100000 /*!< I2C master clock frequency */ #define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */ #define I2C_MASTER_TIMEOUT_MS 100 #define OLED_ADDR 0x3C // OLED的IIC地址,逻辑分析仪读出的 #define OLED_CMD 0 #define OLED_DATA 1 // OLED 6*8字库 unsigned char F6x8[][6] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // sp {0x00, 0x00, 0x00, 0x2f, 0x00, 0x00}, // ! {0x00, 0x00, 0x07, 0x00, 0x07, 0x00}, // " {0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14}, // # {0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12}, // $ {0x00, 0x62, 0x64, 0x08, 0x13, 0x23}, // % {0x00, 0x36, 0x49, 0x55, 0x22, 0x50}, // & {0x00, 0x00, 0x05, 0x03, 0x00, 0x00}, // ' {0x00, 0x00, 0x1c, 0x22, 0x41, 0x00}, // ( {0x00, 0x00, 0x41, 0x22, 0x1c, 0x00}, // ) {0x00, 0x14, 0x08, 0x3E, 0x08, 0x14}, // * {0x00, 0x08, 0x08, 0x3E, 0x08, 0x08}, // + {0x00, 0x00, 0x00, 0xA0, 0x60, 0x00}, // , {0x00, 0x08, 0x08, 0x08, 0x08, 0x08}, // - {0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, // . {0x00, 0x20, 0x10, 0x08, 0x04, 0x02}, // / {0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E}, // 0 {0x00, 0x00, 0x42, 0x7F, 0x40, 0x00}, // 1 {0x00, 0x42, 0x61, 0x51, 0x49, 0x46}, // 2 {0x00, 0x21, 0x41, 0x45, 0x4B, 0x31}, // 3 {0x00, 0x18, 0x14, 0x12, 0x7F, 0x10}, // 4 {0x00, 0x27, 0x45, 0x45, 0x45, 0x39}, // 5 {0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30}, // 6 {0x00, 0x01, 0x71, 0x09, 0x05, 0x03}, // 7 {0x00, 0x36, 0x49, 0x49, 0x49, 0x36}, // 8 {0x00, 0x06, 0x49, 0x49, 0x29, 0x1E}, // 9 {0x00, 0x00, 0x36, 0x36, 0x00, 0x00}, // : {0x00, 0x00, 0x56, 0x36, 0x00, 0x00}, // ; {0x00, 0x08, 0x14, 0x22, 0x41, 0x00}, // < {0x00, 0x14, 0x14, 0x14, 0x14, 0x14}, // = {0x00, 0x00, 0x41, 0x22, 0x14, 0x08}, // > {0x00, 0x02, 0x01, 0x51, 0x09, 0x06}, // ? {0x00, 0x32, 0x49, 0x59, 0x51, 0x3E}, // @ {0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C}, // A {0x00, 0x7F, 0x49, 0x49, 0x49, 0x36}, // B {0x00, 0x3E, 0x41, 0x41, 0x41, 0x22}, // C {0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C}, // D {0x00, 0x7F, 0x49, 0x49, 0x49, 0x41}, // E {0x00, 0x7F, 0x09, 0x09, 0x09, 0x01}, // F {0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A}, // G {0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F}, // H {0x00, 0x00, 0x41, 0x7F, 0x41, 0x00}, // I {0x00, 0x20, 0x40, 0x41, 0x3F, 0x01}, // J {0x00, 0x7F, 0x08, 0x14, 0x22, 0x41}, // K {0x00, 0x7F, 0x40, 0x40, 0x40, 0x40}, // L {0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F}, // M {0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F}, // N {0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E}, // O {0x00, 0x7F, 0x09, 0x09, 0x09, 0x06}, // P {0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E}, // Q {0x00, 0x7F, 0x09, 0x19, 0x29, 0x46}, // R {0x00, 0x46, 0x49, 0x49, 0x49, 0x31}, // S {0x00, 0x01, 0x01, 0x7F, 0x01, 0x01}, // T {0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F}, // U {0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F}, // V {0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F}, // W {0x00, 0x63, 0x14, 0x08, 0x14, 0x63}, // X {0x00, 0x07, 0x08, 0x70, 0x08, 0x07}, // Y {0x00, 0x61, 0x51, 0x49, 0x45, 0x43}, // Z {0x00, 0x00, 0x7F, 0x41, 0x41, 0x00}, // [ {0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55}, // 55 {0x00, 0x00, 0x41, 0x41, 0x7F, 0x00}, // ] {0x00, 0x04, 0x02, 0x01, 0x02, 0x04}, // ^ {0x00, 0x40, 0x40, 0x40, 0x40, 0x40}, // _ {0x00, 0x00, 0x01, 0x02, 0x04, 0x00}, // ' {0x00, 0x20, 0x54, 0x54, 0x54, 0x78}, // a {0x00, 0x7F, 0x48, 0x44, 0x44, 0x38}, // b {0x00, 0x38, 0x44, 0x44, 0x44, 0x20}, // c {0x00, 0x38, 0x44, 0x44, 0x48, 0x7F}, // d {0x00, 0x38, 0x54, 0x54, 0x54, 0x18}, // e {0x00, 0x08, 0x7E, 0x09, 0x01, 0x02}, // f {0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C}, // g {0x00, 0x7F, 0x08, 0x04, 0x04, 0x78}, // h {0x00, 0x00, 0x44, 0x7D, 0x40, 0x00}, // i {0x00, 0x40, 0x80, 0x84, 0x7D, 0x00}, // j {0x00, 0x7F, 0x10, 0x28, 0x44, 0x00}, // k {0x00, 0x00, 0x41, 0x7F, 0x40, 0x00}, // l {0x00, 0x7C, 0x04, 0x18, 0x04, 0x78}, // m {0x00, 0x7C, 0x08, 0x04, 0x04, 0x78}, // n {0x00, 0x38, 0x44, 0x44, 0x44, 0x38}, // o {0x00, 0xFC, 0x24, 0x24, 0x24, 0x18}, // p {0x00, 0x18, 0x24, 0x24, 0x18, 0xFC}, // q {0x00, 0x7C, 0x08, 0x04, 0x04, 0x08}, // r {0x00, 0x48, 0x54, 0x54, 0x54, 0x20}, // s {0x00, 0x04, 0x3F, 0x44, 0x40, 0x20}, // t {0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C}, // u {0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C}, // v {0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C}, // w {0x00, 0x44, 0x28, 0x10, 0x28, 0x44}, // x {0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C}, // y {0x00, 0x44, 0x64, 0x54, 0x4C, 0x44}, // z {0x14, 0x14, 0x14, 0x14, 0x14, 0x14}, // horiz lines }; // OLED 8*16字库 unsigned char F8X16[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x30, 0x00, 0x00, 0x00, //! 1 0x00, 0x10, 0x0C, 0x06, 0x10, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //" 2 0x40, 0xC0, 0x78, 0x40, 0xC0, 0x78, 0x40, 0x00, 0x04, 0x3F, 0x04, 0x04, 0x3F, 0x04, 0x04, 0x00, //# 3 0x00, 0x70, 0x88, 0xFC, 0x08, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0xFF, 0x21, 0x1E, 0x00, 0x00, //$ 4 0xF0, 0x08, 0xF0, 0x00, 0xE0, 0x18, 0x00, 0x00, 0x00, 0x21, 0x1C, 0x03, 0x1E, 0x21, 0x1E, 0x00, //% 5 0x00, 0xF0, 0x08, 0x88, 0x70, 0x00, 0x00, 0x00, 0x1E, 0x21, 0x23, 0x24, 0x19, 0x27, 0x21, 0x10, //& 6 0x10, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //' 7 0x00, 0x00, 0x00, 0xE0, 0x18, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x00, //( 8 0x00, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, //) 9 0x40, 0x40, 0x80, 0xF0, 0x80, 0x40, 0x40, 0x00, 0x02, 0x02, 0x01, 0x0F, 0x01, 0x02, 0x02, 0x00, //* 10 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x1F, 0x01, 0x01, 0x01, 0x00, //+ 11 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xB0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, //, 12 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, //- 13 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, //. 14 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x04, 0x00, 0x60, 0x18, 0x06, 0x01, 0x00, 0x00, 0x00, /// 15 0x00, 0xE0, 0x10, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x00, 0x0F, 0x10, 0x20, 0x20, 0x10, 0x0F, 0x00, // 0 16 0x00, 0x10, 0x10, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // 1 17 0x00, 0x70, 0x08, 0x08, 0x08, 0x88, 0x70, 0x00, 0x00, 0x30, 0x28, 0x24, 0x22, 0x21, 0x30, 0x00, // 2 18 0x00, 0x30, 0x08, 0x88, 0x88, 0x48, 0x30, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x11, 0x0E, 0x00, // 3 19 0x00, 0x00, 0xC0, 0x20, 0x10, 0xF8, 0x00, 0x00, 0x00, 0x07, 0x04, 0x24, 0x24, 0x3F, 0x24, 0x00, // 4 20 0x00, 0xF8, 0x08, 0x88, 0x88, 0x08, 0x08, 0x00, 0x00, 0x19, 0x21, 0x20, 0x20, 0x11, 0x0E, 0x00, // 5 21 0x00, 0xE0, 0x10, 0x88, 0x88, 0x18, 0x00, 0x00, 0x00, 0x0F, 0x11, 0x20, 0x20, 0x11, 0x0E, 0x00, // 6 22 0x00, 0x38, 0x08, 0x08, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, // 7 23 0x00, 0x70, 0x88, 0x08, 0x08, 0x88, 0x70, 0x00, 0x00, 0x1C, 0x22, 0x21, 0x21, 0x22, 0x1C, 0x00, // 8 24 0x00, 0xE0, 0x10, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x00, 0x00, 0x31, 0x22, 0x22, 0x11, 0x0F, 0x00, // 9 25 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, //: 26 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, //; 27 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, //< 28 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, //= 29 0x00, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, //> 30 0x00, 0x70, 0x48, 0x08, 0x08, 0x08, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x30, 0x36, 0x01, 0x00, 0x00, //? 31 0xC0, 0x30, 0xC8, 0x28, 0xE8, 0x10, 0xE0, 0x00, 0x07, 0x18, 0x27, 0x24, 0x23, 0x14, 0x0B, 0x00, //@ 32 0x00, 0x00, 0xC0, 0x38, 0xE0, 0x00, 0x00, 0x00, 0x20, 0x3C, 0x23, 0x02, 0x02, 0x27, 0x38, 0x20, // A 33 0x08, 0xF8, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x11, 0x0E, 0x00, // B 34 0xC0, 0x30, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x07, 0x18, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, // C 35 0x08, 0xF8, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x10, 0x0F, 0x00, // D 36 0x08, 0xF8, 0x88, 0x88, 0xE8, 0x08, 0x10, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x23, 0x20, 0x18, 0x00, // E 37 0x08, 0xF8, 0x88, 0x88, 0xE8, 0x08, 0x10, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x03, 0x00, 0x00, 0x00, // F 38 0xC0, 0x30, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x07, 0x18, 0x20, 0x20, 0x22, 0x1E, 0x02, 0x00, // G 39 0x08, 0xF8, 0x08, 0x00, 0x00, 0x08, 0xF8, 0x08, 0x20, 0x3F, 0x21, 0x01, 0x01, 0x21, 0x3F, 0x20, // H 40 0x00, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // I 41 0x00, 0x00, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x00, 0xC0, 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, 0x00, // J 42 0x08, 0xF8, 0x88, 0xC0, 0x28, 0x18, 0x08, 0x00, 0x20, 0x3F, 0x20, 0x01, 0x26, 0x38, 0x20, 0x00, // K 43 0x08, 0xF8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x30, 0x00, // L 44 0x08, 0xF8, 0xF8, 0x00, 0xF8, 0xF8, 0x08, 0x00, 0x20, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x20, 0x00, // M 45 0x08, 0xF8, 0x30, 0xC0, 0x00, 0x08, 0xF8, 0x08, 0x20, 0x3F, 0x20, 0x00, 0x07, 0x18, 0x3F, 0x00, // N 46 0xE0, 0x10, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x0F, 0x10, 0x20, 0x20, 0x20, 0x10, 0x0F, 0x00, // O 47 0x08, 0xF8, 0x08, 0x08, 0x08, 0x08, 0xF0, 0x00, 0x20, 0x3F, 0x21, 0x01, 0x01, 0x01, 0x00, 0x00, // P 48 0xE0, 0x10, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x0F, 0x18, 0x24, 0x24, 0x38, 0x50, 0x4F, 0x00, // Q 49 0x08, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x03, 0x0C, 0x30, 0x20, // R 50 0x00, 0x70, 0x88, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x38, 0x20, 0x21, 0x21, 0x22, 0x1C, 0x00, // S 51 0x18, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x00, 0x00, // T 52 0x08, 0xF8, 0x08, 0x00, 0x00, 0x08, 0xF8, 0x08, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, // U 53 0x08, 0x78, 0x88, 0x00, 0x00, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x07, 0x38, 0x0E, 0x01, 0x00, 0x00, // V 54 0xF8, 0x08, 0x00, 0xF8, 0x00, 0x08, 0xF8, 0x00, 0x03, 0x3C, 0x07, 0x00, 0x07, 0x3C, 0x03, 0x00, // W 55 0x08, 0x18, 0x68, 0x80, 0x80, 0x68, 0x18, 0x08, 0x20, 0x30, 0x2C, 0x03, 0x03, 0x2C, 0x30, 0x20, // X 56 0x08, 0x38, 0xC8, 0x00, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x00, 0x00, // Y 57 0x10, 0x08, 0x08, 0x08, 0xC8, 0x38, 0x08, 0x00, 0x20, 0x38, 0x26, 0x21, 0x20, 0x20, 0x18, 0x00, // Z 58 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x00, //[ 59 0x00, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x38, 0xC0, 0x00, //\ 60 0x00, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x7F, 0x00, 0x00, 0x00, //] 61 0x00, 0x00, 0x04, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //^ 62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, //_ 63 0x00, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //` 64 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x19, 0x24, 0x22, 0x22, 0x22, 0x3F, 0x20, // a 65 0x08, 0xF8, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x11, 0x20, 0x20, 0x11, 0x0E, 0x00, // b 66 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0x20, 0x11, 0x00, // c 67 0x00, 0x00, 0x00, 0x80, 0x80, 0x88, 0xF8, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0x10, 0x3F, 0x20, // d 68 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x22, 0x22, 0x22, 0x22, 0x13, 0x00, // e 69 0x00, 0x80, 0x80, 0xF0, 0x88, 0x88, 0x88, 0x18, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // f 70 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x6B, 0x94, 0x94, 0x94, 0x93, 0x60, 0x00, // g 71 0x08, 0xF8, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x3F, 0x21, 0x00, 0x00, 0x20, 0x3F, 0x20, // h 72 0x00, 0x80, 0x98, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // i 73 0x00, 0x00, 0x00, 0x80, 0x98, 0x98, 0x00, 0x00, 0x00, 0xC0, 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, // j 74 0x08, 0xF8, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x20, 0x3F, 0x24, 0x02, 0x2D, 0x30, 0x20, 0x00, // k 75 0x00, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // l 76 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x3F, 0x20, 0x00, 0x3F, // m 77 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x3F, 0x21, 0x00, 0x00, 0x20, 0x3F, 0x20, // n 78 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, // o 79 0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xA1, 0x20, 0x20, 0x11, 0x0E, 0x00, // p 80 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0xA0, 0xFF, 0x80, // q 81 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x20, 0x20, 0x3F, 0x21, 0x20, 0x00, 0x01, 0x00, // r 82 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x33, 0x24, 0x24, 0x24, 0x24, 0x19, 0x00, // s 83 0x00, 0x80, 0x80, 0xE0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x00, 0x00, // t 84 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x10, 0x3F, 0x20, // u 85 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x01, 0x0E, 0x30, 0x08, 0x06, 0x01, 0x00, // v 86 0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0F, 0x30, 0x0C, 0x03, 0x0C, 0x30, 0x0F, 0x00, // w 87 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x31, 0x2E, 0x0E, 0x31, 0x20, 0x00, // x 88 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x81, 0x8E, 0x70, 0x18, 0x06, 0x01, 0x00, // y 89 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x21, 0x30, 0x2C, 0x22, 0x21, 0x30, 0x00, // z 90 0x00, 0x00, 0x00, 0x00, 0x80, 0x7C, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x40, 0x40, //{ 91 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, //| 92 0x00, 0x02, 0x02, 0x7C, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x3F, 0x00, 0x00, 0x00, 0x00, //} 93 0x00, 0x06, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //~ 94 }; // OLED 中文字库 unsigned char Hzk[][32] = { {0xE0, 0x00, 0xFF, 0x10, 0xE4, 0x24, 0xFF, 0x24, 0xE4, 0x10, 0xE8, 0x27, 0xB4, 0x2C, 0xE0, 0x00}, {0x01, 0x00, 0xFF, 0x10, 0x09, 0x05, 0xFF, 0x05, 0x19, 0x80, 0x4F, 0x20, 0x1F, 0x20, 0xCF, 0x00}, /*"懒",0*/ {0x00, 0x08, 0x88, 0x88, 0x89, 0x8E, 0x88, 0xF8, 0x88, 0x8C, 0x8B, 0x88, 0x88, 0x08, 0x00, 0x00}, {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00}, /*"羊",1*/ {0x00, 0x08, 0x88, 0x88, 0x89, 0x8E, 0x88, 0xF8, 0x88, 0x8C, 0x8B, 0x88, 0x88, 0x08, 0x00, 0x00}, {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xFF, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00} /*"羊",2*/ }; // 函数声明 static esp_err_t i2c_master_init(void); static esp_err_t OLED_WR_Byte(uint8_t data, uint8_t cmd_); void OLED_Init(void); void OLED_Set_Pos(uint8_t x, uint8_t y); void OLED_ShowChar(uint8_t x, uint8_t y, uint8_t chr, uint8_t Char_Size); void OLED_Clear(void); void OLED_ShowNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len, uint8_t size2); uint32_t oled_pow(uint8_t m, uint8_t n); void OLED_ShowString(uint8_t x, uint8_t y, char *chr, uint8_t Char_Size); void OLED_ShowCHinese(uint8_t x, uint8_t y, uint8_t no); /** * @description: 主函数 * @return 无 */ void app_main(void) { // IIC总线主机初始化 ESP_ERROR_CHECK(i2c_master_init()); ESP_LOGI(TAG, "I2C initialized successfully"); // OLED屏幕初始化 OLED_Init(); // 显示汉字 OLED_ShowCHinese(0 * 18, 0, 0); OLED_ShowCHinese(1 * 18, 0, 1); OLED_ShowCHinese(2 * 18, 0, 2); // 显示单个字符 OLED_ShowChar(0, 2, 'Q', 16); // 显示字符串 OLED_ShowString(0, 4, "Fairy tale", 16); // 显示数字 OLED_ShowNum(0, 6, 8266, 6, 16); // 删除IIC设备 // ESP_ERROR_CHECK(i2c_driver_delete(I2C_MASTER_NUM)); // ESP_LOGI(TAG, "I2C unitialized successfully"); } /** * @brief i2c master initialization */ static esp_err_t i2c_master_init(void) { int i2c_master_port = I2C_MASTER_NUM; i2c_config_t conf = { .mode = I2C_MODE_MASTER, .sda_io_num = I2C_MASTER_SDA_IO, // 18 .scl_io_num = I2C_MASTER_SCL_IO, // 19 .sda_pullup_en = GPIO_PULLUP_ENABLE, .scl_pullup_en = GPIO_PULLUP_ENABLE, .master.clk_speed = I2C_MASTER_FREQ_HZ, }; i2c_param_config(i2c_master_port, &conf); return i2c_driver_install(i2c_master_port, conf.mode, I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE, 0); } /** * @description: OLED 发送一个字节 * @return 错误信息 * @param {uint8_t} data 需要发送的内容,数据或者命令 * @param {uint8_t} cmd_ 1:发送数据 0:发送命令 */ static esp_err_t OLED_WR_Byte(uint8_t data, uint8_t cmd_) { int ret; uint8_t write_buf[2] = {((cmd_ == 1) ? (0x40) : (0x00)), data}; ret = i2c_master_write_to_device(I2C_MASTER_NUM, OLED_ADDR, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_RATE_MS); return ret; } /** * @description: OLED 屏幕初始化 * @return 无 */ void OLED_Init(void) { OLED_WR_Byte(0xAE, OLED_CMD); //--display off OLED_WR_Byte(0x00, OLED_CMD); //---set low column address OLED_WR_Byte(0x10, OLED_CMD); //---set high column address OLED_WR_Byte(0x40, OLED_CMD); //--set start line address OLED_WR_Byte(0xB0, OLED_CMD); //--set page address OLED_WR_Byte(0x81, OLED_CMD); // contract control OLED_WR_Byte(0xFF, OLED_CMD); //--128 OLED_WR_Byte(0xA1, OLED_CMD); // set segment remap OLED_WR_Byte(0xA6, OLED_CMD); //--normal / reverse OLED_WR_Byte(0xA8, OLED_CMD); //--set multiplex ratio(1 to 64) OLED_WR_Byte(0x3F, OLED_CMD); //--1/32 duty OLED_WR_Byte(0xC8, OLED_CMD); // Com scan direction OLED_WR_Byte(0xD3, OLED_CMD); //-set display offset OLED_WR_Byte(0x00, OLED_CMD); // OLED_WR_Byte(0xD5, OLED_CMD); // set osc division OLED_WR_Byte(0x80, OLED_CMD); // OLED_WR_Byte(0xD8, OLED_CMD); // set area color mode off OLED_WR_Byte(0x05, OLED_CMD); // OLED_WR_Byte(0xD9, OLED_CMD); // Set Pre-Charge Period OLED_WR_Byte(0xF1, OLED_CMD); // OLED_WR_Byte(0xDA, OLED_CMD); // set com pin configuartion OLED_WR_Byte(0x12, OLED_CMD); // OLED_WR_Byte(0xDB, OLED_CMD); // set Vcomh OLED_WR_Byte(0x30, OLED_CMD); // OLED_WR_Byte(0x8D, OLED_CMD); // set charge pump enable OLED_WR_Byte(0x14, OLED_CMD); // OLED_WR_Byte(0xAF, OLED_CMD); //--turn on oled panel OLED_Clear(); } /** * @description: OLED 屏幕 设置坐标 * @return 无 * @param {uint8_t} x 坐标x轴,范围0~127 * @param {uint8_t} y 坐标y轴,范围0~63 */ void OLED_Set_Pos(uint8_t x, uint8_t y) { OLED_WR_Byte(0xb0 + y, OLED_CMD); OLED_WR_Byte(((x & 0xf0) >> 4) | 0x10, OLED_CMD); OLED_WR_Byte((x & 0x0f), OLED_CMD); } /** * @description: OLED 清屏 * @return 无 */ void OLED_Clear(void) { uint8_t i, n; for (i = 0; i < 8; i++) { OLED_WR_Byte(0xb0 + i, OLED_CMD); OLED_WR_Byte(0x00, OLED_CMD); OLED_WR_Byte(0x10, OLED_CMD); for (n = 0; n < 128; n++) OLED_WR_Byte(0, OLED_DATA); } } /** * @description: OLED 显示单个字符 * @return 无 * @param {uint8_t} x 显示字符的x坐标,范围0~127 * @param {uint8_t} y 显示字符的y坐标,字符大小为16,取值0,2,4,6;字符大小6,取值0,1,2,3,4,5,6,7 * @param {uint8_t} chr 显示的单个字符,在字库中出现的字符 * @param {uint8_t} Char_Size 字符大小,取16或者8 */ void OLED_ShowChar(uint8_t x, uint8_t y, uint8_t chr, uint8_t Char_Size) { uint8_t c = 0; uint8_t i = 0; c = chr - ' '; if (x > 127) { x = 0; y = y + 2; } if (Char_Size == 16) { OLED_Set_Pos(x, y); for (i = 0; i < 8; i++) OLED_WR_Byte(F8X16[c * 16 + i], OLED_DATA); OLED_Set_Pos(x, y + 1); for (i = 0; i < 8; i++) OLED_WR_Byte(F8X16[c * 16 + i + 8], OLED_DATA); } else { OLED_Set_Pos(x, y); for (i = 0; i < 6; i++) OLED_WR_Byte(F6x8[c][i], OLED_DATA); } } /** * @description: OLED 显示字符串,会自动换行 * @return 无 * @param {uint8_t} x 显示字符串第一个字符的x坐标,范围0~127 * @param {uint8_t} y 显示字符串第一个字符的y坐标,字符大小为16,取值0,2,4,6;字符大小6,取值0,1,2,3,4,5,6,7 * @param {char} *chr 显示的字符串 * @param {uint8_t} Char_Size 字符大小,取16或者8 */ void OLED_ShowString(uint8_t x, uint8_t y, char *chr, uint8_t Char_Size) { unsigned char j = 0; while (chr[j] != '\0') { OLED_ShowChar(x, y, chr[j], Char_Size); x += 8; if (x > 120) { x = 0; y += 2; } j++; } } /** * @description: OLED 显示汉字 * @return 无 * @param {uint8_t} x 显示汉字的x坐标 * @param {uint8_t} y 显示汉字的y坐标 * @param {uint8_t} no 显示汉字在字库中的序号 */ void OLED_ShowCHinese(uint8_t x, uint8_t y, uint8_t no) { uint8_t t, adder = 0; OLED_Set_Pos(x, y); for (t = 0; t < 16; t++) { OLED_WR_Byte(Hzk[2 * no][t], OLED_DATA); adder += 1; } OLED_Set_Pos(x, y + 1); for (t = 0; t < 16; t++) { OLED_WR_Byte(Hzk[2 * no + 1][t], OLED_DATA); adder += 1; } } /** * @description: 求m^n的函数 * @return m^n的结果 * @param {uint8_t} m 底数 * @param {uint8_t} n 指数 */ uint32_t oled_pow(uint8_t m, uint8_t n) { uint32_t result = 1; while (n--) result *= m; return result; } /** * @description: OLED 显示数字 * @return 无 * @param {uint8_t} x 显示数字的第一个位置的x坐标 * @param {uint8_t} y 显示数字的第一个位置的y坐标 * @param {uint32_t} num 欲显示的数字 * @param {uint8_t} len 显示所占的长度,不建议小于真正要显示的数字的长度 * @param {uint8_t} size2 显示的数字的大小,16、8可选 */ void OLED_ShowNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len, uint8_t size2) { uint8_t t, temp; uint8_t enshow = 0; for (t = 0; t < len; t++) { temp = (num / oled_pow(10, len - t - 1)) % 10; if (enshow == 0 && t < (len - 1)) { if (temp == 0) { OLED_ShowChar(x + (size2 / 2) * t, y, ' ', size2); continue; } else enshow = 1; } OLED_ShowChar(x + (size2 / 2) * t, y, temp + '0', size2); } }将以上代码分成不同的模块编程后,出现FAILED: oled.elf cmd.exe /C "cd . && D:\Espressif\Espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin\xtensa-esp32s3-elf-g++.exe -mlongcalls -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32S3=0 -Wl,--Map=D:/Espressif/test/oled/build/oled.map -Wl,--no-warn-rwx-segments -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32s3.peripherals.ld -T esp32s3.rom.ld -T esp32s3.rom.api.ld -T esp32s3.rom.libgcc.ld -T esp32s3.rom.newlib.ld -T esp32s3.rom.version.ld -T memory.ld -T sections.ld @CMakeFiles\oled.elf.rsp -o oled.elf && cd ." d:/espressif/espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/BSP/libBSP.a(oled.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:101: multiple definition of `F8X16'; esp-idf/main/libmain.a(main.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:101: first defined here d:/espressif/espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/BSP/libBSP.a(oled.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:5: multiple definition of `F6x8'; esp-idf/main/libmain.a(main.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:5: first defined here d:/espressif/espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/BSP/libBSP.a(oled.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:200: multiple definition of `Hzk'; esp-idf/main/libmain.a(main.c.obj):D:/Espressif/test/oled/components/BSP/OLED/oledfont.h:200: first defined here collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed.修改代码,实现分模块设计
07-21
#include <reg51.h> #include <intrins.h> sbit LE1 = P3^6; sbit LE2 = P3^7; unsigned char temp; unsigned int d ; const unsigned char code wang_norm[32] = { 0x00,0x00,0xFF,0x7F,0x00,0x01,0x00,0x01, 0x00,0x01,0x00,0x01,0x00,0x01,0xF8,0x3F, 0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01, 0x00,0x01,0x00,0x01,0xFE,0x7F,0x00,0x00 }; const unsigned char code jing_norm[32] = { 0x20,0x20,0x20,0x10,0xFE,0x13,0x20,0xFC, 0xFC,0x01,0x20,0x10,0xFE,0x8B,0x00,0x88, 0xFC,0x49,0x04,0x49,0xFC,0x51,0x04,0x51, 0xFC,0x1D,0x04,0xE1,0x14,0x41,0x08,0x01 }; const unsigned char code han_norm[32] = { 0x00,0x00,0xF8,0x23,0x10,0x10,0x20,0x08, 0x44,0x84,0x54,0x45,0xE4,0x44,0x44,0x14, 0xE4,0x14,0x54,0x25,0x4C,0xE6,0x44,0x25, 0x84,0x24,0x04,0x24,0xFC,0x27,0x04,0x00 }; unsigned char idata display_buf[16][2]; unsigned char data scroll_offset = 0; unsigned char data current_row = 0; unsigned char data refresh_counter = 0; void timer0_init(void); void update_display_buffer(void); void delay_ms(unsigned int ms); void display_test_pattern(void); void timer0_init(void) { TMOD = 0x01; TH0 = 0xFC; TL0 = 0x67; ET0 = 1; EA = 1; TR0 = 1; } unsigned char reverse_bits(unsigned char b) { unsigned char result = 0; if(b & 0x01) result |= 0x80; if(b & 0x02) result |= 0x40; if(b & 0x04) result |= 0x20; if(b & 0x08) result |= 0x10; if(b & 0x10) result |= 0x08; if(b & 0x20) result |= 0x04; if(b & 0x40) result |= 0x02; if(b & 0x80) result |= 0x01; return result; } void update_display_buffer(void) { unsigned char i; unsigned char col_byte; unsigned char col_bit; unsigned char effective_offset = scroll_offset; if(effective_offset >= 64) effective_offset = 0; col_byte = effective_offset / 8; col_bit = effective_offset % 8; for(i = 0; i < 16; i++) { unsigned char wang_left; unsigned char wang_right; unsigned char jing_left; unsigned char jing_right; unsigned char han_left; unsigned char han_right; unsigned char byte0; unsigned char byte1; unsigned char byte2; wang_left = wang_norm[i*2]; wang_right = wang_norm[i*2+1]; jing_left = jing_norm[i*2]; jing_right = jing_norm[i*2+1]; han_left = han_norm[i*2]; han_right = han_norm[i*2+1]; if(col_byte < 2) { byte0 = wang_left; byte1 = wang_right; byte2 = 0x00; } else if(col_byte < 4) { if(col_byte == 2) { byte0 = wang_right; byte1 = 0x00; byte2 = jing_left; } else { byte0 = 0x00; byte1 = jing_left; byte2 = jing_right; } } else if(col_byte < 6) { byte0 = jing_left; byte1 = jing_right; byte2 = 0x00; } else if(col_byte < 8) { if(col_byte == 6) { byte0 = jing_right; byte1 = 0x00; byte2 = han_left; } else { byte0 = 0x00; byte1 = han_left; byte2 = han_right; } } else { byte0 = 0x00; byte1 = 0x00; byte2 = 0x00; } byte0 = reverse_bits(byte0); byte1 = reverse_bits(byte1); byte2 = reverse_bits(byte2); display_buf[i][0] = (byte0 >> col_bit) | (byte1 << (8 - col_bit)); temp = (byte1 >> col_bit) | (byte2 << (8 - col_bit)); display_buf[i][1] = temp; } } void timer0_isr(void) interrupt 1 { TH0 = 0xFC; TL0 = 0x67; refresh_counter++; if(refresh_counter < 2) return; refresh_counter = 0; P2 = 0x00; LE1 = 1; _nop_(); _nop_(); _nop_(); LE1 = 0; LE2 = 1; _nop_(); _nop_(); _nop_(); LE2 = 0; P3 = (P3 & 0xF0) | current_row; _nop_(); _nop_(); _nop_(); P2 = display_buf[current_row][1]; LE1 = 1; _nop_(); _nop_(); _nop_(); LE1 = 0; P2 = display_buf[current_row][0]; LE2 = 1; _nop_(); _nop_(); _nop_(); LE2 = 0; current_row++; if(current_row >= 16) { current_row = 0; } } void delay_ms(unsigned int ms) { unsigned int i, j; for(i = 0; i < ms; i++) { for(j = 0; j < 120; j++) { _nop_(); _nop_(); _nop_(); } } } void display_test_pattern(void) { unsigned char i, j; for(j = 0; j < 5; j++) { for(i = 0; i < 16; i++) { P3 = i; P2 = (j % 2) ? 0xFF : 0x00; LE1 = 1; LE1 = 0; P2 = (j % 2) ? 0xFF : 0x00; LE2 = 1; LE2 = 0; delay_ms(5); } delay_ms(200); } for(i = 0; i < 16; i++) { P3 = i; P2 = reverse_bits(wang_norm[i*2]); LE2 = 1; LE2 = 0; P2 = reverse_bits(wang_norm[i*2+1]); LE1 = 1; LE1 = 0; delay_ms(2); } delay_ms(1000); for(i = 0; i < 16; i++) { P3 = i; P2 = 0x00; LE1 = 1; LE1 = 0; LE2 = 1; LE2 = 0; } } void main(void) { unsigned char i; P0 = 0xFF; P1 = 0xFF; P2 = 0x00; P3 = 0x00; for(i = 0; i < 16; i++) { display_buf[i][0] = 0x00; display_buf[i][1] = 0x00; } display_test_pattern(); timer0_init(); while(1) { update_display_buffer(); scroll_offset++; if(scroll_offset >= 64) { scroll_offset = 0; } for(d = 0; d < 80; d++) { delay_ms(1); } } } 修改使得适配字模 陆喆,且相应的变量名改变
07-06
Exception in thread Thread-1 (_readerthread): Traceback (most recent call last): File "C:\Users\dengm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1075, in _bootstrap_inner self.run() File "C:\Users\dengm\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1012, in run self._target(*self._args, **self._kwargs) File "C:\Users\dengm\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1599, in _readerthread buffer.append(fh.read()) ^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 181: illegal multibyte sequence Traceback (most recent call last): File "E:\接单\逆向\cba.py", line 30, in <module> ret=js.call("a5e",mis) ^^^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_abstract_runtime_context.py", line 37, in call return self._call(name, *args) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_external_runtime.py", line 92, in _call return self._eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_external_runtime.py", line 78, in _eval return self.exec_(code) ^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_abstract_runtime_context.py", line 18, in exec_ return self._exec_(source) ^^^^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_external_runtime.py", line 88, in _exec_ return self._extract_result(output) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\package\.venv\Lib\site-packages\execjs\_external_runtime.py", line 156, in _extract_result output = output.replace("\r\n", "\n").replace("\r", "\n") ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace'
07-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值