这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 物联网技术 » 炫Q-用Arduino点亮HPDL-1414

共10条 1/1 1 跳转至

炫Q-用Arduino点亮HPDL-1414

专家
2017-06-22 21:19:30     打赏

感谢小撸送的字符模块,型号好像是HPDL-1414,研究了一下午,终于用Arduino点亮了,记录一下历程吧。
01.jpg

首先用到的是小撸送的字符模块,很漂亮
07.jpg



专家
2017-06-22 21:20:04     打赏
2楼

这个字符模块是很多种显示模块中的一种,据说型号是HPDL-1414,二叔科技群里找到了大球上传的datasheet,这球也是出了名的懒,就叫datasheet.pdf,费了半天力气才找到。
05.jpg

大球是较早点亮的,而且是用香蕉,但是为啥显示的是MO10呢,暗恋?
04.jpg


专家
2017-06-22 21:20:27     打赏
3楼

先在网上查找资料,在数码之家看有人用四个做电脑资源显示器。
08.jpg

回顾了模块的pdf文档,感觉似乎只能显示字符,不能随意单点,大球说可以,估计他理解错了。
10.png

这个被羞弟称为电饭锅常用的流水灯效果估计是做不出来的。
09.png


专家
2017-06-22 21:21:15     打赏
4楼
好啦,言归正传,开始试验,一次点两个,少不了一些pdf中的资料
11.png
06.png

专家
2017-06-22 21:21:41     打赏
5楼

然后在面包板上将两个模块并联,为啥不亮呢?
03.jpg

在小撸的提示下仔细排查,最终发现忘了接电了,能亮才怪,接上电还是很漂亮的。
02.jpg


专家
2017-06-22 21:22:36     打赏
6楼
下面就是用程序控制显示的内容了,先是些什么呢,这个可是能显示字母的,研究了一下午,终于搞定。
void setup() {
    pinMode(2, OUTPUT);
    pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
    pinMode(7, OUTPUT);
    pinMode(8, OUTPUT);
  
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
    pinMode(11, OUTPUT);
    pinMode(12, OUTPUT);

    digitalWrite(11, HIGH);
    digitalWrite(12, HIGH);

    //*
    digitalWrite(2, LOW);
    digitalWrite(3, HIGH);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    
    //1
    digitalWrite(9, HIGH);
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(11, HIGH);

    //A
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    
    //2
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(11, HIGH);

    //N
    digitalWrite(2, LOW);
    digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
    digitalWrite(5, HIGH);
    
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);

    //3
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(11, HIGH);

    //Q
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    
    //4
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(11, HIGH);

    //I
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);

    //5
    digitalWrite(9, HIGH);
    digitalWrite(10, HIGH);
    digitalWrite(12, LOW);
    digitalWrite(12, HIGH);
    
    //L
    digitalWrite(2, LOW);
    digitalWrite(3, LOW);
    digitalWrite(4, HIGH);
    digitalWrite(5, HIGH);
    
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    
    //6
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(12, LOW);
    digitalWrite(12, HIGH);
    
    //A
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    
    //7
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(12, LOW);
    digitalWrite(12, HIGH);

    //*
    digitalWrite(2, LOW);
    digitalWrite(3, HIGH);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);

    //8
    digitalWrite(9, LOW);
    digitalWrite(10, LOW);
    digitalWrite(12, LOW);
    digitalWrite(12, HIGH);
}

void loop() {   
  delay(1000);
}

 


专家
2017-06-22 21:23:01     打赏
7楼
运行效果如开始的图
01.jpg

管理员
2017-06-22 21:53:31     打赏
8楼
楼主棒棒哒

专家
2017-06-23 08:30:28     打赏
9楼
这种显示屏,很耗电的。

专家
2017-07-10 12:27:38     打赏
10楼

在球猫的提示下的球猫版代码HelloCat!

void writeChar(int p,char ch)
{
    digitalWrite(2, (ch>>0) & 1);
    digitalWrite(3, (ch>>1) & 1);
    digitalWrite(4, (ch>>2) & 1);
    digitalWrite(5, (ch>>3) & 1);    
    digitalWrite(6, (ch>>4) & 1);
    digitalWrite(7, (ch>>5) & 1);
    digitalWrite(8, (ch>>6) & 1);
    digitalWrite(9, !((p>>0)&1));
    digitalWrite(10, !((p>>1)&1));
    if (p>>2)
    {
      digitalWrite(A2, LOW);
      digitalWrite(A2, HIGH);
    }else{
      digitalWrite(A1, LOW);
      digitalWrite(A1, HIGH);      
    }}

void writeString(char *str)
{
  int i;
  for(i=0;i<8;i++)
  {
    if(str[i]==0)
      break;
    writeChar(i,str[i]);
  } 
}

void setup() {
    pinMode(2, OUTPUT);
    pinMode(3, OUTPUT);
    pinMode(4, OUTPUT);
    pinMode(5, OUTPUT);
    pinMode(6, OUTPUT);
    pinMode(7, OUTPUT);
    pinMode(8, OUTPUT);
  
    pinMode(9, OUTPUT);
    pinMode(10, OUTPUT);
    pinMode(A1, OUTPUT);
    pinMode(A2, OUTPUT);

    digitalWrite(A1, HIGH);
    digitalWrite(A2, HIGH);

    writeString("HELLOCAT");
}

void loop() {   
  delay(1000);
}

 



共10条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]