Bayley Wang
/
pyroflex_AND
control the laser with the MBED
main.cpp
- Committer:
- bwang
- Date:
- 2019-11-11
- Revision:
- 0:5d2320fc9350
- Child:
- 1:d42ef49f54df
File content as of revision 0:5d2320fc9350:
#include "mbed.h" DigitalOut led(LED1); InterruptIn in(PA_10); PwmOut out(PA_8); Serial pc(USBTX, USBRX); void turn_on() { out.pulsewidth_us(2); led = 1; } void turn_off() { out.pulsewidth_us(0); led = 0; } int main() { pc.printf("PYROFLEX\n"); out.period_us(10); out.pulsewidth_us(2); in.rise(turn_on); in.fall(turn_off); for (;;) {} }