forked from w4-pwr/AK2-Projekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmp.txt
50 lines (35 loc) · 1.66 KB
/
tmp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* strobe:
* Toggle the strobe (Really the "E") pin to the device.
* According to the docs, data is latched on the falling edge.
*********************************************************************************
*/
static void strobe (const struct lcdDataStruct *lcd)
{
// Note timing changes for new version of delayMicroseconds ()
digitalWrite (lcd->strbPin, 1) ; delayMicroseconds (50) ;
digitalWrite (lcd->strbPin, 0) ; delayMicroseconds (50) ;
}
https://github.com/WiringPi/WiringPi/tree/master/devLib
//Pin numbers below are the WiringPi pin numbers
#define LCD_RS 3 //Register select pin
#define LCD_E 0 //Enable Pin
#define LCD_D4 6 //Data pin 4
#define LCD_D5 1 //Data pin 5
#define LCD_D6 5 //Data pin 6
#define LCD_D7 4 //Data pin 7
int main()
{
int lcd; //Handle for LCD
wiringPiSetup(); //Initialise WiringPi
//Initialise LCD(int rows, int cols, int bits, int rs, int enable, int d0, int d1, int d2, int d3, int d4, int d5, int d6, int d7)
if (lcd = lcdInit (2, 16,4, LCD_RS, LCD_E ,LCD_D4 , LCD_D5, LCD_D6,LCD_D7,0,0,0,0)){
printf ("lcdInit failed! \n");
return -1 ;
}
lcdPosition(lcd,0,0); //Position cursor on the first line in the first column
lcdPuts(lcd, "Character LCD"); //Print the text on the LCD at the current cursor postion
getchar(); //Wait for key press
lcdClear(lcd); //Clear the display
}
Lines 1 and 2 are required as these are the headers for the WiringPi LCD libr