Keyboard firmwares for Atmel AVR and Cortex-M
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819
  1. #include "mbed.h"
  2. DigitalOut out(p5);
  3. #if defined(TARGET_LPC1114)
  4. AnalogIn in(p20);
  5. #else
  6. AnalogIn in(p19);
  7. #endif
  8. volatile float w, x, y, z;
  9. int main() {
  10. while(1) {
  11. z = x * y / w;
  12. printf("Hello World %d %f\n", out.read(), z);
  13. if(in > 0.5) {
  14. out = !out;
  15. }
  16. }
  17. }