Convert library examples

This commit is contained in:
2016-08-28 21:30:18 +01:00
parent 768ab1254d
commit 8c441b7ccd
11 changed files with 177 additions and 176 deletions

View File

@@ -37,10 +37,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -71,4 +72,3 @@ void loop() {
// clear screen for the next loop: // clear screen for the next loop:
lcd.clear(); lcd.clear();
} }

View File

@@ -37,10 +37,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:

View File

@@ -38,10 +38,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -58,4 +59,3 @@ void loop() {
lcd.cursor(); lcd.cursor();
delay(500); delay(500);
} }

View File

@@ -39,10 +39,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// make some custom characters: // make some custom characters:
byte heart[8] = { byte heart[8] = {

View File

@@ -38,10 +38,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -58,4 +59,3 @@ void loop() {
lcd.display(); lcd.display();
delay(500); delay(500);
} }

View File

@@ -38,10 +38,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -57,4 +58,3 @@ void loop() {
// print the number of seconds since reset: // print the number of seconds since reset:
lcd.print(millis() / 1000); lcd.print(millis() / 1000);
} }

View File

@@ -38,10 +38,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -81,6 +82,4 @@ void loop() {
// delay at the end of the full loop: // delay at the end of the full loop:
delay(1000); delay(1000);
} }

View File

@@ -36,10 +36,11 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:

View File

@@ -37,6 +37,7 @@
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// these constants won't change. But you can change the size of // these constants won't change. But you can change the size of
@@ -45,7 +46,7 @@ const int numRows = 2;
const int numCols = 16; const int numCols = 16;
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() { void setup() {
// set up the LCD's number of columns and rows: // set up the LCD's number of columns and rows:
@@ -68,5 +69,3 @@ void loop() {
} }
} }
} }

View File

@@ -37,10 +37,11 @@ http://www.arduino.cc/en/Tutorial/LiquidCrystalTextDirection
*/ */
// include the library code: // include the library code:
#include <Arduino.h>
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int thisChar = 'a'; int thisChar = 'a';

View File

@@ -1,4 +1,5 @@
#include "Arduino.h" #include <Arduino.h>
#include <LiquidCrystal.h>
extern "C" { extern "C" {
#include "pb_decode.h" #include "pb_decode.h"
@@ -6,8 +7,6 @@ extern "C" {
#include "lcdkeypad.pb.h" #include "lcdkeypad.pb.h"
} }
#include <LiquidCrystal.h>
// Select the pins used on the LCD panel // Select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); LiquidCrystal lcd(8, 9, 4, 5, 6, 7);