Hello,
I have the next code that I would expect to flip the led every time I send a character from the PC to the mbed. However, the led keeps on blinking after the first character.
Any idea of what can be wrong ?
Regards,
Juan
Hello,
I have the next code that I would expect to flip the led every time I send a character from the PC to the mbed. However, the led keeps on blinking after the first character.
Any idea of what can be wrong ?
Regards,
Juan
<<code>>
#include "mbed.h"
DigitalOut clk(LED1);
DigitalOut dat(LED2);
DigitalOut enable(LED3);
DigitalOut bit(LED4);
void flip() {
clk = !clk;
}
Timeout flipper;
Serial pc(USBTX, USBRX);
int main() {
clk = 1;
pc.attach(&flip,Serial::RxIrq);
while(1) {
}
}
<</code>>
Not sure how the Mbed library actually clears the condition that triggered the interrupt, but as a first step, try actually reading the character to ensure any input buffer is cleared:-
See if this makes any difference. Also, try adding echo to make sure what goes in comes out (for debugging purposes).
Not sure how the Mbed library actually clears the condition that triggered the interrupt, but as a first step, try actually reading the character to ensure any input buffer is cleared:-
See if this makes any difference. Also, try adding echo to make sure what goes in comes out (for debugging purposes).
<<code>>
#include "mbed.h"
DigitalOut clk(LED1);
DigitalOut dat(LED2);
DigitalOut enable(LED3);
DigitalOut bit(LED4);
Serial pc(USBTX, USBRX);
Timeout flipper;
void flip(void) {
pc.putc( pc.getc() );
clk = !clk;
}
int main() {
clk = 1;
pc.attach(&flip,Serial::RxIrq);
while(1) {
}
}
<</code>>
the same code not working on STM32F429VIT. What is problem may be?
the same code not working on STM32F429VIT. What is problem may be?
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
Hello, I have the next code that I would expect to flip the led every time I send a character from the PC to the mbed. However, the led keeps on blinking after the first character. Any idea of what can be wrong ? Regards, Juan