BMT M9 groep 7
/
halfgeleider
test halfgeleider
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "HIDScope.h" 00003 00004 DigitalOut pin1(D4); 00005 AnalogIn testpin(A0); 00006 HIDScope scope (2); 00007 Ticker scope2; 00008 Serial pc(USBTX, USBRX); 00009 00010 void ScopeSend() 00011 { 00012 scope.set(0, pin1); 00013 scope.set(1, testpin); 00014 scope.send(); 00015 } 00016 00017 int main() 00018 { 00019 pc.baud(115200); 00020 scope2.attach(&ScopeSend, 0.002); 00021 00022 while (true) 00023 { 00024 char c = pc.getc(); 00025 00026 if (c == 'f') 00027 { 00028 pin1 = (1); 00029 wait (2); 00030 pin1 = (0); 00031 wait(1); 00032 } 00033 00034 else 00035 { 00036 pin1 = (0); 00037 } 00038 } 00039 00040 }
Generated on Mon Jul 18 2022 02:43:18 by 1.7.2