Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 10 months ago.
Pins for KL25z?
Hi,
I am new to programming and mbed. I am looking to use the helloworld program with textlcd.. is this compatible with the kl25z board? I know the pins that need to be used, but what in the program needs to be changed to make it work with the kl25z and a 16*2 display?
Thank you
Question relating to:
2 Answers
10 years, 10 months ago.
You just need to set the pins you use for your wiring in the constructor (where you declare the TextLCD object). You can use any pins, no special pins are required.
10 years, 10 months ago.
Thank you Erik. Is this in the main file only or does anything need to be changed in the TextLCD. cpp or TextLCD.h files?
Ie in the hellowirld program, mbed pins (p18, p19 etc) are used, but in the cpp file there is an enumerated constructor with (PinName rs, PinName e... etc). Which should be changed to the kl25z pins?
The constructor is in the main file (or in general wherever you make the object). So in the HelloWorld program it is:
TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
You need to replace those pins with the ones you use. So on the KL25Z that is PTC12 for example.
posted by 06 Jan 2014No, in principle that never has to happen. The idea is that they stay the same, and you just use them, you don't have to change them (unless a library has to do something it wasn't originally designed for, but just changing the pins is simply done by changing them in the constructor).
posted by 06 Jan 2014