forked from majestik666/Beagle_GPIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Beagle_GPIO_KS0108_test.cc
53 lines (40 loc) · 983 Bytes
/
Beagle_GPIO_KS0108_test.cc
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
51
52
53
#include "Beagle_GPIO.hh"
#include "Beagle_GPIO_KS0108.hh"
#include <iostream>
Beagle_GPIO gpio;
int main()
{
GPIO_PRINT( "===========================" );
GPIO_PRINT( "BeagleBone GPIO KS0108 Test" );
GPIO_PRINT( "===========================" );
Beagle_GPIO_KS0108 lcd(
&gpio,
Beagle_GPIO::P8_46, // RS
Beagle_GPIO::P8_45, // RW
Beagle_GPIO::P8_44, // E
Beagle_GPIO::P8_30, // DB0
Beagle_GPIO::P8_29,
Beagle_GPIO::P8_28,
Beagle_GPIO::P8_27,
Beagle_GPIO::P8_26,
Beagle_GPIO::P8_25,
Beagle_GPIO::P8_24,
Beagle_GPIO::P8_23, // DB7
Beagle_GPIO::P8_43, // CS1
Beagle_GPIO::P8_42); // CS2
// Init LCD screen
lcd.initScreen();
// Clear Screen
//lcd.clearScreen();
// Write a pixel
//for (int i=0;i<20;++i)
// lcd.setPixel( i,i, 0xFF );
sleep(5);
// Write a string to screen
//lcd.goToPosition(3,0);
//lcd.write( "Beagle_GPIO" );
//lcd.goToPosition(3,1);
//lcd.write( "KS0108 Test" );
//lcd.clearScreen();
return 0;
}