From 21e0586ed5a9159cd440d9a4f80783ca31b2c656 Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Thu, 26 May 2022 01:16:33 +0200 Subject: [PATCH 1/3] implement cross fading --- software/clock.py | 14 +++++----- software/config_english.py | 8 +++--- software/hw.py | 56 +++++++++++++++++++++++++++++++------- software/neopixel.py | 7 +++-- software/time_funcs.py | 2 +- 5 files changed, 63 insertions(+), 24 deletions(-) diff --git a/software/clock.py b/software/clock.py index 1b778b6..f2a49df 100644 --- a/software/clock.py +++ b/software/clock.py @@ -17,6 +17,7 @@ def sync_time_ntp(): time_refresh_counter = 0 +display_pixels = bytearray(len(hw.current_pixels)) def refresh_time_display(): @@ -28,16 +29,15 @@ def refresh_time_display(): # clear & fill pixel_buffer with next lit pixels # we need to buffer pixels, to ensure that we don't get weird in-between states while updating the time # since pixel_effect uses hw.lit_pixels constantly to display pixels - for i in range(len(hw.pixel_buffer)): - hw.pixel_buffer[i] = 0 - time_funcs.update_pixels_for_time(time_tuple[3], time_tuple[4], hw.pixel_buffer) + for i in range(len(display_pixels)): + display_pixels[i] = 0 + time_funcs.update_pixels_for_time(time_tuple[3], time_tuple[4], display_pixels) if LOCALE_SPECIFIC_PIXEL_UPDATE_FUNC: - LOCALE_SPECIFIC_PIXEL_UPDATE_FUNC(time_tuple[3], time_tuple[4], hw.pixel_buffer) + LOCALE_SPECIFIC_PIXEL_UPDATE_FUNC(time_tuple[3], time_tuple[4], display_pixels) # blit pixels to actually displayed pixels - for i in range(len(hw.lit_pixels)): - hw.lit_pixels[i] = hw.pixel_buffer[i] - time_funcs.print_letterplate(hw.lit_pixels) + hw.update_pixels(display_pixels) + time_funcs.print_letterplate(display_pixels) if time_refresh_counter > 30: print_meminfo() diff --git a/software/config_english.py b/software/config_english.py index b18dd90..3605190 100644 --- a/software/config_english.py +++ b/software/config_english.py @@ -66,13 +66,13 @@ def LOCALE_SPECIFIC_PIXEL_UPDATE_FUNC(hours, minutes, pixel_data): additional_dots = minutes % 5 if additional_dots >= 1: - pixel_data[LETTERPLATE_WIDTH * 8 + 0] = 1 + pixel_data[LETTERPLATE_WIDTH * 8 + 0] = 255 if additional_dots >= 2: - pixel_data[LETTERPLATE_WIDTH * 8 + 1] = 1 + pixel_data[LETTERPLATE_WIDTH * 8 + 1] = 255 if additional_dots >= 3: - pixel_data[LETTERPLATE_WIDTH * 8 + 9] = 1 + pixel_data[LETTERPLATE_WIDTH * 8 + 9] = 255 if additional_dots >= 4: - pixel_data[LETTERPLATE_WIDTH * 8 + 10] = 1 + pixel_data[LETTERPLATE_WIDTH * 8 + 10] = 255 LOCALE_SPECIFIC_MINUTES_FUNC = lambda hours, minutes: minutes - minutes % 5 diff --git a/software/hw.py b/software/hw.py index 5a9ed2e..2787a21 100644 --- a/software/hw.py +++ b/software/hw.py @@ -14,12 +14,17 @@ rtc = urtc.DS1307(i2c=i2c, address=104) -lit_pixels = bytearray(len(config.LETTERPLATE) * config.LETTERPLATE_WIDTH) -pixel_buffer = bytearray(len(lit_pixels)) +current_pixels = bytearray(len(config.LETTERPLATE) * config.LETTERPLATE_WIDTH) +pixel_buffer = bytearray(len(current_pixels)) clock_timer = [] +def update_pixels(new_pixels): + for i in range(len(new_pixels)): + pixel_buffer[i] = new_pixels[i] + + def add_timer(period, callback): # esp8266 timer = machine.Timer(-1) @@ -27,14 +32,22 @@ def add_timer(period, callback): clock_timer.append(timer) -def wheel_color(n): +def wheel_color(n, opacity): + def apply_opacity(color): + if opacity >= 255: + return color + elif opacity <= 0: + return 0 + # approximation of color * opacity/255.0, just doesn't use floating point operations + return (color * opacity) >> 8 + colorwheel_part = int(n / 128) if colorwheel_part == 0: - return 127 - n % 128, n % 128, 0, 0 + return apply_opacity(127 - n % 128), apply_opacity(n % 128), 0, 0 elif colorwheel_part == 1: - return 0, 127 - n % 128, n % 128, 0 + return 0, apply_opacity(127 - n % 128), apply_opacity(n % 128), 0 elif colorwheel_part == 2: - return n % 128, 0, 127 - n % 128, 0 + return apply_opacity(n % 128), 0, apply_opacity(127 - n % 128), 0 else: print(colorwheel_part) return 0, 0, 0, 0 @@ -44,11 +57,31 @@ def pixel_effect(): np.fill((0, 0, 0, 0)) for j in range(0, 384 * 5): - for i in range(len(lit_pixels)): - if lit_pixels[i] != 0: - np[i] = (wheel_color(((i * int(384 / np.n)) + j) % 384)) + for i in range(len(current_pixels)): + dest = pixel_buffer[i] + current = current_pixels[i] + new = 0 + if dest != current or dest != 0 or current != 0: + if dest == current: + opacity = 255 + elif dest < current: + # when a pixel is supposed to fade out (dest 0, current = 255) + new = current - 50 + if new < 0: + new = 0 + current_pixels[i] = new + opacity = abs(current - dest) + else: + # when a pixel is supposed to fade in (dest = 255, current = 0) + new = current + 10 + if new > 255: + new = 255 + current_pixels[i] = new + opacity = 255 - abs(dest - current) +# print(i, dest, current, opacity) + np[i] = (wheel_color(((i * int(384 / np.n)) + j) % 384, opacity)) else: - np[i] = 0, 0, 0, 0 + np[i] = (0, 0, 0, 0) np.write() @@ -65,3 +98,6 @@ def pixel_effect(): # tim = Timer(-1) # tim.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1)) # tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2)) + + + diff --git a/software/neopixel.py b/software/neopixel.py index 01f77eb..0acc59c 100644 --- a/software/neopixel.py +++ b/software/neopixel.py @@ -2,13 +2,14 @@ # MIT license; Copyright (c) 2016 Damien P. George, 2021 Jim Mussared # only included to check api compatibility when debugging/testing on non-target-hw +import time class NeoPixel: # G R B W ORDER = (1, 0, 2, 3) - def __init__(self, pin, n, bpp=3, timing=1): + def __init__(self, pin, n, bpp=3): self.n = n self.bpp = bpp self.buf = bytearray(n * bpp) @@ -37,4 +38,6 @@ def fill(self, v): j += bpp def write(self): - pass + print(''.join('{:02x}'.format(x) for x in self.buf)) + time.sleep(0.01) + diff --git a/software/time_funcs.py b/software/time_funcs.py index 4a06de4..8e14f45 100644 --- a/software/time_funcs.py +++ b/software/time_funcs.py @@ -46,7 +46,7 @@ def lit_pixels_for_value(value, pixel_data): end_idx = idx + len(value[1]) - 1 for x in range(idx, end_idx + 1, 1): - pixel_data[y * LETTERPLATE_WIDTH + x] = 1 + pixel_data[y * LETTERPLATE_WIDTH + x] = 255 def update_pixels_for_time(hours, minutes, pixel_data): From 5f4a387a0d7361ca6303a20061579cc0eef60168 Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Sun, 29 May 2022 14:28:46 +0200 Subject: [PATCH 2/3] - changed 3d printed parts for nicer fit of backplate_wall - more documentation - license changed to MIT - added tester config --- LICENSE.md | 442 +------------------------- README.md | 65 +++- hardware/README.md | 10 + hardware/backplate_wall.scad | 19 +- hardware/build.bat | 2 +- hardware/common.scad | 4 +- hardware/config.scad | 1 + hardware/config_common.scad | 25 +- hardware/config_tester.scad | 15 + hardware/constants_calculated.scad | 4 +- hardware/files_to_print.txt | 4 - hardware/letter_plate.scad | 36 ++- hardware/textclock.scad | 8 +- software/README.md | 2 +- software/_hwcode.py | 47 --- software/config_english.py | 2 +- software/pins.txt | 11 +- software/{LICENSE => wifimgr-LICENSE} | 0 18 files changed, 173 insertions(+), 524 deletions(-) create mode 100644 hardware/README.md create mode 100644 hardware/config_tester.scad delete mode 100644 hardware/files_to_print.txt delete mode 100644 software/_hwcode.py rename software/{LICENSE => wifimgr-LICENSE} (100%) diff --git a/LICENSE.md b/LICENSE.md index 1f5e203..d23c415 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,441 +1,9 @@ -This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. +All files are licensed under MIT: -Attribution-NonCommercial-ShareAlike 4.0 International (CC-BY-NC-SA 4.0) +Copyright 2022 Florian Roks -https://creativecommons.org/licenses/by-nc-sa/4.0/ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -======================================================================= +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International -Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-NonCommercial-ShareAlike 4.0 International Public License -("Public License"). To the extent this Public License may be -interpreted as a contract, You are granted the Licensed Rights in -consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the -Licensor receives from making the Licensed Material available under -these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - m. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - n. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database for NonCommercial purposes - only; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 378b923..402e6e9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,72 @@ textclock ========= +# Introduction + textclock is a parametric 3d-printable textclock. It's currently in development. -It's designed to be used with a 60 led/m SK6812 led-strip, and an esp8266 (using micropython) -for control. Using an ESP32 is also possible, but timer handling and pins -might need to be changed. +It's designed to be used with a 60 led/m SK6812 led-strip, and an esp8266 using micropython for control. +Using an ESP32 or any other micropython-capable board is also possible, but timer handling and pins might +need to be changed. + +The letterface is available in English and German, but can be easily adapted to other languages, as well as your +specific needs. The letters "stamped" into clock are just configuration files with text - look at the +[english one](hardware/config_sk6812_english_minimal.scad) for a glimpse. -The letterface is available in English and German, but can be easily adapted to other languages. +The configuration for most parameters is also adjustable in the [config_common.scad](hardware/config_common.scad) file. ![rendering](doc/render.png) +# Requirements + +## Parts / BOM + +In the default configuration the clock requires the following parts: + +### 3d printed parts + +__Note: Please read the Printed parts (IMPORTANT!)" section before you print them__ + +- letter plate (front face of the clock, includes the letters shown and separation between them) +- led holder plate (used with fixation plate to clamp the led strips between them) +- led fixation plate (used to clamp strips & serves as mount for electronics) +- backplate/wallmount (to close the case and enable mounting it to a wall) + +### hardware +- M2.5 brass threaded inserts +- M2.5 machine screws (short, maybe 6mm?) + +### electronics +- ESP8266 (or ESP32) NodeMCU-style board +- SK6812 60 LEDs/m RGBW strip +- DS1307 RTC module (I used a dual module called "Tiny RTC" that additionally includes an eeprom, and just didn't it) +- THT angled pin headers (2.54mm) +- Jumper wires (F-F, just cut them up) +- misc. cables (you can use the jumper wire remains) + +Since the 3d files are written in OpenSCAD, you can modify them to your needs and available electronics or led strips. + +## Printed parts (IMPORTANT!) + +- 0.15mm layer height (some parameters in `config_common.scad` need to be changed if you want to use a different height) +- 0.4mm nozzle (for more detailed letters, you could potentially use a smaller nozzle) +- Filament: __Your filament choice is crucial for success.__ It must be opaque enough to block the light at ~1mm height, + but let light through at 0.15mm (single layer height). You can print a smaller test print + to determine if your filament is suitable. + +# Assembly + +## Printed parts + +### Install threaded inserts + +## Electronics + +### Prepare ESP8266 + +First step is to solder the angled pin headers to the ESP8266 board. Please note, that you may need to remove the +standard headers first. + +## Software The process of installing the software is described in the [software-folders README](software/README.md) diff --git a/hardware/README.md b/hardware/README.md new file mode 100644 index 0000000..a954030 --- /dev/null +++ b/hardware/README.md @@ -0,0 +1,10 @@ +### Recreate required stls + +To recreate the required STL-files, you can run `build.bat`. Please note, that OpensCAD needs to be installed in `%PROGRAMFILES%\OpenSCAD\openscad.exe`. + +If you want to manually recreate the files, you need to open, render & export the following files in OpenSCAD: +- led_fixation_plate.scad +- led_holder_plate.scad +- backplate_wall.scad +- letter_plate.scad + diff --git a/hardware/backplate_wall.scad b/hardware/backplate_wall.scad index 44aeae0..483e054 100644 --- a/hardware/backplate_wall.scad +++ b/hardware/backplate_wall.scad @@ -10,6 +10,7 @@ CABLE_SLOT_WIDTH = 30; CABLE_SLOT_HEIGHT = 50; CABLE_ROUND_EDGES = 2; +REDUCED_SIZE = 2*OUTER_WALL_THICKNESS + INNER_PLATE_TOLERANCE; module wall_mount_holes() { translate([TOTAL_WIDTH/2, TOTAL_HEIGHT/5*4, -0.05]) @@ -22,14 +23,24 @@ module wall_mount_holes() { module backplate_wall() { difference() { intersection() { - round_edges_cube(); - cube([TOTAL_WIDTH, - TOTAL_HEIGHT, + translate([REDUCED_SIZE/2, REDUCED_SIZE/2, 0]) + cube([TOTAL_WIDTH - REDUCED_SIZE, + TOTAL_HEIGHT - REDUCED_SIZE, WALLMOUNT_PLATE_THICKNESS]); } wall_mount_holes(); corner_holes(offset=20, d=SCREW_DIAMETER, h=100); - corner_holes(offset=WALLMOUNT_PLATE_THICKNESS+0.01, d=SCREW_DIAMETER*2, h=WALLMOUNT_PLATE_THICKNESS-1.5); + corner_holes(offset=WALLMOUNT_PLATE_THICKNESS+0.01, + d=SCREW_DIAMETER*2, + h=WALLMOUNT_PLATE_THICKNESS-1.5); + translate([OUTER_WALL_THICKNESS,OUTER_WALL_THICKNESS, 1.5]) + cube([SCREW_DIAMETER, SCREW_DIAMETER, WALLMOUNT_PLATE_THICKNESS], center=false); + translate([TOTAL_WIDTH-2*OUTER_WALL_THICKNESS,OUTER_WALL_THICKNESS, 1.5]) + cube([SCREW_DIAMETER, SCREW_DIAMETER, WALLMOUNT_PLATE_THICKNESS], center=false); + translate([TOTAL_WIDTH-2*OUTER_WALL_THICKNESS,TOTAL_HEIGHT-2*OUTER_WALL_THICKNESS, 1.5]) + cube([SCREW_DIAMETER, SCREW_DIAMETER, WALLMOUNT_PLATE_THICKNESS], center=false); + translate([OUTER_WALL_THICKNESS,TOTAL_HEIGHT-2*OUTER_WALL_THICKNESS, 1.5]) + cube([SCREW_DIAMETER, SCREW_DIAMETER, WALLMOUNT_PLATE_THICKNESS], center=false); translate([TOTAL_WIDTH/2-CABLE_SLOT_WIDTH/2,-CABLE_ROUND_EDGES,-0.01]) rounded_cube([CABLE_SLOT_WIDTH, CABLE_SLOT_HEIGHT+CABLE_ROUND_EDGES, WALLMOUNT_PLATE_THICKNESS+0.1], CABLE_ROUND_EDGES); } diff --git a/hardware/build.bat b/hardware/build.bat index 5d4f4d5..02c1bcd 100644 --- a/hardware/build.bat +++ b/hardware/build.bat @@ -7,7 +7,7 @@ RD /Q /S %OUTPUT_DIRECTORY% IF NOT EXIST "%OUTPUT_DIRECTORY%" ( MKDIR %OUTPUT_DIRECTORY% ) ECHO Creating STLs -FOR /F %%x IN (files_to_print.txt) DO ( +FOR %%x IN (led_fixation_plate led_holder_plate backplate_wall letter_plate) DO ( ECHO - %%x.stl %OPENSCAD% -o %OUTPUT_DIRECTORY%\%%x.stl %%x.scad ) diff --git a/hardware/common.scad b/hardware/common.scad index 3221357..24b6f25 100644 --- a/hardware/common.scad +++ b/hardware/common.scad @@ -33,7 +33,9 @@ module triangle(point1, point2, depth) { } module round_edges_cube(offset=0) { - translate([0, 0, -50]) rounded_cube([TOTAL_WIDTH, TOTAL_HEIGHT, 100], r=ROUND_EDGES_RADIUS, offset=offset); + translate([0, 0, -50]) + rounded_cube([TOTAL_WIDTH, TOTAL_HEIGHT, 100], + r=ROUND_EDGES_RADIUS, offset=offset); } module fit_inner_cube() { diff --git a/hardware/config.scad b/hardware/config.scad index 4730a3d..916c07d 100644 --- a/hardware/config.scad +++ b/hardware/config.scad @@ -1,4 +1,5 @@ include include //include +//include include diff --git a/hardware/config_common.scad b/hardware/config_common.scad index 1a14e13..fa289e4 100644 --- a/hardware/config_common.scad +++ b/hardware/config_common.scad @@ -1,24 +1,34 @@ $fn=20; +// Distance between two leds on a strip - depending on your mounting direction, only one is actually relevant, +// but to keep the clock square, they should be the LED_STRIPE_HORIZ_DISTANCE = 16.66; LED_STRIPE_VERT_DISTANCE = 16.66; -LED_STRIPE_LED_WIDTH = 8; // The stripe-segments are soldered together, at those points the distance between leds varies a lot, sometimes resoldering is required +// The size of a single led module on that strip + +// The stripe-segments are soldered together, at those points the distance between leds varies a lot, +// sometimes resoldering is required, so the distances between the leds match up +LED_STRIPE_LED_WIDTH = 8; LED_STRIPE_LED_HEIGHT = 8; +// Since there are small capacitors right next to the leds, we need to provide a little space for them LED_STRIPE_CAP_WIDTH = 3; LED_STRIPE_CAP_HEIGHT = 5; LED_STRIPE_CAP_DEPTH = 1.5; // 1; +// Defines the offset for those capacitors from the leds LED_STRIPE_CAP_OFFSET_X = -4; LED_STRIPE_CAP_OFFSET_Y = 0; +// Parameters for the screw holes LETTER_PLATE_SCREW_INSERT_HEIGHT = 6; // 3.5; LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS = 2; LETTER_PLATE_SCREW_INSERT_DIAMETER = 4; LETTER_PLATE_SCREW_WALL_DIAMETER = LETTER_PLATE_SCREW_INSERT_DIAMETER + LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS; -SCREW_DIAMETER = 3.2; // M3 plus tolerance +SCREW_DIAMETER = 3.2; // OD of M2.5 threaded insert to be heat inserted +// Parameters for the corner holes (used to mount wallplate) CORNER_MOUNTING_HOLE_INSERT_HEIGHT = LETTER_PLATE_SCREW_INSERT_HEIGHT; CORNER_MOUNTING_HOLE_INSERT_DIAMETER = LETTER_PLATE_SCREW_INSERT_DIAMETER; CORNER_MOUNTING_HOLE_INSERT_WALL_THICKNESS = LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS; @@ -29,7 +39,7 @@ OUTER_HOLES_DIST = 2; INNER_HOLES_DIST = 4; LETTER_PLATE_LETTER_BOTTOM = 0.15; -LETTER_PLATE_THICKNESS = 1; +LETTER_PLATE_THICKNESS = 1.05; LETTER_SEPARATOR_THICKNESS = 2; LETTER_SEPARATOR_HEIGHT = 10; @@ -43,16 +53,21 @@ LED_FIXATION_CUTOUT_HEIGHT = 11; LED_FIXATION_CUTOUT_WIDTH = 6; LED_FIXATION_PLATE_THICKNESS = 2; +// Height of the backplate WALLMOUNT_PLATE_THICKNESS = 6; ELECTRONICS_HEIGHT = 15; OUTER_WALL_THICKNESS = 2; -OUTER_WALL_HEIGHT = 2 + LETTER_SEPARATOR_HEIGHT + (LED_HOLDER_PLATE_HEIGHT-LED_HOLDER_PLATE_DIVIDER_CUTOUT_DEPTH) + LED_FIXATION_PLATE_THICKNESS + - ELECTRONICS_HEIGHT; +OUTER_WALL_HEIGHT = 2 + LETTER_SEPARATOR_HEIGHT + + (LED_HOLDER_PLATE_HEIGHT-LED_HOLDER_PLATE_DIVIDER_CUTOUT_DEPTH) + + LED_FIXATION_PLATE_THICKNESS + ELECTRONICS_HEIGHT; // 2mm height tolerance to adjust fitting and led-stripe height ROUND_EDGES_RADIUS = 3; CONFIG_HORIZ_EXTRA = 0; CONFIG_VERT_EXTRA = 0; + + +TESTER_MODE = false; diff --git a/hardware/config_tester.scad b/hardware/config_tester.scad new file mode 100644 index 0000000..e218c15 --- /dev/null +++ b/hardware/config_tester.scad @@ -0,0 +1,15 @@ +// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. +// https://creativecommons.org/licenses/by-nc-sa/4.0/ +// (c) 2018 Florian Roks + +FONT_NAMES = ["DejaVu Sans Mono"]; + +FONT_SIZES = [10]; + +LETTERFACE = ["LO", + "VE"]; + +LETTERFACE_FONTS = ["00", + "00"]; + +TESTER_MODE = true; \ No newline at end of file diff --git a/hardware/constants_calculated.scad b/hardware/constants_calculated.scad index ea28666..f8104d1 100644 --- a/hardware/constants_calculated.scad +++ b/hardware/constants_calculated.scad @@ -9,10 +9,10 @@ TOTAL_WIDTH = LED_STRIPE_HORIZ_DISTANCE * LETTER_MATRIX_WIDTH + 2 * HORIZ_SIDE_E TOTAL_HEIGHT = LED_STRIPE_VERT_DISTANCE * LETTER_MATRIX_HEIGHT + 2 * VERT_SIDE_EXTRA; TOTAL_DEPTH = OUTER_WALL_HEIGHT; -echo("WIDTH=", TOTAL_WIDTH, "HEIGHT=", TOTAL_HEIGHT); +//echo("WIDTH=", TOTAL_WIDTH, "HEIGHT=", TOTAL_HEIGHT); LETTER_PLATE_MOUNTING_HOLE_POSITIONS = [ - [OUTER_HOLES_DIST, OUTER_HOLES_DIST], + [OUTER_HOLES_DIST, OUTER_HOLES_DIST], [OUTER_HOLES_DIST, LETTER_MATRIX_HEIGHT - OUTER_HOLES_DIST], [LETTER_MATRIX_WIDTH - OUTER_HOLES_DIST, OUTER_HOLES_DIST], [LETTER_MATRIX_WIDTH - OUTER_HOLES_DIST, LETTER_MATRIX_HEIGHT - OUTER_HOLES_DIST], diff --git a/hardware/files_to_print.txt b/hardware/files_to_print.txt deleted file mode 100644 index 8d54a63..0000000 --- a/hardware/files_to_print.txt +++ /dev/null @@ -1,4 +0,0 @@ -led_fixation_plate -led_holder_plate -backplate_wall -letter_plate \ No newline at end of file diff --git a/hardware/letter_plate.scad b/hardware/letter_plate.scad index be0491b..da07b1f 100644 --- a/hardware/letter_plate.scad +++ b/hardware/letter_plate.scad @@ -91,8 +91,9 @@ module corner_hole_wall(offset=0,h=OUTER_WALL_HEIGHT) { translate([CORNER_MOUNTING_HOLE_WALL_DIAMETER/2, CORNER_MOUNTING_HOLE_WALL_DIAMETER/2, h/2]) - cylinder(h=h, - d=CORNER_MOUNTING_HOLE_WALL_DIAMETER+offset, + cube(size = [CORNER_MOUNTING_HOLE_WALL_DIAMETER+offset, + CORNER_MOUNTING_HOLE_WALL_DIAMETER+offset, + h - WALLMOUNT_PLATE_THICKNESS], center=true); } @@ -132,14 +133,14 @@ module corner_holes_walls_bump() { } } -module outer_walls_bump() { +module outer_walls_bump(additional_height=0) { union() { - cube([TOTAL_WIDTH, OUTER_WALL_THICKNESS+1, LETTER_SEPARATOR_HEIGHT]); - cube([OUTER_WALL_THICKNESS+1, TOTAL_HEIGHT, LETTER_SEPARATOR_HEIGHT]); + cube([TOTAL_WIDTH, OUTER_WALL_THICKNESS+1, LETTER_SEPARATOR_HEIGHT + additional_height]); + cube([OUTER_WALL_THICKNESS+1, TOTAL_HEIGHT, LETTER_SEPARATOR_HEIGHT + additional_height]); translate([0,TOTAL_HEIGHT-OUTER_WALL_THICKNESS-1,0]) - cube([TOTAL_WIDTH, OUTER_WALL_THICKNESS+1, LETTER_SEPARATOR_HEIGHT]); + cube([TOTAL_WIDTH, OUTER_WALL_THICKNESS+1, LETTER_SEPARATOR_HEIGHT + additional_height]); translate([TOTAL_WIDTH-OUTER_WALL_THICKNESS-1,0,0]) - cube([OUTER_WALL_THICKNESS+1, TOTAL_HEIGHT, LETTER_SEPARATOR_HEIGHT]); + cube([OUTER_WALL_THICKNESS+1, TOTAL_HEIGHT, LETTER_SEPARATOR_HEIGHT + additional_height]); } } @@ -157,7 +158,8 @@ module clock_front() { inner_separator_grid(); outer_walls_bump(); screw_hole_walls(z_offset=LETTER_SEPARATOR_HEIGHT - LETTER_SEPARATOR_HEIGHT); - corner_holes_walls_bump(); +// corner_holes_walls_bump(); + corner_holes_walls(); } } @@ -173,6 +175,22 @@ module clock_front() { } +module tester_plate() { + difference() { + intersection() { + round_edges_cube(); + + union() { + front_plate(); + inner_separator_grid(); + outer_walls_bump(1.6); + } + } + letter_cutouts(); + } + +} + // arranged for 3d-printing / stl-export -clock_front(); +if (TESTER_MODE == true) { tester_plate(); } else { clock_front(); } diff --git a/hardware/textclock.scad b/hardware/textclock.scad index 6d4ec48..3d42e81 100644 --- a/hardware/textclock.scad +++ b/hardware/textclock.scad @@ -9,9 +9,9 @@ use ; use ; include -exploded_view = false; +exploded_view = true; -exploded_offset_diff = 10; +exploded_offset_diff = 30; led_holder_plate_z_offset = LETTER_SEPARATOR_HEIGHT-LED_HOLDER_PLATE_DIVIDER_CUTOUT_DEPTH; @@ -30,6 +30,6 @@ translate([0, (exploded_view ? 3*exploded_offset_diff : 0) + led_fixation_plate_z_offset]) led_fixation_plate(); -translate([0, 0, OUTER_WALL_HEIGHT]) - #backplate_wall(); +translate([0, 0, exploded_view ? 4*exploded_offset_diff : 0 ]) + backplate_wall(); \ No newline at end of file diff --git a/software/README.md b/software/README.md index 54e2c24..2c86347 100644 --- a/software/README.md +++ b/software/README.md @@ -1,7 +1,7 @@ ## Installing micropython on the clock ### Prerequisites -1. Make sure python is installed +1. Make sure python is installed on your computer 2. [Install esptool](https://docs.espressif.com/projects/esptool/en/latest/esp8266/index.html) ``` pip3 install esptool diff --git a/software/_hwcode.py b/software/_hwcode.py deleted file mode 100644 index f7d37b7..0000000 --- a/software/_hwcode.py +++ /dev/null @@ -1,47 +0,0 @@ -#from machine import Pin - -# from neopixel import NeoPixel - -#pin = Pin(0, Pin.OUT) # set GPIO0 to output to drive NeoPixels^ - - -# np = NeoPixel(pin, 110, bpp=4) # create NeoPixel driver on GPIO0 for 8 pixels - - -# np[0] = (255, 255, 255, 255) # set the first pixel to white -# np.write() # write data to all pixels -# r, g, b, w = np[0] # get first pixel colour - -# def lit(nrs, color): -# for nr in nrs: -# np[nr] = color -# -# -# # (0, 0, 0, 20) -# -# zw = (4, 5, 6, 7, 8, 9, 10) -# nach = (40, 41, 42, 43) -# drei = (60, 61, 62, 63) -# -# import time -# -# -# def wheelColor(n): -# l = int(n / 128) -# if l == 0: -# return 127 - n % 128, n % 128, 0, 0 -# elif l == 1: -# return 0, 127 - n % 128, n % 128, 0 -# elif l == 2: -# return n % 128, 0, 127 - n % 128, 0 -# else: -# print(l) -# -# -# def rainbowCycle(delay, np): -# n = np.n -# for j in range(0, 384 * 5): -# for i in range(0, n): -# np[i] = (wheelColor(((i * int(384 / n)) + j) % 384)) -# np.write() -# time.sleep_us(delay) diff --git a/software/config_english.py b/software/config_english.py index 3605190..8e51e26 100644 --- a/software/config_english.py +++ b/software/config_english.py @@ -13,7 +13,7 @@ LETTERPLATE_WIDTH = len(LETTERPLATE[0]) -# the right hand site in the following tables take an array of strings or tuples (or mixed) +# the right-hand site in the following tables take an array of strings or tuples (or mixed) # a tuple can be used in both tables, it consists of the line and the characters to be highlighted (lines start at 0!) # a string in the MINUTES_TABLE may also contain 'CURRENT_HOUR' or 'NEXT_HOUR', which refer to the HOURS_TABLE, and add diff --git a/software/pins.txt b/software/pins.txt index a71e8e6..07ea429 100644 --- a/software/pins.txt +++ b/software/pins.txt @@ -1,7 +1,10 @@ - // in most cases only pins 0, 2, 4, 5, 12, 13, 14, 15, and 16 can be used. - +ESP8266: + +In most cases only pins 0, 2, 4, 5, 12, 13, 14, 15, and 16 can be used. + +On my board: Pin(0) = D3 -Pin(2) = LED an Antenne (off = Leuchtet) +Pin(2) = switches LED near antenna (low = led on) Pin(4) = D2 Pin(5) = D1 Pin(12) = D6 @@ -16,4 +19,4 @@ i2c = machine.I2C(freq=100000,scl=machine.Pin(5), sda=machine.Pin(4)) import urtc -rtc = urtc.DS1307(i2c, 104) \ No newline at end of file +rtc = urtc.DS1307(i2c, 104) diff --git a/software/LICENSE b/software/wifimgr-LICENSE similarity index 100% rename from software/LICENSE rename to software/wifimgr-LICENSE From 247432a646d6cea340e468f1150e8105f1fe40df Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Tue, 31 May 2022 23:10:05 +0200 Subject: [PATCH 3/3] make corner screwing mounts larger --- README.md | 2 ++ hardware/config_common.scad | 6 +++--- hardware/letter_plate.scad | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 402e6e9..388cce2 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ Since the 3d files are written in OpenSCAD, you can modify them to your needs an ### Install threaded inserts +### Install led strips + ## Electronics ### Prepare ESP8266 diff --git a/hardware/config_common.scad b/hardware/config_common.scad index fa289e4..03bc8fc 100644 --- a/hardware/config_common.scad +++ b/hardware/config_common.scad @@ -24,15 +24,15 @@ LED_STRIPE_CAP_OFFSET_Y = 0; // Parameters for the screw holes LETTER_PLATE_SCREW_INSERT_HEIGHT = 6; // 3.5; LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS = 2; -LETTER_PLATE_SCREW_INSERT_DIAMETER = 4; +LETTER_PLATE_SCREW_INSERT_DIAMETER = 4; // M3 threaded insert diameter LETTER_PLATE_SCREW_WALL_DIAMETER = LETTER_PLATE_SCREW_INSERT_DIAMETER + LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS; -SCREW_DIAMETER = 3.2; // OD of M2.5 threaded insert to be heat inserted +SCREW_DIAMETER = 3.2; // M3 screw diameter with tolerance // Parameters for the corner holes (used to mount wallplate) CORNER_MOUNTING_HOLE_INSERT_HEIGHT = LETTER_PLATE_SCREW_INSERT_HEIGHT; CORNER_MOUNTING_HOLE_INSERT_DIAMETER = LETTER_PLATE_SCREW_INSERT_DIAMETER; CORNER_MOUNTING_HOLE_INSERT_WALL_THICKNESS = LETTER_PLATE_SCREW_INSERT_WALL_THICKNESS; -CORNER_MOUNTING_HOLE_WALL_DIAMETER = CORNER_MOUNTING_HOLE_INSERT_DIAMETER + CORNER_MOUNTING_HOLE_INSERT_WALL_THICKNESS; +CORNER_MOUNTING_HOLE_WALL_DIAMETER = CORNER_MOUNTING_HOLE_INSERT_DIAMETER + CORNER_MOUNTING_HOLE_INSERT_WALL_THICKNESS + 1; CORNER_MOUNTING_HOLE_OFFSET = 1.85; OUTER_HOLES_DIST = 2; diff --git a/hardware/letter_plate.scad b/hardware/letter_plate.scad index da07b1f..6d32b75 100644 --- a/hardware/letter_plate.scad +++ b/hardware/letter_plate.scad @@ -90,7 +90,7 @@ module screw_holes(z_offset, d) { module corner_hole_wall(offset=0,h=OUTER_WALL_HEIGHT) { translate([CORNER_MOUNTING_HOLE_WALL_DIAMETER/2, CORNER_MOUNTING_HOLE_WALL_DIAMETER/2, - h/2]) + (h - WALLMOUNT_PLATE_THICKNESS)/2]) cube(size = [CORNER_MOUNTING_HOLE_WALL_DIAMETER+offset, CORNER_MOUNTING_HOLE_WALL_DIAMETER+offset, h - WALLMOUNT_PLATE_THICKNESS], @@ -167,7 +167,7 @@ module clock_front() { screw_holes(z_offset=LETTER_SEPARATOR_HEIGHT - LETTER_PLATE_SCREW_INSERT_HEIGHT, d=LETTER_PLATE_SCREW_INSERT_DIAMETER); corner_holes(d=CORNER_MOUNTING_HOLE_INSERT_DIAMETER, h=CORNER_MOUNTING_HOLE_INSERT_HEIGHT, - offset=OUTER_WALL_HEIGHT); + offset=OUTER_WALL_HEIGHT - WALLMOUNT_PLATE_THICKNESS); translate([TOTAL_WIDTH/2, 0, OUTER_WALL_HEIGHT-ELECTRONICS_HEIGHT/2+CABLE_SLOT_CORNERS]) rotate([90,90,0]) translate([-ELECTRONICS_HEIGHT/2, -CABLE_SLOT_WIDTH/2, -100/2]) rounded_cube([ELECTRONICS_HEIGHT, CABLE_SLOT_WIDTH, 100], CABLE_SLOT_CORNERS);