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.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hello,
I have a problem with BusInOut. My codes are as below.
I have two buses ( 5 bit. cRowBus and cColBus). I made them opendrain output. p29 didn't work, when I tried the first code. (I measure 111101 on cColBus pins, when I write to bus as cColBus.write(63); (111111). p29 was always zero.) I tryed this two codes on two mbed. Both of them were same. After, I tried the second code. (I just canceled cRowBus). It works fine. Can you try these codes on own mbed 1768? What could be the reason for this?
Thanks,
Selim.
1. code: #include "mbed.h" BusInOut cRowBus(p5, p8, p10, p6, p9, p7); BusInOut cColBus(p25, p26, p27, p28, p29, p30); unsigned char x; main(){ cColBus.mode(OpenDrain); cColBus.output(); cRowBus.mode(OpenDrain); cRowBus.output(); while(1) { cColBus.write(63); wait_ms(500); cColBus.write(0); wait_ms(500); } } 2. code : #include "mbed.h" //BusInOut cRowBus(p5, p8, p10, p6, p9, p7); BusInOut cColBus(p25, p26, p27, p28, p29, p30); unsigned char x; main(){ cColBus.mode(OpenDrain); cColBus.output(); // cRowBus.mode(OpenDrain); // cRowBus.output(); while(1) { cColBus.write(63); wait_ms(500); cColBus.write(0); wait_ms(500); } }