make wiring diagrams more consitent
[challenge-bot] / bill-of-materials.rkt
CommitLineData
845aa5f9 1#! /usr/bin/env racket
2#lang racket
3
4(module+ main
5 (displayln total-cost))
6
5e2e135e 7;; TODO: describe in detail what each field is
8(struct item
9 (description quantity unit-cost max-lead-days where-to-get note))
10(define (make-item
11 description quantity unit-cost max-lead-days where-to-get
12 [note ""])
13 (item description quantity unit-cost max-lead-days where-to-get note))
845aa5f9 14(define bill-of-materials
15 (list
5e2e135e 16 ;; TODO: add solid core wires
17 ;; TODO: add male-female jump wires for connecting sonar sensors
18 ;; TODO: add 4x AA batteries
19 ;; TODO: add 4x AA battery holder
20 ;; TODO: add 3d printer filament cost for wheel, sonar sensor holders,
21 ;; caster standoff
22 ;; TODO: add ball caster
23 ;; TODO: add angle bracket from evil mad science
24 (make-item "Arduino(tm) board"
25 1 16.98 8
26 (string-append
27 "http://www.colorapples.com/2012-new-arduino-uno-r3-board"
28 "-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA")
29 "comes with USB A to B cable")
30 (make-item "motor" 2 6 7 "https://solarbotics.com/product/gm3/")
31 (make-item "transparent 400 point (half) BreadBoard"
32 1 5.95 1
33 (string-append
34 "http://www.jameco.com/webapp/wcs/stores/servlet/"
35 "Product_10001_10001_2123830_-1"))
36 (make-item "jumper wire female/male" 1/5 6 2
37 (string-append "http://www.nexuscyber.com/"
38 "7-premium-40-pin-male-to-female-jumper-wires"))
39 (make-item "small squares of double sided tape"
40 1/30 12 1
41 (string-append
42 "http://www.officedepot.com/"
43 "a/products/495242/Scotch-Permanent-Double-Sided-Foam-Tape/"))
44 ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws
45 (make-item "#4-40 Phillips 1 1/4 inch screws"
46 3 .1 1
47 "olander" "price is an estimate. can pick up in person")
48 ;; TODO: get actual cost of #4-40 hex lock nuts
49 (make-item "#4-40 hex lock nuts"
50 6 .1 1
51 "olander" "price is an estimate. can pick up in person")
52 ;; TODO: get actual cost of #6-32 3/8" screws
53 (make-item "#6-32 button hex head socket 3/8 inch"
54 12 .1 1
55 "olander" "price is an estimate. can pick up in person")
56 (make-item "motor controller"
57 1 (/ 5.2 5) 10
58 "http://www.ebay.com/itm/like/180976411359?lpid=82")
59 (make-item "sonar sensor hc-sr04"
60 2 1.39 7
61 "http://www.ebay.com/itm/161156018270")))
845aa5f9 62
63(define total-cost
64 (apply + (for/list ([thing bill-of-materials])
65 (* (item-quantity thing) (item-unit-cost thing)))))