Herunterladen Inhalt Inhalt Diese Seite drucken

SunFounder Da Vinci Kit Bedienungsanleitung Seite 97

Für den raspberry pi 4 modell b, 3 modell a +, 3 modell b +, 3 modell b, 2 modell b, 1 modell b +, 1 modell a +, zero w and zero
Inhaltsverzeichnis

Werbung

void write_word(int
int
temp
=
data;
if
( BLEN
==
1
temp
|=
0x08;
else
temp
&=
0xF7;
wiringPiI2CWrite(fd, temp);
}
void send_command(int
int
buf;
// Send bit7-4 firstly
buf
=
comm
&
0xF0;
buf
|=
0x04;
write_word(buf);
delay(2);
buf
&=
0xFB;
write_word(buf);
// Send bit3-0 secondly
buf
=
(comm
&
0x0F)
buf
|=
0x04;
write_word(buf);
delay(2);
buf
&=
0xFB;
write_word(buf);
}
void send_data(int
int
buf;
// Send bit7-4 firstly
buf
=
data
&
0xF0;
buf
|=
0x05;
write_word(buf);
delay(2);
buf
&=
0xFB;
write_word(buf);
// Send bit3-0 secondly
buf
=
(data
&
0x0F)
buf
|=
0x05;
write_word(buf);
delay(2);
buf
&=
0xFB;
write_word(buf);
}
void
init(){
send_command(0x33);
delay(5);
send_command(0x32);
delay(5);
send_command(0x28);
delay(5);
send_command(0x0C);
delay(5);
send_command(0x01);
1.7. 1 Ausgabe
data){
)
comm){
// RS = 0, RW = 0, EN = 1
// Make EN = 0
<<
4;
// RS = 0, RW = 0, EN = 1
// Make EN = 0
data){
// RS = 1, RW = 0, EN = 1
// Make EN = 0
<<
4;
// RS = 1, RW = 0, EN = 1
// Make EN = 0
// Must initialize to 8-line mode at first
// Then initialize to 4-line mode
// 2 Lines & 5 * 7 dots
// Enable display without cursor
// Clear Screen
SunFounder Da Vinci Kit
(Fortsetzung der vorherigen Seite)
(Fortsetzung auf der nächsten Seite)
93

Werbung

Inhaltsverzeichnis
loading

Verwandte Produkte für SunFounder Da Vinci Kit

Diese Anleitung auch für:

Davinci-kit-for-raspberry-pi

Inhaltsverzeichnis