motorspeed step
Dependencies: Encoder MODSERIAL mbed
Fork of frdm_Motortryout2_test by
main.cpp
00001 #include "mbed.h" 00002 #include "encoder.h" 00003 #include "MODSERIAL.h" 00004 00005 Serial pc(USBTX, USBRX); // tx, rx 00006 DigitalOut led(LED_RED); 00007 DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield) 00008 PwmOut motor2speed(D5); 00009 00010 int main() 00011 { 00012 //test 00013 motor2direction = 0; 00014 motor2speed = 0; 00015 led = 1; 00016 pc.baud(115200); 00017 while(true) 00018 { 00019 char c = pc.getc(); 00020 if( c == 'r') 00021 { 00022 motor2speed = 1; 00023 } 00024 } 00025 }
Generated on Fri Jul 29 2022 05:46:05 by 1.7.2