![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Code for operation of relay switch
Revision 1:e7eb16963bcb, committed 2015-11-02
- Comitter:
- shekhar
- Date:
- Mon Nov 02 07:40:37 2015 +0000
- Parent:
- 0:845fb927f526
- Commit message:
- changed to 25msec
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 02 07:34:11 2015 +0000 +++ b/main.cpp Mon Nov 02 07:40:37 2015 +0000 @@ -1,4 +1,4 @@ -//checked for pulse duration of 1ms,3ms, 5ms, 100ms, 300ms - working for all! +//checked for pulse duration of 1ms,3ms, 25ms, 100ms, 300ms - working for all! #include "mbed.h" void writereg(uint8_t ,uint8_t ); @@ -13,21 +13,18 @@ while(1){ printf("press any char\n"); ch = pc.getc(); - //putchar(ch); if(ch == 'A') { - //cs2 = 0; putchar(ch); BCN = 1; - wait_ms(5);//min 1 ms + wait_ms(25);//min 1 ms//25ms (3-4 times of contact bounce + operate pulse) BCN = 0; } if(ch == 'B') { - //cs1 = 0; putchar(ch); TX = 1; - wait_ms(5);//min 1 ms + wait_ms(25);//min 1 ms//25ms (3-4 times of contact bounce + operate pulse) TX = 0; }} } \ No newline at end of file