Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Lab_6_WaG by
Diff: main.cpp
- Revision:
- 42:6cba679a4ee4
- Parent:
- 41:9b293b14b845
- Child:
- 43:3b7f326aa096
- Child:
- 44:4c2ba5bbba67
--- a/main.cpp Tue Mar 27 16:34:17 2018 +0000
+++ b/main.cpp Thu Mar 29 15:51:52 2018 +0000
@@ -1,14 +1,14 @@
/******************************************************************************
* EECS 397
*
-* Assignment Name: Lab 5: WaG
+* Assignment Name: Lab 6: WaG
*
* Authors: Sam Morrison and Phong Nguyen
* File name: main.cpp
* Purpose: Configures the dispaly for 4-digit display or motor control
*
* Created: 03/01/2018
-* Last Modified: 03/08/2018
+* Last Modified: 03/29/2018
*
******************************************************************************/
#include "mbed.h"
@@ -18,6 +18,7 @@
#include "stepper.h"
#include "utility.h"
#include "analog.h"
+#include "laser.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -31,6 +32,7 @@
DigitalIn cal_button(UI_CAL_BUTTON);
DigitalIn station_select(UI_STATION_SELECT);
DigitalIn home_sensor(STP_HOME_SENSOR);
+DigitalOut laser(LZR_ENABLE);
AnalogIn mux_out (MUX_OUT);
BusOut mux_select(MUX_S0, MUX_S1, MUX_S2, MUX_S3);
@@ -64,4 +66,14 @@
step_test();
pc.printf("Step motor tested.");
+
+ while (uti_chk_ubutton() == 0);
+ pc.printf("test begin\n");
+ lzr_init();
+ while (uti_chk_ubutton() == 0) {
+ lzr_on();
+ wait(0.5);
+ lzr_off();
+ wait(0.5);
+ }
}
\ No newline at end of file
