Kenji Arai
/
NucleoF401_motor_test_simple
DRV8830/TI Motor Driver sample program.\\ This program can control two motors.
Diff: main.cpp
- Revision:
- 2:e0b9fd6126d1
- Parent:
- 1:e9d1c42a73ae
- Child:
- 3:db817fb05ba7
diff -r e9d1c42a73ae -r e0b9fd6126d1 main.cpp --- a/main.cpp Fri Feb 28 06:52:34 2014 +0000 +++ b/main.cpp Sat Jul 12 09:46:47 2014 +0000 @@ -1,21 +1,38 @@ +/* + * mbed Application program for the mbed ST NUCLEO F401RE Board + * Test program -> Check LED & Serial com. + * + * Copyright (c) 2014 Kenji Arai / JH1PJL + * http://www.page.sannet.ne.jp/kenjia/index.html + * http://mbed.org/users/kenjiArai/ + * Created: July 12th, 2014 + * Revised: July 12th, 2014 + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// Include --------------------------------------------------------------------------------------- #include "mbed.h" -//------------------------------------ -// Hyperterminal configuration -// 9600 bauds, 8-bit data, no parity -//------------------------------------ +// Object ---------------------------------------------------------------------------------------- +Serial pc(SERIAL_TX, SERIAL_RX); +DigitalOut myled(LED1); -Serial pc(SERIAL_TX, SERIAL_RX); - -DigitalOut myled(LED1); - +//------------------------------------------------------------------------------------------------- +// Control Program +//------------------------------------------------------------------------------------------------- int main() { int i = 1; - pc.printf("Hello World !\n"); + pc.printf("\r\nHello World !\r\n"); + pc.printf(" by JH1PJL "__DATE__"\r\n"); while(1) { - wait(1); - pc.printf("This program runs since %d seconds.\n", i++); + pc.printf("This program runs since %d seconds.\r\n", i++); myled = !myled; + wait(1.0); } } \ No newline at end of file