我如何Arduino #include< Button.H>编译错误 [英] How Do I Arduino #Include<Button.H> Compile Error

查看:371
本文介绍了我如何Arduino #include< Button.H>编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道

我的头文件在哪里!!帮助

i have no idea
where is my header file!! help

typedef unsigned char byte;
// included libraries
#include <LiquidCrystal.h>
#include <Button.h>

// pin definitions
#define START_BUTTON_PIN 6
//-7-

// variable initialize 
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Button start_button = Button(START_BUTTON_PIN, BUTTON_PULLUP);
//-8-

unsigned long timerInterval = 1000; // duration variable in milliseconds
//-1-
unsigned long timerLastStart = 0;  // Last Start Time variable in milliseconds
//-2-
int secondCount1 = 0;
//-3-

//-5-

void setup () {
  Serial.begin (9600);
  Serial.println("Non Blocking Timer");
  Serial.println("Lets Begin");

  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Timer: ");
  lcd.print(secondCount1);
  lcd.print ("s");

  //-6-

}

void loop () {

  if (start_button.uniquePress ()) {
  } 

  //-9-

  if(millis() - timerLastStart > timerInterval) {
    timerLastStart = millis();
    // event code
    secondCount1++;
    lcd.setCursor(0, 0);  
    lcd.print("Timer: ");
    lcd.print(secondCount1);
    lcd.print ("s");  
  }

  //-4-

}

推荐答案

您的代码段来自http://workshopweekend.net/arduino/projects/stopwatch [ ^ ]。



该页面上有两个链接:

一个下载按钮库和一个到指示PDF格式。



所以你必须下载并安装它。
Your code snippet is from http://workshopweekend.net/arduino/projects/stopwatch[^].

There are two links on that page:
One to download the button library and one to a PDF with instructions.

So you must download the library and install it.


这篇关于我如何Arduino #include&lt; Button.H&gt;编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆