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.
9 years, 7 months ago.
How to use I/O pins for digitalout using the mbed compiler
Good Morning, I am aware that the code below sets up the LEDs for digital output
DigitalOut myled(LED1);
but I have 3 questions (FOR THE KL25Z BOARD)
1) what is the voltage of the DigitalOut?
2) what code do we need to use in order to access I/O pins?
i.e. DigitalOut myled(pinaddress)
3) what pins can I use?
1 Answer
9 years, 7 months ago.
1) On most boards it will be 3.3v
2) myled = 1; switch led on myled = 0; switch led off
3) LED1 should be an LED on the board, but to use another pin without an attached LED, refer to the platforms page to see the pinout of your board, choose a pin and initialise with DigitalOut newled(pinname)