Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of USBJoystick_HelloWorld by
main.cpp
00001 #include "mbed.h" 00002 #include "USBKeyboard.h" 00003 00004 USBKeyboard keyboard; 00005 00006 // Variables for Heartbeat and Status monitoring 00007 DigitalOut myled1(LED1); 00008 DigitalOut myled2(LED2); 00009 DigitalOut myled3(LED3); 00010 DigitalOut heartbeatLED(LED4); 00011 00012 DigitalIn mic (p14); 00013 00014 Serial pc(USBTX, USBRX); // tx, rx 00015 00016 00017 char state; 00018 int main(){ 00019 // pc.printf("%u\n\r",); 00020 while (1) { 00021 if((state==0)&(mic==1)){ 00022 state=1; 00023 // pc.printf("oui\n\r"); 00024 keyboard.keyCode2(0x00,0x10,0); //sends touche CTRL through the keyboard 00025 myled1=1; 00026 }else{ 00027 if(mic==0){ 00028 state=0; 00029 keyboard.key_release();// release 00030 myled1=0; 00031 } 00032 } 00033 wait(0.20); 00034 } 00035 00036 }
Generated on Tue Jul 12 2022 21:36:07 by
1.7.2
