2 # Copyright 2021 by Bdale Garbee <bdale@gag.com>. GPLv3
4 # Program to emit PCB footprint for NHD-C0216CZ-FSW-FBW-3V3 2x16 text LCD
7 # dimensions in mm from NHD-C0216CZ-FSW-FBW-3V3.pdf datasheet
10 BodyHeightOffset = -0.75 # pin row to body edge distance
16 ViewHCtr = 15.8 / 2 + 7.6 - BodyHeight / 2
20 # we're going to use the 1/100 of a mil fundamental unit form
22 return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 )
24 print '# author: Bdale Garbee'
25 print '# email: bdale@gag.com'
26 print '# dist-license: GPL 3'
27 print '# use-license: unlimited'
29 print 'Element[0x0 "NHD-C0216CZ" "" "" 0 0 0 0 0 100 0x0]'
33 # pin( x y thickness clearance mask drillhole name number flags)
34 for pin in range (1,Pins+1):
41 mm2mils100((pin - 5.5)*PinSpacing), \
42 mm2mils100(-BodyHeight/2), \
43 mm2mils100(PinDiam * 1.75), \
45 mm2mils100(PinDiam * 1.75) + 600, \
46 mm2mils100(PinDiam), \
47 '"pin%i"' % (pin), '"%i"' % (pin), Flags, ']'
49 print ' ElementLine[',\
50 -mm2mils100(BodyWidth/2), \
51 -mm2mils100(BodyHeight/2-BodyHeightOffset), \
52 mm2mils100(BodyWidth/2), \
53 -mm2mils100(BodyHeight/2-BodyHeightOffset), \
56 print ' ElementLine[',\
57 -mm2mils100(BodyWidth/2), \
58 -mm2mils100(BodyHeight/2-BodyHeightOffset), \
59 -mm2mils100(BodyWidth/2), \
60 mm2mils100(BodyHeight/2-BodyHeightOffset), \
63 print ' ElementLine[',\
64 -mm2mils100(BodyWidth/2), \
65 mm2mils100(BodyHeight/2-BodyHeightOffset), \
66 mm2mils100(BodyWidth/2), \
67 mm2mils100(BodyHeight/2-BodyHeightOffset), \
70 print ' ElementLine[',\
71 mm2mils100(BodyWidth/2), \
72 mm2mils100(BodyHeight/2-BodyHeightOffset), \
73 mm2mils100(BodyWidth/2), \
74 -mm2mils100(BodyHeight/2-BodyHeightOffset), \
80 print ' ElementLine[',\
81 mm2mils100(-ViewWidth/2), \
82 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \
83 mm2mils100(ViewWidth/2), \
84 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \
88 print ' ElementLine[',\
89 mm2mils100(-ViewWidth/2), \
90 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
91 mm2mils100(ViewWidth/2), \
92 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
96 print ' ElementLine[',\
97 mm2mils100(-ViewWidth/2), \
98 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
99 mm2mils100(-ViewWidth/2), \
100 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \
104 print ' ElementLine[',\
105 mm2mils100(ViewWidth/2), \
106 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
107 mm2mils100(ViewWidth/2), \
108 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \
112 print ' ElementLine[',\
113 mm2mils100(ViewWidth/2), \
114 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
115 mm2mils100(-ViewWidth/2), \
116 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \
120 print ' ElementLine[',\
121 mm2mils100(-ViewWidth/2), \
122 mm2mils100(ViewHCtr - ViewHeight/2-BodyHeightOffset), \
123 mm2mils100(ViewWidth/2), \
124 mm2mils100(ViewHCtr + ViewHeight/2-BodyHeightOffset), \