数码之家

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

搜索
查看: 1667|回复: 34

[Arduino] 求助论坛arduino大神,帮忙改个程序

[复制链接]
发表于 2023-12-8 16:04:10 | 显示全部楼层 |阅读模式

爱科技、爱创意、爱折腾、爱极致,我们都是技术控

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
想制作一个摩托车机油按公里数定期提醒的装置,顺带把时间和单程里程功能也做进去。使用ARDUINO NANO板子,显示屏幕是使用1.28寸GC9A01,时间是使用ds3231模块读取或存储,里程公里数统计这块计划使用红外线模块,在传统机械里程表内获取信号(机械转盘转140圈显示1000米)。希望显示屏上部一圈显示机油使用寿命,即箭头指示从绿色位置开始累积,当达到红色区域(1500公里-2000公里)后上部那一圈整体变成红色并闪烁提示,单层里程统计显示在中间下方(数码时钟下方),设计一个按键来控制机油归零和单程里程归零,即短按单程里程归零,长按机油归零。中间部分是数字式显示时钟(12小时制最好),同样设计一个按钮来设置时间,即长时间按住激活时钟设置模式(闪动),短按来调整时间,当设置正常后长时间不按自动存储。希望数码时间自提能够尽量大些,计划将此屏幕安装在仪表内部。

苦于本人不擅长编程,希望熟练编程的大师能够帮助我,感谢

另附上一个示例程序,供参考借鉴
-----------------


#include <Arduino.h>
#include "wiring_private.h"
#include <Adafruit_GPS.h>
#include <genieArduino.h>

Uart dispSerial (&sercom0, 5, 6, SERCOM_RX_PAD_1, UART_TX_PAD_0);
Adafruit_GPS GPS(&Serial1);
#define GPSECHO  false

Genie genie;

bool BST = false;
bool setupT = true;
int currentSpeed, prevSpeed = 0;
String currentTime = "00:00";
//String currentHour, currentMin = "00";
int currentHour, currentMin, lastMin;
int distance = 0;

uint32_t timer;

int ack=0;
//Attach the interupt handler to the SERCOM
void SERCOM0_Handler()
{
  dispSerial.IrqHandler();
}

int BSTpin = 2;
int RSTpin = 3;

void setup() {
  // Reassign pins 5 and 6 to SERCOM alt for screen serial
  pinPeripheral(5, PIO_SERCOM_ALT);
  pinPeripheral(6, PIO_SERCOM_ALT);

  //start serial
  dispSerial.begin(9600);
  genie.Begin(dispSerial);

  Serial.begin(115200);
  GPS.begin(9600);
  delay(5000);
  Serial.println("Starting");


  timer = millis();


  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_ALLDATA);
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  // Request updates on antenna status, comment out to keep quiet
  GPS.sendCommand(PGCMD_ANTENNA);
  delay(1000);

  pinMode(BSTpin, INPUT_PULLUP);
  pinMode(RSTpin, INPUT_PULLUP);

  //check is BST is required
  if (digitalRead(BSTpin) == LOW){
    BST = true;
    Serial.println("BST active");
  }

}


void loop() {
char c = GPS.read();
  // if you want to debug, this is a good time to do it!
  if ((c) && (GPSECHO))
    Serial.write(c);

  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences!
    // so be very wary if using OUTPUT_ALLDATA and trytng to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false

    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another
  }
  
  //check is Reset of odometer is required
  if (digitalRead(RSTpin) == LOW){
    distance = 0;
    Serial.println("Reset distance");
  }
  // approximately every 1 seconds or so, print out the current stats
  if (millis() - timer > 1000) {
    timer = millis(); // reset the timer

    Serial.print("\nTime: ");
    if (setupT != true){
      lastMin=currentMin;
    }
    currentHour = GPS.hour;
    currentMin = GPS.minute;
    if (BST == true){
      currentHour = (currentHour +1)%24;
    }
    Serial.print(currentHour);
    Serial.print(":");
    Serial.println(currentMin);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);
   
    if (GPS.fix) {
      genie.WriteObject(GENIE_OBJ_LED,0, 0);

      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      currentSpeed = round(GPS.speed*1.151);
      distance = distance+((currentSpeed*10000)/3600);
      Serial.print("Distance: ");
      Serial.println(distance);

    }else{
      genie.WriteObject(GENIE_OBJ_LED,0, 1);
      //genie.WriteObject(GENIE_OBJ_LED,0, 0);
      Serial.println("No fix");
      currentSpeed = 0;
      genie.WriteObject(GENIE_OBJ_IANGULAR_METER,0, currentSpeed);
    }
  //display time
  if ((currentMin != lastMin) || (setupT == true)){
    char timebuff[6];
    snprintf(timebuff,6,"%02d:%02d",currentHour, currentMin);
    //currentTime = String(currentHour + ":" + currentMin);
    genie.WriteStr(0,timebuff);
    setupT=false;
  }
  //display speed
  if (currentSpeed <0){
    currentSpeed =0;
  }else if (currentSpeed >30){
    currentSpeed = 30;
  }
  genie.WriteObject(GENIE_OBJ_IANGULAR_METER,0, currentSpeed);

  genie.WriteObject(GENIE_OBJ_LED_DIGITS,0, (distance/100));
  }
}

 楼主| 发表于 2023-12-8 20:01:37 | 显示全部楼层
t3486784401 发表于 2023-12-8 17:21
这个屏在你手上,只能自己调屏幕这块驱动。

一般屏的驱动,都是抽象成  画线(DrawLine)、画方(DrawRect ...

拿梯子出去用狗搜了一圈发现有款软件叫做SquareLine_Studio,叫做图形化编程什么的好像可以制作,但是苦于不会用SquareLine_Studio,不知道坛子里是否有高人会耍
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 11:40:06 | 显示全部楼层
t3486784401 发表于 2023-12-8 21:53
我耍 1bpp 黑白屏比较多,主要是有个 u8g2 库撑腰,移植性/扩展性强到飞起;

彩屏就玩的少了,一来代码 ...

我常用的是1602 24064等这些点阵屏,可是这块屏是一时心热手痒买的,苦于完全不会驱动。现在是一脸蒙
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 14:24:24 | 显示全部楼层
t3486784401 发表于 2023-12-9 13:57
对啊这些都算 1bpp 黑白屏,甚至 1602 连 1bpp 都不到

我是发现别说剁手,就是原价买的 tft 都很容易吃 ...

单色屏对于业余来说很实用,但是做好后不好看,说句土话就是不美丽。研究GC9A01屏幕很久发现该屏幕需要一款SquareLine studio配合NANO IDE,据说使用什么图形化交互编程的,好不容易下载好SquareLine studio发现需要64位操作系统才可以,悲剧了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 15:00:35 | 显示全部楼层
t3486784401 发表于 2023-12-9 14:28
关键是 TFT 做出来一股山寨手机的味道,用 ips 吧你得有那么好的美术功底,不然一样白瞎

之前做 CE 开发 ...

这屏正是IPS屏,1.28寸的,刚写了个测试程序试试效果

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 15:27:03 | 显示全部楼层
t3486784401 发表于 2023-12-9 15:21
对啊现在问题来了,你得有效果库,才能画出那些炫彩带阴影质感的玩意。

单纯的驱动,只是画一下简单线条 ...

炫彩质感的效果就不想了,毕竟用的的NANO单片机,处理能力有限,只希望能将我设想的表盘显示出来就好了,好像GITHUB有个开源库什么的,不知道那个库有什么用的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 15:52:31 | 显示全部楼层
t3486784401 发表于 2023-12-9 15:40
你都有底层驱动了,往上套一层 GDI 库,能画线画圆写字就有了。

一般两层驱动间是类似于 SetPixel 进行 ...

https://github.com/adafruit/Adafruit_GC9A01A
再高级的操作就不会了,下面连接是卖家给的测试程序不知道怎么改https://we.tl/t-ArxOyjy0if
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 16:49:10 | 显示全部楼层
t3486784401 发表于 2023-12-9 16:42
有两个方向的库可以用:

方向1:Adafruit_GFX + Adafruit_GC9A01A

找到了这个大神弄得一个库不知道有没有用
https://www.instructables.com/ES ... mart-Watch-Concept/
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 17:50:12 | 显示全部楼层
t3486784401 发表于 2023-12-9 16:59
推荐你装 adafruit 那两个,示例跑一遍就够你用了。

不容易有稀奇古怪的问题 ...

苦于不会用这2个库呀,跪求大神帮忙。
我看到那人做的这表中间也是数码显示的,不是和我的很像嘛,正打算从他那程序上改

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 19:42:33 | 显示全部楼层
t3486784401 发表于 2023-12-9 16:59
推荐你装 adafruit 那两个,示例跑一遍就够你用了。

不容易有稀奇古怪的问题 ...

这是我期望的功能显示,大概是这样的,里程和机油信号来自红外传感器Vout信号,数码时钟来自DS3231模块,里程和机油数据存储在NANO的eeprom,上电后能从eeprom读出来,时间数据存数在ds3231模块那里,该模块自带24系列eeprom

上电以后来个开机图片显示如下图所示,停止个2、3秒就可以,接着进入上面的使用界面

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-9 22:14:47 | 显示全部楼层
t3486784401 发表于 2023-12-9 21:23
去 Arduino 里边把这两个库装上,然后去到安装目录 libraries\ 文件夹下,找到库文件夹,里边有 examples ...

把这2个库装上你的意思是看这2个库的实例程序吗?简单的说我不知道我希望的那个半扇型油表指示是用什么东西做出来的,还有中间那个数码显示的时间窗口是怎么弄出来的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-10 09:05:17 | 显示全部楼层
t3486784401 发表于 2023-12-9 23:02
单纯的贴图,或者拿线段画。  GDI 就这么用的

我能不能改改这个https://github.com/VolosR/BoatGauges 因为我看这种代码内有6个,而我只需要其中一个,然后再加个时间显示就可以了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-11 09:12:52 | 显示全部楼层
t3486784401 发表于 2023-12-9 16:42
有两个方向的库可以用:

方向1:Adafruit_GFX + Adafruit_GC9A01A

下载了Adafruit_GC9A01A和Adafruit-GFX,运行一个示例程序发现无法编译,不知道为什么


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-11 16:02:36 | 显示全部楼层
t3486784401 发表于 2023-12-11 14:31
库文件夹,如果你是用解压的方式安装的,需要重命名,把 “-master” 这个去掉。

另外避免在桌面、含中 ...

发现这2个驱动似乎有些问题,实际测试好像并不能驱动GC9A01 ,我把NANO板子IO口改成
#define TFT_CS D1 // Chip select        改成TFT_CS D10
#define TFT_DC D3 // Data/command  改成TFT_DC D7
#define TFT_BL D6 // Backlight control   改成TFT_BL D9
发现代码上传后并不能正常显示,液晶屏幕一片漆黑
其它IO口如下图连接



下面是程序示例全部代码


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_GC9A01A.h"

// Define pins for display interface. You'll probably need to edit this for
// your own needs:

#if defined(ARDUINO_SEEED_XIAO_RP2040)

// Pinout when using Seed Round Display for XIAO in combination with
// Seeed XIAO RP2040. Other (non-RP2040) XIAO boards, any Adafruit Qt Py
// boards, and other GC9A01A display breakouts will require different pins.
#define TFT_CS D1 // Chip select
#define TFT_DC D3 // Data/command
#define TFT_BL D6 // Backlight control

#else // ALL OTHER BOARDS - EDIT AS NEEDED

// Other RP2040-based boards might not have "D" pin defines as shown above
// and will use GPIO bit numbers. On non-RP2040 boards, you can usually use
// pin numbers silkscreened on the board.
#define TFT_DC  9
#define TFT_CS 10
// If display breakout has a backlight control pin, that can be defined here
// as TFT_BL. On some breakouts it's not needed, backlight is always on.

#endif

// Display constructor for primary hardware SPI connection -- the specific
// pins used for writing to the display are unique to each board and are not
// negotiable. "Soft" SPI (using any pins) is an option but performance is
// reduced; it's rarely used, see header file for syntax if needed.
Adafruit_GC9A01A tft(TFT_CS, TFT_DC);

void setup() {
  Serial.begin(9600);
  Serial.println("GC9A01A Test!");

  tft.begin();

#if defined(TFT_BL)
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(TFT_BL, HIGH); // Backlight on
#endif // end TFT_BL

  Serial.println(F("Benchmark                Time (microseconds)"));
  delay(10);
  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(500);

  Serial.print(F("Text                     "));
  Serial.println(testText());
  delay(3000);

  Serial.print(F("Lines                    "));
  Serial.println(testLines(GC9A01A_CYAN));
  delay(500);

  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(GC9A01A_RED, GC9A01A_BLUE));
  delay(500);

  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(GC9A01A_GREEN));
  delay(500);

  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(GC9A01A_YELLOW, GC9A01A_MAGENTA));
  delay(500);

  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, GC9A01A_MAGENTA));

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, GC9A01A_WHITE));
  delay(500);

  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  delay(500);

  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  delay(500);

  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  delay(500);

  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  delay(500);

  Serial.println(F("Done!"));
}

void loop(void) {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    tft.setRotation(rotation);
    testText();
    delay(1000);
  }
}

unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(GC9A01A_BLACK);
  yield();
  tft.fillScreen(GC9A01A_RED);
  yield();
  tft.fillScreen(GC9A01A_GREEN);
  yield();
  tft.fillScreen(GC9A01A_BLUE);
  yield();
  tft.fillScreen(GC9A01A_BLACK);
  yield();
  return micros() - start;
}

unsigned long testText() {
  tft.fillScreen(GC9A01A_BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(GC9A01A_WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(GC9A01A_YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(GC9A01A_RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(GC9A01A_GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();

  tft.fillScreen(GC9A01A_BLACK);
  yield();

  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing

  yield();
  tft.fillScreen(GC9A01A_BLACK);
  yield();

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(GC9A01A_BLACK);
  yield();

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  yield();
  tft.fillScreen(GC9A01A_BLACK);
  yield();

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);

  yield();
  return micros() - start;
}

unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = tft.width(), h = tft.height();

  tft.fillScreen(GC9A01A_BLACK);
  start = micros();
  for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
  for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);

  return micros() - start;
}

unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = tft.width()  / 2,
                cy = tft.height() / 2;

  tft.fillScreen(GC9A01A_BLACK);
  n     = min(tft.width(), tft.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    tft.drawRect(cx-i2, cy-i2, i, i, color);
  }

  return micros() - start;
}

unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(GC9A01A_BLACK);
  n = min(tft.width(), tft.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    tft.fillRect(cx-i2, cy-i2, i, i, color1);
    t    += micros() - start;
    // Outlines are not included in timing results
    tft.drawRect(cx-i2, cy-i2, i, i, color2);
    yield();
  }

  return t;
}

unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;

  tft.fillScreen(GC9A01A_BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      tft.fillCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = tft.width()  + radius,
                h = tft.height() + radius;

  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      tft.drawCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = tft.width()  / 2 - 1,
                      cy = tft.height() / 2 - 1;

  tft.fillScreen(GC9A01A_BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    tft.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      tft.color565(i, i, i));
  }

  return micros() - start;
}

unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = tft.width()  / 2 - 1,
                   cy = tft.height() / 2 - 1;

  tft.fillScreen(GC9A01A_BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(0, i*10, i*10));
    t += micros() - start;
    tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(i*10, i*10, 0));
    yield();
  }

  return t;
}

unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(GC9A01A_BLACK);
  w     = min(tft.width(), tft.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
  }

  return micros() - start;
}

unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(GC9A01A_BLACK);
  start = micros();
  for(i=min(tft.width(), tft.height()); i>20; i-=6) {
    i2 = i / 2;
    tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
    yield();
  }

  return micros() - start;
}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册 微信登录

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-11 17:31:24 | 显示全部楼层
t3486784401 发表于 2023-12-11 16:26
别贴程序,占页面空间。

NANO 是 AVR 系列的,IO 要写作 2,3,4,.. 这样,不能是 D2,D3,D4;

我把程序内的接口号改成和实际的连线一致,成功上传入程序后,发现屏幕不能点亮,这是一个测试程序
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-12 18:10:00 | 显示全部楼层
t3486784401 发表于 2023-12-11 19:02
这一步爱莫能助,是个必须自己过去的坎。

调试硬件驱动的基本功就在这里 ...

https://github.com/adafruit/Adafruit_GC9A01A
这个驱动程序似乎有问题,要么他的IO口和我不一样,要么是哪里有问题,程序编译和上传都是正常的,就是液晶屏幕不显示,我看了内容也没找到具体说明IO口是怎么配置的,我选择这个驱动的示例程序也不行
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 微信登录

本版积分规则

APP|手机版|小黑屋|关于我们|联系我们|法律条款|技术知识分享平台

闽公网安备35020502000485号

闽ICP备2021002735号-2

GMT+8, 2025-7-21 09:23 , Processed in 0.202800 second(s), 11 queries , Redis On.

Powered by Discuz!

© 2006-2025 MyDigit.Net

快速回复 返回顶部 返回列表