Added various bits, main reformatted. Added .get to class Servo to allow waiting for rotation before recording information.

Dependencies:   SLCD mbed

Fork of Lab6_Basic by ECE 111 At Oregon State University

Files at this revision

API Documentation at this revision

Comitter:
Dogcatfee
Date:
Sat Nov 19 09:37:32 2016 +0000
Parent:
9:4bd820ca8300
Commit message:
Added unsigned int; Added 16-bit unsigned int; Added made max_degree constant;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4bd820ca8300 -r 37cbc2888e09 main.cpp
--- a/main.cpp	Sat Nov 19 09:13:10 2016 +0000
+++ b/main.cpp	Sat Nov 19 09:37:32 2016 +0000
@@ -14,14 +14,15 @@
 Servo my_servo(PTB3,PTE19,PTE18,PTE31);
 AnalogIn Spanel(PTB2);
 //uint16_t reading_array[3];
-const int max_degree = 120;
-const int size=20;
-unsigned int reading_array[size]; 
-int position_array[size];  
-//uint16_t largest = 0; 
-unsigned int largest = 0;
-int largesti = 0;
-int i;
+const uint16_t max_degree = 120;
+const uint16_t size=20;
+unsigned int reading_array[size];
+//unsigned int reading_array[size]; 
+unsigned int position_array[size];  
+unsigned int largest = 0; 
+//unsigned int largest = 0;
+unsigned int largesti = 0;
+unsigned int i;
 
 //Serial pc(USBTX, USBRX);
 
@@ -66,7 +67,7 @@
             }
 
             //write analog values (integers) to array
-            reading_array[i] = Spanel.read()*10000;
+            reading_array[i] = Spanel.read_u16()*100;
         }