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.
11 years, 3 months ago.
Switches on board do not work on mbed?
Hello!
I've been trying to configure my K64 to simply use a switch make an LED flash, however the switch itself seems unresponsive. Here is the code I've been using:
code
#include "mbed.h"
//Delay declared in seconds
/*GPIO declaration*/
DigitalOut red(LED_RED);
DigitalIn sw2(PTC6);
int main()
{
/*LED OFF*/
red=1;
while(1)
{
if(sw2==0)
{
red = 0;
wait(.2);
red = 1;
wait(1);
}
}
}
Anyone else having a similar problem or know where I'm going wrong?
So for some reason, it all suddenly started working again! Huzzah!
posted by Ben Trevett 24 Jul 2014