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
))
41 ;; TODO: add actual cost for screws, nuts, and other estimated parts
42 ;; TODO: add male-female jump wires for connecting sonar sensors
43 ;; TODO: add 3d printer filament cost for wheel, sonar sensor holders,
45 ;; TODO: add ball caster
46 ;; TODO: checkout the following, if it's not a fraud, buy for next class
48 ;;; "http://www.ebay.com/itm/UNO-R3-Development-Board-MEGA328P-"
49 ;;; "ATMEGA16U2-For-Arduino-Compatible-USB-Cable/201090526898")
50 ;;; only $9.99 for arduino uno r3 + usb!!
51 (define bill-of-materials
53 ;; the construction of the first item is heavily commented.
54 ;; the higher amount of commenting is intended to make it clear
55 ;; how the code works to new readers
56 (make-item (string-append
57 ;; this is the argument for the parameter 'description'.
58 ;; it's a description of the orange wire. this is for
60 "solid core orange 22 awg wire, male-male jump wire."
61 " units in mm. makes electrical connection between"
62 " arduino and motor controller, used for backwards"
65 ;; this is the argument for the parameter 'quantity'.
66 ;; this is the number of millimeters of orange wire
67 ;; in a single robot kit.
68 ;; there are 2 orange wires, one for each wire.
69 ;; the 120 mm wire reaches to the far side of the
73 ;; this is the argument for the parameter 'unit-cost'.
74 ;; the cost on jameco is 7.95 for 100 feet.
75 ;; this calculation converts from dollars per foot to
76 ;; dollars per millimeter.
77 ;; there are 100 feet, 12 inches per foot, 2.54 cm / inch,
79 ;; the product of all these numbers is the number of
80 ;; millimeters purchased with $7.95
81 (/ 7.95 (* 100 12 2.54 10))
83 ;; this is the argument for the parameter 'max-lead-days'.
84 ;; since the part is at jameco, i can pick it up same day.
87 ;; this is the argument for the parameter 'where-to-get'.
88 ;; it is a url where the part can be purchased.
90 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
91 "_10001_10001_2154871_-1"))
93 (make-item (string-append
94 "solid core blue 22 awg wire, male-male jump wire."
95 " units in mm. connects motor controller and arduino,"
96 " used for forwards enabling.")
98 (/ 7.95 (* 100 12 25.4))
101 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
102 "_10001_10001_36768_-1"))
103 (make-item (string-append
104 "solid core white 22 awg wire, male-male jump wire."
105 " units in mm. connects motor controller and arduino,"
106 " used for speed signal.")
109 (/ 7.95 (* 100 12 25.4))
112 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
113 "_10001_10001_36881_-1")
114 (string-append "unit cost goes down for large orders,"
115 " see page for specifics"))
116 (make-item (string-append
117 "solid core green 22 awg wire, male-male jump wire."
118 " units in mm. connects motor to breadboard.")
120 (/ 7.95 (* 100 12 25.4))
123 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
124 "_10001_10001_36822_-1"))
125 (make-item (string-append
126 "solid core yellow 22 awg wire, male-male jump wire."
127 " units in mm. connects motor to breadboard.")
129 (/ 7.95 (* 100 12 25.4))
132 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
133 "_10001_10001_36920_-1"))
134 (make-item (string-append
135 "solid core red 22 awg wire, male-male jump wire."
136 " units in mm. connects power for all components.")
138 (/ 7.95 (* 100 12 25.4))
141 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
142 "_10001_10001_36856_-1"))
143 (make-item (string-append
144 "solid core black 22 awg wire, male-male jump wire."
145 " units in mm. connects ground for all components.")
146 (+ (* 30 2) (* 4 25) 25 55)
147 (/ 7.95 (* 100 12 25.4))
150 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
151 "_10001_10001_36792_-1"))
152 (make-item "9v battery"
154 "http://www.frys.com/product/5234117"
156 (make-item "9v battery holder"
159 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
160 "_10001_10001_2128067_-1")
162 (make-item "AA battery"
164 "http://www.frys.com/product/6292850"
166 (make-item "4xAA battery holder"
169 "http://shop.evilmadscientist.com/"
170 "productsmenu/partsmenu/422")
172 "can get in store. unit cost goes down for large orders"
173 ", see page for specifics."))
174 (make-item "angle bracket, 1/2 inch sides with #6-32 threaded hole"
177 "http://shop.evilmadscientist.com/productsmenu/partsmenu"
180 "can get in store. unit cost goes down for large orders"
181 ", see page for specifics."))
182 (make-item "Arduino(tm) board"
185 "http://www.colorapples.com/2012-new-arduino-uno-r3-boar"
186 "d-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA")
188 "comes with USB A to B cable. unit cost goes down for"
189 " large orders, see page for specifics."))
190 (make-item "motor" 2 6 7 "https://solarbotics.com/product/gm3/")
191 (make-item "transparent 400 point (half) BreadBoard"
194 "http://www.jameco.com/webapp/wcs/stores/servlet/"
195 "Product_10001_10001_2123830_-1"))
196 (make-item "jumper wire female/male" 1/5 6 2
197 (string-append "http://www.nexuscyber.com/7-premium-40-"
198 "pin-male-to-female-jumper-wires"))
199 (make-item "deck 8x8 inches"
201 ;; cost of entire 24x48 inch pegboard is 55.25
202 ;; each deck is only 8x8 inch
203 (/ 55.25 (* (/ 24 8) (/ 48 8)))
206 "http://www.homedepot.com/p/"
207 "Triton-1-4-in-Custom-Painted-Blissful-White-Pegboard"
208 "-Wall-Organizer-Set-of-2-TPB-2W/205192313#specifications"))
209 (make-item "small squares of double sided tape"
212 "http://www.officedepot.com/a/products/495242/"
213 "Scotch-Permanent-Double-Sided-Foam-Tape/"))
214 ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws
215 (make-item "#4-40 Phillips 1 1/4 inch screws"
217 "olander" "price is an estimate. can pick up in person")
218 ;; TODO: get actual cost of #4-40 hex lock nuts
219 (make-item "#4-40 hex lock nuts"
221 "olander" "price is an estimate. can pick up in person")
222 ;; TODO: get actual cost of #6-32 3/8" screws
223 (make-item "#6-32 button hex head socket 3/8 inch"
225 "olander" "price is an estimate. can pick up in person")
226 (make-item "motor controller"
228 "http://www.ebay.com/itm/like/180976411359?lpid=82")
229 (make-item "sonar sensor hc-sr04"
231 "http://www.ebay.com/itm/161156018270")))
234 (apply + (for/list
([thing bill-of-materials
])
235 (* (item-quantity thing
) (item-unit-cost thing
)))))