5 (displayln total-cost
))
7 ;; the robot is made of a bunch of items, like a screw or a motor.
9 ;; this is a description of items in general.
11 (;; each item has a natural language description what the part is.
14 ;; how many units of this item are on a single robot
17 ;; how much does a single unit of these items cost
20 ;; how many days will it take to get the item
23 ;; how to obtain the item
26 ;; any special notes about the item
29 ;; usually, the above code would be enough for describing a bunch of
30 ;; items. unfortunately, the last argument, for the parameter 'note',
31 ;; must be supplied in the default item constructor created above.
32 ;; this constructor below, called 'make-item', allows creating
33 ;; items without supplying the argument for the parameter 'note'. if
34 ;; the 'note' argument is not supplied, it will be replaced by the
37 description quantity unit-cost max-lead-days where-to-get
39 (item description quantity unit-cost max-lead-days where-to-get note
))
42 ;; TODO: add actual cost for screws, nuts, and other estimated parts
43 ;; TODO: add male-female jump wires for connecting sonar sensors
44 ;; TODO: add 3d printer filament cost for wheel, sonar sensor holders,
46 ;; TODO: add ball caster
47 ;; TODO: add 9v battery holder and 9v battery
48 ;; TODO: checkout the following, if it's not a fraud, buy for next class
50 ;;; "http://www.ebay.com/itm/UNO-R3-Development-Board-MEGA328P-"
51 ;;; "ATMEGA16U2-For-Arduino-Compatible-USB-Cable/201090526898")
52 ;;; only $9.99 for arduino uno r3 + usb!!
53 (define bill-of-materials
55 ;; the construction of the first item is heavily commented.
56 ;; the higher amount of commenting is intended to make it clear
57 ;; how the code works to new readers
58 (make-item (string-append
59 ;; this is the argument for the parameter 'description'.
60 ;; it's a description of the orange wire. this is for
62 "solid core orange 22 awg wire, male-male jump wire."
63 " units in mm. makes electrical connection between"
64 " arduino and motor controller, used for backwards"
67 ;; this is the argument for the parameter 'quantity'.
68 ;; this is the number of millimeters of orange wire
69 ;; in a single robot kit.
70 ;; there are 2 orange wires, one for each wire.
71 ;; the 120 mm wire reaches to the far side of the
75 ;; this is the argument for the parameter 'unit-cost'.
76 ;; the cost on jameco is 7.95 for 100 feet.
77 ;; this calculation converts from dollars per foot to
78 ;; dollars per millimeter.
79 ;; there are 100 feet, 12 inches per foot, 2.54 cm / inch,
81 ;; the product of all these numbers is the number of
82 ;; millimeters purchased with $7.95
83 (/ 7.95 (* 100 12 2.54 10))
85 ;; this is the argument for the parameter 'max-lead-days'.
86 ;; since the part is at jameco, i can pick it up same day.
89 ;; this is the argument for the parameter 'where-to-get'.
90 ;; it is a url where the part can be purchased.
92 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
93 "_10001_10001_2154871_-1"))
95 (make-item (string-append
96 "solid core blue 22 awg wire, male-male jump wire."
97 " units in mm. connects motor controller and arduino,"
98 " used for forwards enabling.")
100 (/ 7.95 (* 100 12 25.4))
103 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
104 "_10001_10001_36768_-1"))
105 (make-item (string-append
106 "solid core white 22 awg wire, male-male jump wire."
107 " units in mm. connects motor controller and arduino,"
108 " used for speed signal.")
111 (/ 7.95 (* 100 12 25.4))
114 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
115 "_10001_10001_36881_-1")
116 (string-append "unit cost goes down for large orders,"
117 " see page for specifics"))
118 (make-item (string-append
119 "solid core green 22 awg wire, male-male jump wire."
120 " units in mm. connects motor to breadboard.")
122 (/ 7.95 (* 100 12 25.4))
125 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
126 "_10001_10001_36822_-1"))
127 (make-item (string-append
128 "solid core yellow 22 awg wire, male-male jump wire."
129 " units in mm. connects motor to breadboard.")
131 (/ 7.95 (* 100 12 25.4))
134 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
135 "_10001_10001_36920_-1"))
136 (make-item (string-append
137 "solid core red 22 awg wire, male-male jump wire."
138 " units in mm. connects power for all components.")
140 (/ 7.95 (* 100 12 25.4))
143 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
144 "_10001_10001_36856_-1"))
145 (make-item (string-append
146 "solid core black 22 awg wire, male-male jump wire."
147 " units in mm. connects ground for all components.")
148 (+ (* 30 2) (* 4 25) 25 55)
149 (/ 7.95 (* 100 12 25.4))
152 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
153 "_10001_10001_36792_-1"))
154 (make-item "4xAA battery"
156 "http://www.frys.com/product/6292850"
158 (make-item "4xAA battery holder"
161 "http://shop.evilmadscientist.com/"
162 "productsmenu/partsmenu/422")
164 "can get in store. unit cost goes down for large orders"
165 ", see page for specifics."))
166 (make-item "angle bracket, 1/2 inch sides with #6-32 threaded hole"
169 "http://shop.evilmadscientist.com/productsmenu/partsmenu"
172 "can get in store. unit cost goes down for large orders"
173 ", see page for specifics."))
174 (make-item "Arduino(tm) board"
177 "http://www.colorapples.com/2012-new-arduino-uno-r3-boar"
178 "d-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA")
180 "comes with USB A to B cable. unit cost goes down for"
181 " large orders, see page for specifics."))
182 (make-item "motor" 2 6 7 "https://solarbotics.com/product/gm3/")
183 (make-item "transparent 400 point (half) BreadBoard"
186 "http://www.jameco.com/webapp/wcs/stores/servlet/"
187 "Product_10001_10001_2123830_-1"))
188 (make-item "jumper wire female/male" 1/5 6 2
189 (string-append "http://www.nexuscyber.com/7-premium-40-"
190 "pin-male-to-female-jumper-wires"))
191 (make-item "small squares of double sided tape"
194 "http://www.officedepot.com/a/products/495242/"
195 "Scotch-Permanent-Double-Sided-Foam-Tape/"))
196 ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws
197 (make-item "#4-40 Phillips 1 1/4 inch screws"
199 "olander" "price is an estimate. can pick up in person")
200 ;; TODO: get actual cost of #4-40 hex lock nuts
201 (make-item "#4-40 hex lock nuts"
203 "olander" "price is an estimate. can pick up in person")
204 ;; TODO: get actual cost of #6-32 3/8" screws
205 (make-item "#6-32 button hex head socket 3/8 inch"
207 "olander" "price is an estimate. can pick up in person")
208 (make-item "motor controller"
210 "http://www.ebay.com/itm/like/180976411359?lpid=82")
211 (make-item "sonar sensor hc-sr04"
213 "http://www.ebay.com/itm/161156018270")))
216 (apply + (for/list
([thing bill-of-materials
])
217 (* (item-quantity thing
) (item-unit-cost thing
)))))