coding for the sub
Dependencies: mbed Motor Servo
main.cpp
- Committer:
- ewingswim
- Date:
- 2018-10-09
- Revision:
- 6:0670fc8bb844
- Parent:
- 0:d59f674faf5e
File content as of revision 6:0670fc8bb844:
#include "mbed.h" #include "stdio.h" #include "Servo.h" /* this is the code for the sub */ int main() { int p =0; if(torpSwitch==1) { if(p==0){ for(int x=0;x<1;x+=0.1){ torpedo = x; printf("%d", x); } p =1; } else if(p==1){ for(int x=1;x>=0;x-=0.1){ torpedo = x; printf("%d", x); } p=0; } } }