embeded/raspberry pi2015. 11. 3. 14:10

한번 연결해봐야지 


int  lcdInit (int rows, int cols, int bits, int rs, int strb,

        int d0, int d1, int d2, int d3, int d4, int d5, int d6, int d7) ;


In the above Fritzing diagrams, the 4-bit one would be initialised by:

fd = lcdInit (2, 16, 4,  11,10 , 0,1,2,3,0,0,0,0) ;


and the 8-bit one by:

fd = lcdInit (2, 16, 8,  11,10 , 0,1,2,3,4,5,6,7) ;


 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 


4bit

             22  27 17

7  8                  18      


8bit


            22  27  17    4

7  8  25   24  23  18


4bit


8bit



[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/lcd-library/]

[링크 : https://learn.adafruit.com/drive-a-16x2-lcd-directly-with-a-raspberry-pi/overview]



+

If using wiringPi v2, then you need to add in -lwiringPiDev as well as -lwiringPi

[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/lcd-library/]

'embeded > raspberry pi' 카테고리의 다른 글

rtos on rpi  (0) 2015.11.11
clcd - bona cm04075 / lc1628  (0) 2015.11.04
bcm2835 pwm 데이터시트  (0) 2015.10.16
wiringpi pwm 라이브러리 분석?  (0) 2015.10.16
라즈베리 파이 GPIO 유틸 PWM  (0) 2015.10.14
Posted by 구차니