Programm for changing alarm setting, trackpad input to select number (hours/minutes) and then potentiometer input to select value of each.

Dependencies:   mbed

Committer:
Owenmatthewmcgowan
Date:
Tue May 23 14:12:15 2017 +0000
Revision:
0:1c1efe84b428
01

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Owenmatthewmcgowan 0:1c1efe84b428 1 #include "mbed.h"
Owenmatthewmcgowan 0:1c1efe84b428 2 AnalogueIn Trackpad(int x, int y)
Owenmatthewmcgowan 0:1c1efe84b428 3 AnalogueIn resistor(int r)
Owenmatthewmcgowan 0:1c1efe84b428 4
Owenmatthewmcgowan 0:1c1efe84b428 5 if ()<=x<=() && ()<=y<=()
Owenmatthewmcgowan 0:1c1efe84b428 6 {
Owenmatthewmcgowan 0:1c1efe84b428 7
Owenmatthewmcgowan 0:1c1efe84b428 8 switch (r)
Owenmatthewmcgowan 0:1c1efe84b428 9 {
Owenmatthewmcgowan 0:1c1efe84b428 10 case 0<=r<=0.33 :
Owenmatthewmcgowan 0:1c1efe84b428 11 Num1 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 12 break;
Owenmatthewmcgowan 0:1c1efe84b428 13
Owenmatthewmcgowan 0:1c1efe84b428 14 case 0.33<=r<=0.66 :
Owenmatthewmcgowan 0:1c1efe84b428 15 Num1 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 16 break;
Owenmatthewmcgowan 0:1c1efe84b428 17
Owenmatthewmcgowan 0:1c1efe84b428 18 case 0.66<=r<=1 :
Owenmatthewmcgowan 0:1c1efe84b428 19 Num1 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 20 break;
Owenmatthewmcgowan 0:1c1efe84b428 21 }
Owenmatthewmcgowan 0:1c1efe84b428 22 }
Owenmatthewmcgowan 0:1c1efe84b428 23 else if ()<=x<=() && ()<=y<=()
Owenmatthewmcgowan 0:1c1efe84b428 24 {
Owenmatthewmcgowan 0:1c1efe84b428 25
Owenmatthewmcgowan 0:1c1efe84b428 26 switch (r)
Owenmatthewmcgowan 0:1c1efe84b428 27 {
Owenmatthewmcgowan 0:1c1efe84b428 28 case 0<=r<=0.1 :
Owenmatthewmcgowan 0:1c1efe84b428 29 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 30 break;
Owenmatthewmcgowan 0:1c1efe84b428 31
Owenmatthewmcgowan 0:1c1efe84b428 32 case 0.1<=r<=0.2 :
Owenmatthewmcgowan 0:1c1efe84b428 33 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 34 break;
Owenmatthewmcgowan 0:1c1efe84b428 35
Owenmatthewmcgowan 0:1c1efe84b428 36 case 0.2<=r<=0.3 :
Owenmatthewmcgowan 0:1c1efe84b428 37 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 38 break;
Owenmatthewmcgowan 0:1c1efe84b428 39
Owenmatthewmcgowan 0:1c1efe84b428 40 case 0.3<=r<=0.4 :
Owenmatthewmcgowan 0:1c1efe84b428 41 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 42 break;
Owenmatthewmcgowan 0:1c1efe84b428 43
Owenmatthewmcgowan 0:1c1efe84b428 44 case 0.4<=r<=0.5 :
Owenmatthewmcgowan 0:1c1efe84b428 45 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 46 break;
Owenmatthewmcgowan 0:1c1efe84b428 47
Owenmatthewmcgowan 0:1c1efe84b428 48 case 0.5<=r<=0.6 :
Owenmatthewmcgowan 0:1c1efe84b428 49 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 50 break;
Owenmatthewmcgowan 0:1c1efe84b428 51
Owenmatthewmcgowan 0:1c1efe84b428 52 case 0.6<=r<=0.7 :
Owenmatthewmcgowan 0:1c1efe84b428 53 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 54 break;
Owenmatthewmcgowan 0:1c1efe84b428 55
Owenmatthewmcgowan 0:1c1efe84b428 56 case 0.7<=r<=0.8 :
Owenmatthewmcgowan 0:1c1efe84b428 57 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 58 break;
Owenmatthewmcgowan 0:1c1efe84b428 59
Owenmatthewmcgowan 0:1c1efe84b428 60 case 0.8<=r<=0.9 :
Owenmatthewmcgowan 0:1c1efe84b428 61 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 62 break;
Owenmatthewmcgowan 0:1c1efe84b428 63
Owenmatthewmcgowan 0:1c1efe84b428 64 case 0.9<=r<=1.0 :
Owenmatthewmcgowan 0:1c1efe84b428 65 Num2 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 66 break;
Owenmatthewmcgowan 0:1c1efe84b428 67 }
Owenmatthewmcgowan 0:1c1efe84b428 68 }
Owenmatthewmcgowan 0:1c1efe84b428 69
Owenmatthewmcgowan 0:1c1efe84b428 70 else if ()<=x<=() && ()<=y<=()
Owenmatthewmcgowan 0:1c1efe84b428 71 {
Owenmatthewmcgowan 0:1c1efe84b428 72
Owenmatthewmcgowan 0:1c1efe84b428 73 switch (r)
Owenmatthewmcgowan 0:1c1efe84b428 74 {
Owenmatthewmcgowan 0:1c1efe84b428 75 case 0<=r<=0.166 :
Owenmatthewmcgowan 0:1c1efe84b428 76 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 77 break;
Owenmatthewmcgowan 0:1c1efe84b428 78
Owenmatthewmcgowan 0:1c1efe84b428 79 case 0.166<=r<=0.333 :
Owenmatthewmcgowan 0:1c1efe84b428 80 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 81 break;
Owenmatthewmcgowan 0:1c1efe84b428 82
Owenmatthewmcgowan 0:1c1efe84b428 83 case 0.333<=r<=0.499 :
Owenmatthewmcgowan 0:1c1efe84b428 84 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 85 break;
Owenmatthewmcgowan 0:1c1efe84b428 86
Owenmatthewmcgowan 0:1c1efe84b428 87 case 0.499<=r<=0.665 :
Owenmatthewmcgowan 0:1c1efe84b428 88 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 89 break;
Owenmatthewmcgowan 0:1c1efe84b428 90
Owenmatthewmcgowan 0:1c1efe84b428 91 case 0.665<=r<=0.831 :
Owenmatthewmcgowan 0:1c1efe84b428 92 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 93 break;
Owenmatthewmcgowan 0:1c1efe84b428 94
Owenmatthewmcgowan 0:1c1efe84b428 95 case 0.831<=r<=1.0 :
Owenmatthewmcgowan 0:1c1efe84b428 96 Num3 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 97 break;
Owenmatthewmcgowan 0:1c1efe84b428 98 }
Owenmatthewmcgowan 0:1c1efe84b428 99 }
Owenmatthewmcgowan 0:1c1efe84b428 100 else if ()<=x<=() && ()<=y<=()
Owenmatthewmcgowan 0:1c1efe84b428 101 {
Owenmatthewmcgowan 0:1c1efe84b428 102
Owenmatthewmcgowan 0:1c1efe84b428 103 switch (r)
Owenmatthewmcgowan 0:1c1efe84b428 104 {
Owenmatthewmcgowan 0:1c1efe84b428 105 case 0<=r<=0.1 :
Owenmatthewmcgowan 0:1c1efe84b428 106 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 107 break;
Owenmatthewmcgowan 0:1c1efe84b428 108
Owenmatthewmcgowan 0:1c1efe84b428 109 case 0.1<=r<=0.2 :
Owenmatthewmcgowan 0:1c1efe84b428 110 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 111 break;
Owenmatthewmcgowan 0:1c1efe84b428 112
Owenmatthewmcgowan 0:1c1efe84b428 113 case 0.2<=r<=0.3 :
Owenmatthewmcgowan 0:1c1efe84b428 114 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 115 break;
Owenmatthewmcgowan 0:1c1efe84b428 116
Owenmatthewmcgowan 0:1c1efe84b428 117 case 0.3<=r<=0.4 :
Owenmatthewmcgowan 0:1c1efe84b428 118 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 119 break;
Owenmatthewmcgowan 0:1c1efe84b428 120
Owenmatthewmcgowan 0:1c1efe84b428 121 case 0.4<=r<=0.5 :
Owenmatthewmcgowan 0:1c1efe84b428 122 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 123 break;
Owenmatthewmcgowan 0:1c1efe84b428 124
Owenmatthewmcgowan 0:1c1efe84b428 125 case 0.5<=r<=0.6 :
Owenmatthewmcgowan 0:1c1efe84b428 126 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 127 break;
Owenmatthewmcgowan 0:1c1efe84b428 128
Owenmatthewmcgowan 0:1c1efe84b428 129 case 0.6<=r<=0.7 :
Owenmatthewmcgowan 0:1c1efe84b428 130 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 131 break;
Owenmatthewmcgowan 0:1c1efe84b428 132
Owenmatthewmcgowan 0:1c1efe84b428 133 case 0.7<=r<=0.8 :
Owenmatthewmcgowan 0:1c1efe84b428 134 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 135 break;
Owenmatthewmcgowan 0:1c1efe84b428 136
Owenmatthewmcgowan 0:1c1efe84b428 137 case 0.8<=r<=0.9 :
Owenmatthewmcgowan 0:1c1efe84b428 138 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 139 break;
Owenmatthewmcgowan 0:1c1efe84b428 140
Owenmatthewmcgowan 0:1c1efe84b428 141 case 0.9<=r<=1.0 :
Owenmatthewmcgowan 0:1c1efe84b428 142 Num4 = () ;
Owenmatthewmcgowan 0:1c1efe84b428 143 break;
Owenmatthewmcgowan 0:1c1efe84b428 144 }
Owenmatthewmcgowan 0:1c1efe84b428 145 }