├── .gitignore ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── README.md ├── doc ├── 44buttonIR.jpg ├── BranchController.jpg └── OpenPixelControl.html ├── gerber ├── branchControllerPCB-B_Cu.gbr ├── branchControllerPCB-B_Mask.gbr ├── branchControllerPCB-B_Paste.gbr ├── branchControllerPCB-B_SilkS.gbr ├── branchControllerPCB-Edge_Cuts.gbr ├── branchControllerPCB-F_Cu.gbr ├── branchControllerPCB-F_Mask.gbr ├── branchControllerPCB-F_Paste.gbr ├── branchControllerPCB-F_SilkS.gbr ├── branchControllerPCB-In1_Cu.gbr ├── branchControllerPCB-In2_Cu.gbr ├── branchControllerPCB-NPTH.drl └── branchControllerPCB-PTH.drl ├── include ├── BranchController.h └── README.md ├── kicad ├── BranchControllerSchematic.png ├── branchController.dcm ├── branchController.lib ├── branchController.pretty │ ├── 4116R-1-101LF.kicad_mod │ ├── ASSMANN_A-2004-1-4-LP-N-R.kicad_mod │ ├── AdaFruit4400LED.kicad_mod │ ├── SN74HCT245N.kicad_mod │ └── WIZ850io.kicad_mod ├── branchControllerPCB-cache.lib ├── branchControllerPCB.kicad_pcb ├── branchControllerPCB.kicad_pcb-bak ├── branchControllerPCB.pro ├── branchControllerPCB.sch ├── branchControllerPCB.sch-bak ├── fp-info-cache ├── fp-lib-table ├── sym-lib-table └── teensy.pretty │ └── Teensy30_31_32_LC.kicad_mod ├── lib ├── Display │ ├── Display.cpp │ └── Display.h ├── Heartbeat │ ├── Heartbeat.cpp │ └── Heartbeat.h ├── IRremote_ID4 │ ├── .library.json │ ├── Contributing.md │ ├── Contributors.md │ ├── IRremote.cpp │ ├── IRremote.h │ ├── IRremoteInt.h │ ├── ISSUE_TEMPLATE.md │ ├── LICENSE.txt │ ├── README.md │ ├── boarddefs.h │ ├── changelog.md │ ├── irPronto.cpp │ ├── irRecv.cpp │ ├── ir_NEC.cpp │ ├── keywords.txt │ ├── library.json │ └── library.properties ├── LED │ ├── LED.cpp │ └── LED.h ├── OpenPixelControl │ ├── OpenPixelControl.cpp │ └── OpenPixelControl.h ├── Persist │ ├── Persist.cpp │ └── Persist.h ├── README ├── Remote │ ├── Remote.cpp │ └── Remote.h ├── ResizeableOctoWS2811Controller │ └── ResizeableOctoWS2811Controller.h ├── TcpServer │ ├── MacAddress.cpp │ ├── MacAddress.h │ ├── TcpServer.cpp │ └── TcpServer.h ├── Util │ ├── Util.cpp │ └── Util.h └── WebServer │ ├── WebServer.cpp │ └── WebServer.h ├── platformio.ini └── src └── BranchController.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | .pioenvs 2 | .piolibdeps 3 | *.[oa] 4 | .pio/build/* 5 | .DS_Store 6 | branchController.code-workspace 7 | .vscode/c_cpp_properties.json 8 | .vscode/launch.json 9 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY 2 | 3 | // PIO Unified Debugger 4 | // 5 | // Documentation: https://docs.platformio.org/page/plus/debugging.html 6 | // Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html 7 | 8 | { 9 | "version": "0.2.0", 10 | "configurations": [ 11 | { 12 | "type": "platformio-debug", 13 | "request": "launch", 14 | "name": "PIO Debug", 15 | "executable": "/Users/spolsky/Dropbox/Arduino/branchController2/.pio/build/debug/firmware.elf", 16 | "toolchainBinDir": "/Users/spolsky/.platformio/packages/toolchain-gccarmnoneeabi@1.50401.190816/bin", 17 | "svdPath": "/Users/spolsky/.platformio/platforms/teensy/misc/svd/MK20D5.svd", 18 | "preLaunchTask": { 19 | "type": "PlatformIO", 20 | "task": "Pre-Debug" 21 | }, 22 | "internalConsoleOptions": "openOnSessionStart" 23 | }, 24 | { 25 | "type": "platformio-debug", 26 | "request": "launch", 27 | "name": "PIO Debug (skip Pre-Debug)", 28 | "executable": "/Users/spolsky/Dropbox/Arduino/branchController2/.pio/build/debug/firmware.elf", 29 | "toolchainBinDir": "/Users/spolsky/.platformio/packages/toolchain-gccarmnoneeabi@1.50401.190816/bin", 30 | "svdPath": "/Users/spolsky/.platformio/platforms/teensy/misc/svd/MK20D5.svd", 31 | "internalConsoleOptions": "openOnSessionStart" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "C_Cpp.dimInactiveRegions": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | branchController 2 | ================ 3 | 4 | The Branch Controller is a small hardware board based on the [Teensy 3.2 development board](https://www.pjrc.com/store/teensy32.html) to allow it to control up to 8 separate pixel-addressible LED strips. 5 | 6 | Although it can be used standalone to send its own patterns to the light strips, it really shines when connected, over ethernet, to a network. That allows you to generate the patterns on a computer (say, with a high powered graphics card) and send them to one or more Branch Controllers. In particular you can drive a lot more LEDs than any single controller can drive by using multiple Branch Controllers. 7 | 8 | ![Branch Controller](doc/BranchController.jpg) 9 | 10 | It is designed for WS2812b-style LED strips, with a single wire protocol. These are what Adafruit calls "NeoPixels". 11 | 12 | Personally I like to use the WS2815 variant which runs on 12 volts and has a backup wire allowing any single pixel to fail. 13 | 14 | Branch Controller does *not* handle APA102c-type strips, which use a two wire protocol consisting of both the signal and a clock. 15 | 16 | Features: 17 | 18 | * Supports up to 4400 pixels (550 per strip) at a frame rate of 60 Hz, the theoretical limit of the protocol 19 | 20 | * Ethernet control. Connects to an ethernet network to receive pixel data over TCP/IP. This allows you to use many branch controllers controlled from a single PC 21 | 22 | * 128x32 OLED display for diagnostics and network configuration 23 | 24 | * IR sensor allows you to use an IR remote control for basic controls 25 | 26 | Basic Operation 27 | --------------- 28 | 29 | By default branchController assumes you have 8 strips of 550 pixels each. You can operate a single branchController with a 44 button IR remote control like this one: 30 | 31 | ![44 button IR remote control](doc/44buttonIR.jpg) 32 | 33 | The brightness and color buttons work out of the box so you can use your branch controller to create basic solid colors. 34 | 35 | Use the On/Off button on the remote to turn off the LEDs. When you press OFF, any changes you have made to the state of the branchController is saved to EEPROM so that it will come back in the same state when you power up. *If you don't press off, the state is never saved*. 36 | 37 | The DIY1-6 buttons are reserved for internal test patterns and chases. You can edit the code for these to provide something that is a good backup if your PC or network fails. 38 | 39 | DIY1 shows a test pattern where the first pixel is brown on the first strip, the first two pixels are brown on the second strip, etc. This is useful for making sure you have the 8 strips hooked up in the right order. 40 | 41 | Network Operation 42 | ----------------- 43 | 44 | You can connect your branchController to a LAN using the built-in ethernet port and control it from any kind of computer that speaks TCP/IP. 45 | 46 | When branchController starts up, it will look for a DHCP server and try to get an IP address and network configuration. If that works it will show you the IP address on the screen. 47 | 48 | Every branch controller has a unique MAC address which will never change, so you can configure your DHCP server to always hand out the same IP address to the same branch controller, which makes it easier to sort out multiple branch controllers. 49 | 50 | If you would like to use a static IP address: 51 | 52 | * Start up the branch controller once using DHCP 53 | * Connect to the web server running at the IP address that you see on the OLED display 54 | * Check the "static IP" box and enter the IP address you want to use. Click submit 55 | * Restart the branch controller. From now on it will use your static IP address. 56 | 57 | Web-based Hardware Configuration 58 | -------------------------------- 59 | 60 | If you don't like the default configuration, you can use a web browser to connect to your 61 | branchController and modify some things: 62 | 63 | * the maximum power that LEDs will be allowed to consume (in milliwatts). If the total power budget is exceeded, all LEDs will be dimmed equally. 64 | * the RGB order in your LED strips (some strips expect RGB, others expect GRB). Use the "red", "green", and "blue" buttons to diagnose incorrect RGB order. 65 | * the color correction you want applied to all output, as a six digit hex RGB value 66 | * the color temperature you want applied to all output, as a six digit hex RGB value 67 | * the overall brightness of the LEDs, on a scale from 0 (off) to 255 (full). This can 68 | also be adjusted with an IR remote 69 | * whether to use a static IP address 70 | 71 | See http://fastled.io/docs/3.1/group___color_enums.html for options for color correction and 72 | color temperature. 73 | 74 | 75 | Open Pixel Control 76 | ------------------ 77 | 78 | If branchController successfully gets on the Internet, it will listen for TCP connections on port 7890, where it will receive data sent to it using the Open Pixel Control format, documented [here](http://openpixelcontrol.org/). You can use Christopher Schardt's app [L.E.D. Lab](https://apps.apple.com/us/app/l-e-d-lab/id832042156) for iPhone or iPad to send cool animations -- all you need to do is set up the controller as if it were a FadeCandy controller. 79 | 80 | We use TCP and not UDP for Open Pixel Control. The w5500 ethernet chip used in this design has a tiny buffer and will lose UDP packets if they are sent too fast. TCP solves this problem. 81 | 82 | About the project 83 | ----------------- 84 | 85 | This code was built using PlatformIO, an open source platform for embedded development which is a zillion times better than using the Arduino IDE. You will still need Teensyduino to flash the Teensy. For more about the research behind this project, follow my blog, [BlinkyLights](https://blinkylights.blog/). 86 | 87 | Want to build one? 88 | ------------------- 89 | * The gerber directory has gerber and drill files so you can order PCBs. 90 | * This [BOM](https://octopart.com/bom-tool/tv6ZDeDl) lists the parts you need. 91 | * The PCB is designed to be mounted in a Polycase SK-16-03 if you want a weatherproof enclosure 92 | 93 | 94 | Next Up 95 | ------- 96 | 97 | Recently implemented: 98 | - [X] Static IP address 99 | - [X] Faster brightness adjust 100 | 101 | These features are planned REAL SOON NOW: 102 | - [ ] Improve power limiting feature by showing stats on display for diagnosis 103 | - [ ] "Count Pixels" mode 104 | - [ ] Investigate temporal dithering - it's not really happening. 105 | - [ ] Internet cable disconnected / reconnected 106 | - [ ] Better built-in (DIY1-6) displays maybe 107 | - [ ] Support remote control Play/Pause button for internal DIY1-6 displays 108 | - [ ] Either implement gamma correction or stop pretending 109 | 110 | Ideas for future improvements: 111 | - [ ] New hardware design with ESP32 and logic shifters to handle way more LEDs 112 | - [ ] TouchDesigner support 113 | - [ ] DMX/ArtNet bridge mode 114 | - [ ] Multicast DNS (mDNS) and service discovery (DNS-SD) 115 | try https://github.com/TrippyLighting/EthernetBonjour 116 | -------------------------------------------------------------------------------- /doc/44buttonIR.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jspolsky/branchController2/214cceb3d85411d83ebd88c1b07040e1b2c9dc87/doc/44buttonIR.jpg -------------------------------------------------------------------------------- /doc/BranchController.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jspolsky/branchController2/214cceb3d85411d83ebd88c1b07040e1b2c9dc87/doc/BranchController.jpg -------------------------------------------------------------------------------- /doc/OpenPixelControl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Open Pixel Control 5 | 6 | 19 | 27 | 28 |

Open Pixel Control

29 | ping@zesty.ca
30 |
31 | 32 |

Open Pixel Control (OPC) is a simple protocol 33 | for controlling arrays of RGB lights, 34 | such as Total Control Lighting LEDs. 35 | 36 |

37 | Get the code at github.com. 38 | 39 | Show off your creations! 40 | Tag your photos with openpixelcontrol 41 | on flickr, 42 | and see everyone else's photos. 43 | 44 | 71 | 72 | 75 |

Overview

76 | 77 |

OPC describes the format of a stream of bytes, 78 | typically sent over a TCP connection, 79 | to control an array of RGB lights (pixels). 80 | The pixels are assumed to be arranged in strands, 81 | where each pixel has a fixed index in its strand. 82 | 83 |

84 | The purpose of OPC is to separate the generation of light patterns 85 | from the control of hardware lights. 86 | If you write a program that emits OPC messages, 87 | it will be independent of the lighting hardware. 88 | You can write your animation or interactive display program once, 89 | and then use the same program with many kinds of lighting hardware, 90 | as well as a simulator that lets you test and visualize your program 91 | before wiring it to real lights. 92 | 93 |

Specification

94 | 95 |

96 | An OPC stream consists of a sequence of messages. 97 | Each message has a 4-byte header followed by a variable-length data block: 98 | 99 |

100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |
channelcommandlength (n)data
0 to 2550 to 255high bytelow byten bytes of message data
115 | 116 |

117 | Channel: 118 | Up to 255 separate strands of pixels can be controlled. 119 | Each strand is given a channel number from 1 to 255 120 | and listens for messages with that channel number. 121 | Messages with channel 0 are considered broadcast messages; 122 | all strands should treat a message with channel 0 123 | as if it were sent on all channels. 124 | 125 |

126 | Command: 127 | The command code determines the format of the data 128 | and the expected behaviour in response to the message. 129 | Individual commands are defined below. 130 | 131 |

132 | Length: 133 | The message data block can have any length from 0 to 65535, 134 | transmitted as an unsigned two-byte number with the high byte first. 135 | 136 |

137 | Data: 138 | The data block must contain 139 | exactly the number of bytes indicated by the length field, 140 | from 0 to 65535. 141 | 142 |

Commands

143 | 144 |

145 | Set 8-bit pixel colours (command 0): 146 | The data block contains 8-bit RGB values: 147 | three bytes in red, green, blue order for each pixel to set. 148 | If the data block has length 3*n, 149 | then the first n pixels of the specified channel are set. 150 | All other pixels are unaffected and retain their current colour values. 151 | If the data length is not a multiple of 3, 152 | or there is data for more pixels than are present, the extra data is ignored. 153 | (Because the maximum data length is 65535, 154 | this command can control a maximum of 21845 pixels per channel, 155 | or a maximum of 5570475 pixels on all 255 channels.) 156 | 157 |

158 | Set 16-bit pixel colours (command 2): 159 | The data block contains 16-bit RGB values: 160 | six bytes for each pixel to set, 161 | consisting of three 16-bit words in red, green, blue order 162 | with each two-byte word in big-endian order. 163 | If the data block has length 6*n, 164 | then the first n pixels of the specified channel are set. 165 | All other pixels are unaffected and retain their current colour values. 166 | If the data length is not a multiple of 6, 167 | or there is data for more pixels than are present, the extra data is ignored. 168 | (Because the maximum data length is 65535, 169 | this command can control a maximum of 10922 pixels per channel, 170 | or a maximum of 2785110 pixels on all 255 channels.) 171 | 172 |

173 | System exclusive (command 255): 174 | Command 0xff is used to send a message that is specific 175 | to a particular device or software system. 176 | The data block should begin with a two-byte system ID; 177 | designers of that system are then free to define any message format 178 | for the rest of the data block. 179 | 180 |

System IDs

181 | 182 |

183 | Currently assigned system IDs are as follows: 184 |

188 |
189 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-B_Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.5-0-10_14)* 2 | G04 #@! TF.CreationDate,2020-01-09T16:24:32-05:00* 3 | G04 #@! TF.ProjectId,branchControllerPCB,6272616e-6368-4436-9f6e-74726f6c6c65,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.1.5-0-10_14)) date 2020-01-09 16:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | G04 APERTURE END LIST* 14 | M02* 15 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-Edge_Cuts.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.5-0-10_14)* 2 | G04 #@! TF.CreationDate,2020-01-09T16:24:32-05:00* 3 | G04 #@! TF.ProjectId,branchControllerPCB,6272616e-6368-4436-9f6e-74726f6c6c65,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW (5.1.5-0-10_14)) date 2020-01-09 16:24:32* 9 | %MOMM*% 10 | %LPD*% 11 | G04 APERTURE LIST* 12 | %ADD10C,0.050000*% 13 | G04 APERTURE END LIST* 14 | D10* 15 | X142240000Y-139700000D02* 16 | G75* 17 | G02X140970000Y-138430000I0J1270000D01* 18 | G01* 19 | X248920000Y-138430000D02* 20 | G75* 21 | G02X247650000Y-139700000I-1270000J0D01* 22 | G01* 23 | X146050000Y-69850000D02* 24 | G75* 25 | G02X140970000Y-74930000I-5080000J0D01* 26 | G01* 27 | X248920000Y-74930000D02* 28 | G75* 29 | G02X243840000Y-69850000I0J5080000D01* 30 | G01* 31 | X140970000Y-138430000D02* 32 | X140970000Y-74930000D01* 33 | X247650000Y-139700000D02* 34 | X142240000Y-139700000D01* 35 | X248920000Y-74930000D02* 36 | X248920000Y-138430000D01* 37 | X146050000Y-69850000D02* 38 | X243840000Y-69850000D01* 39 | X149479000Y-76200000D02* 40 | G75* 41 | G03X149479000Y-76200000I-2159000J0D01* 42 | G01* 43 | X245491000Y-76200000D02* 44 | G75* 45 | G03X245491000Y-76200000I-2159000J0D01* 46 | G01* 47 | M02* 48 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-F_Paste.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.5-0-10_14)* 2 | G04 #@! TF.CreationDate,2020-01-09T16:24:32-05:00* 3 | G04 #@! TF.ProjectId,branchControllerPCB,6272616e-6368-4436-9f6e-74726f6c6c65,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Paste,Top* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.1.5-0-10_14)) date 2020-01-09 16:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | G04 APERTURE END LIST* 14 | M02* 15 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-In1_Cu.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.5-0-10_14)* 2 | G04 #@! TF.CreationDate,2020-01-09T16:24:32-05:00* 3 | G04 #@! TF.ProjectId,branchControllerPCB,6272616e-6368-4436-9f6e-74726f6c6c65,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Copper,L2,Inr* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.1.5-0-10_14)) date 2020-01-09 16:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | %ADD10O,1.700000X1.700000*% 14 | %ADD11R,1.700000X1.700000*% 15 | %ADD12C,1.600000*% 16 | %ADD13R,1.600000X1.600000*% 17 | %ADD14C,1.900000*% 18 | %ADD15R,1.665000X1.665000*% 19 | %ADD16C,1.665000*% 20 | %ADD17C,1.800000*% 21 | %ADD18C,0.100000*% 22 | %ADD19R,1.295400X1.295400*% 23 | %ADD20C,1.295400*% 24 | %ADD21O,2.400000X2.400000*% 25 | %ADD22C,2.400000*% 26 | %ADD23C,1.408000*% 27 | %ADD24R,1.408000X1.408000*% 28 | %ADD25C,2.550000*% 29 | %ADD26R,1.800000X1.800000*% 30 | %ADD27C,0.250000*% 31 | G04 APERTURE END LIST* 32 | D10* 33 | X179070000Y-96520000D03* 34 | X176530000Y-96520000D03* 35 | X173990000Y-96520000D03* 36 | X171450000Y-96520000D03* 37 | X168910000Y-96520000D03* 38 | D11* 39 | X166370000Y-96520000D03* 40 | D12* 41 | X187960000Y-104140000D03* 42 | X185420000Y-104140000D03* 43 | X182880000Y-104140000D03* 44 | X180340000Y-104140000D03* 45 | X190500000Y-104140000D03* 46 | X193040000Y-104140000D03* 47 | X195580000Y-104140000D03* 48 | X180340000Y-106680000D03* 49 | X180340000Y-109220000D03* 50 | X180340000Y-111760000D03* 51 | X180340000Y-114300000D03* 52 | X180340000Y-116840000D03* 53 | X180340000Y-119380000D03* 54 | X180340000Y-121920000D03* 55 | X180340000Y-124460000D03* 56 | X180340000Y-127000000D03* 57 | X180340000Y-129540000D03* 58 | X180340000Y-132080000D03* 59 | X180340000Y-134620000D03* 60 | X180340000Y-137160000D03* 61 | X182880000Y-134620000D03* 62 | X182880000Y-129540000D03* 63 | X182880000Y-127000000D03* 64 | X182880000Y-124460000D03* 65 | X195580000Y-106680000D03* 66 | X195580000Y-109220000D03* 67 | X195580000Y-111760000D03* 68 | X195580000Y-114300000D03* 69 | X195580000Y-116840000D03* 70 | X195580000Y-119380000D03* 71 | X195580000Y-121920000D03* 72 | X195580000Y-124460000D03* 73 | X195580000Y-127000000D03* 74 | X195580000Y-129540000D03* 75 | X195580000Y-132080000D03* 76 | X195580000Y-134620000D03* 77 | D13* 78 | X195580000Y-137160000D03* 79 | D14* 80 | X187960000Y-127000000D03* 81 | X187960000Y-130810000D03* 82 | D15* 83 | X171450000Y-132080000D03* 84 | D16* 85 | X171450000Y-129540000D03* 86 | X171450000Y-127000000D03* 87 | X171450000Y-124460000D03* 88 | X171450000Y-121920000D03* 89 | X171450000Y-119380000D03* 90 | D15* 91 | X151130000Y-132080000D03* 92 | D16* 93 | X151130000Y-129540000D03* 94 | X151130000Y-127000000D03* 95 | X151130000Y-124460000D03* 96 | X151130000Y-121920000D03* 97 | X151130000Y-119380000D03* 98 | D17* 99 | X205740000Y-87630000D03* 100 | X203200000Y-87630000D03* 101 | G04 #@! TA.AperFunction,ViaPad* 102 | D18* 103 | G36* 104 | X201335947Y-86731196D02* 105 | G01* 106 | X201360060Y-86734773D01* 107 | X201383707Y-86740696D01* 108 | X201406659Y-86748908D01* 109 | X201428695Y-86759331D01* 110 | X201449604Y-86771863D01* 111 | X201469183Y-86786384D01* 112 | X201487245Y-86802755D01* 113 | X201503616Y-86820817D01* 114 | X201518137Y-86840396D01* 115 | X201530669Y-86861305D01* 116 | X201541092Y-86883341D01* 117 | X201549304Y-86906293D01* 118 | X201555227Y-86929940D01* 119 | X201558804Y-86954053D01* 120 | X201560000Y-86978400D01* 121 | X201560000Y-88281600D01* 122 | X201558804Y-88305947D01* 123 | X201555227Y-88330060D01* 124 | X201549304Y-88353707D01* 125 | X201541092Y-88376659D01* 126 | X201530669Y-88398695D01* 127 | X201518137Y-88419604D01* 128 | X201503616Y-88439183D01* 129 | X201487245Y-88457245D01* 130 | X201469183Y-88473616D01* 131 | X201449604Y-88488137D01* 132 | X201428695Y-88500669D01* 133 | X201406659Y-88511092D01* 134 | X201383707Y-88519304D01* 135 | X201360060Y-88525227D01* 136 | X201335947Y-88528804D01* 137 | X201311600Y-88530000D01* 138 | X200008400Y-88530000D01* 139 | X199984053Y-88528804D01* 140 | X199959940Y-88525227D01* 141 | X199936293Y-88519304D01* 142 | X199913341Y-88511092D01* 143 | X199891305Y-88500669D01* 144 | X199870396Y-88488137D01* 145 | X199850817Y-88473616D01* 146 | X199832755Y-88457245D01* 147 | X199816384Y-88439183D01* 148 | X199801863Y-88419604D01* 149 | X199789331Y-88398695D01* 150 | X199778908Y-88376659D01* 151 | X199770696Y-88353707D01* 152 | X199764773Y-88330060D01* 153 | X199761196Y-88305947D01* 154 | X199760000Y-88281600D01* 155 | X199760000Y-86978400D01* 156 | X199761196Y-86954053D01* 157 | X199764773Y-86929940D01* 158 | X199770696Y-86906293D01* 159 | X199778908Y-86883341D01* 160 | X199789331Y-86861305D01* 161 | X199801863Y-86840396D01* 162 | X199816384Y-86820817D01* 163 | X199832755Y-86802755D01* 164 | X199850817Y-86786384D01* 165 | X199870396Y-86771863D01* 166 | X199891305Y-86759331D01* 167 | X199913341Y-86748908D01* 168 | X199936293Y-86740696D01* 169 | X199959940Y-86734773D01* 170 | X199984053Y-86731196D01* 171 | X200008400Y-86730000D01* 172 | X201311600Y-86730000D01* 173 | X201335947Y-86731196D01* 174 | G37* 175 | G04 #@! TD.AperFunction* 176 | D19* 177 | X214630000Y-88900000D03* 178 | D20* 179 | X214630000Y-91440000D03* 180 | X214630000Y-93980000D03* 181 | X214630000Y-96520000D03* 182 | X214630000Y-99060000D03* 183 | X214630000Y-101600000D03* 184 | X214630000Y-104140000D03* 185 | X214630000Y-106680000D03* 186 | X214630000Y-109220000D03* 187 | X214630000Y-111760000D03* 188 | X222250000Y-111760000D03* 189 | X222250000Y-109220000D03* 190 | X222250000Y-106680000D03* 191 | X222250000Y-104140000D03* 192 | X222250000Y-101600000D03* 193 | X222250000Y-99060000D03* 194 | X222250000Y-96520000D03* 195 | X222250000Y-93980000D03* 196 | X222250000Y-91440000D03* 197 | X222250000Y-88900000D03* 198 | D19* 199 | X229362000Y-93980000D03* 200 | D20* 201 | X229362000Y-96520000D03* 202 | X229362000Y-99060000D03* 203 | X229362000Y-101600000D03* 204 | X229362000Y-104140000D03* 205 | X229362000Y-106680000D03* 206 | X229362000Y-109220000D03* 207 | X229362000Y-111760000D03* 208 | X237490000Y-111760000D03* 209 | X237490000Y-109220000D03* 210 | X237490000Y-106680000D03* 211 | X237490000Y-104140000D03* 212 | X237490000Y-101600000D03* 213 | X237490000Y-99060000D03* 214 | X237490000Y-96520000D03* 215 | X237490000Y-93980000D03* 216 | D21* 217 | X176530000Y-121920000D03* 218 | D22* 219 | X176530000Y-114300000D03* 220 | D23* 221 | X231775000Y-121920000D03* 222 | X229235000Y-121920000D03* 223 | X226695000Y-121920000D03* 224 | X230505000Y-124460000D03* 225 | X227965000Y-124460000D03* 226 | D24* 227 | X225425000Y-124460000D03* 228 | D23* 229 | X233045000Y-124460000D03* 230 | X234315000Y-121920000D03* 231 | D25* 232 | X222155000Y-133860000D03* 233 | X237585000Y-133860000D03* 234 | X217265000Y-133860000D03* 235 | X201835000Y-133860000D03* 236 | D23* 237 | X213995000Y-121920000D03* 238 | X212725000Y-124460000D03* 239 | D24* 240 | X205105000Y-124460000D03* 241 | D23* 242 | X207645000Y-124460000D03* 243 | X210185000Y-124460000D03* 244 | X206375000Y-121920000D03* 245 | X208915000Y-121920000D03* 246 | X211455000Y-121920000D03* 247 | D17* 248 | X160020000Y-107950000D03* 249 | D26* 250 | X157480000Y-107950000D03* 251 | D27* 252 | X167640000Y-107950000D02* 253 | X176530000Y-114300000D01* 254 | X160020000Y-107950000D02* 255 | X167640000Y-107950000D01* 256 | X211455000Y-120924394D02* 257 | X211455000Y-121920000D01* 258 | X221592095Y-110787299D02* 259 | X211455000Y-120924394D01* 260 | X222122299Y-110787299D02* 261 | X221592095Y-110787299D01* 262 | X227796897Y-105112701D02* 263 | X222122299Y-110787299D01* 264 | X231437299Y-105112701D02* 265 | X227796897Y-105112701D01* 266 | X237490000Y-99060000D02* 267 | X231437299Y-105112701D01* 268 | X236842301Y-97167699D02* 269 | X237490000Y-96520000D01* 270 | X229489701Y-102572701D02* 271 | X231437299Y-102572701D01* 272 | X224409701Y-107652701D02* 273 | X229489701Y-102572701D01* 274 | X231437299Y-102572701D02* 275 | X236842301Y-97167699D01* 276 | X222186693Y-107652701D02* 277 | X224409701Y-107652701D01* 278 | X208915000Y-120924394D02* 279 | X222186693Y-107652701D01* 280 | X208915000Y-121920000D02* 281 | X208915000Y-120924394D01* 282 | X231437299Y-100032701D02* 283 | X236842301Y-94627699D01* 284 | X229489701Y-100032701D02* 285 | X231437299Y-100032701D01* 286 | X224409701Y-105112701D02* 287 | X229489701Y-100032701D01* 288 | X236842301Y-94627699D02* 289 | X237490000Y-93980000D01* 290 | X222377701Y-105112701D02* 291 | X224409701Y-105112701D01* 292 | X221277299Y-106213103D02* 293 | X222377701Y-105112701D01* 294 | X221277299Y-107017701D02* 295 | X221277299Y-106213103D01* 296 | X206375000Y-121920000D02* 297 | X221277299Y-107017701D01* 298 | X214698999Y-121216001D02* 299 | X213995000Y-121920000D01* 300 | X223222701Y-112692299D02* 301 | X214698999Y-121216001D01* 302 | X223222701Y-111379701D02* 303 | X223222701Y-112692299D01* 304 | X228895103Y-105707299D02* 305 | X223222701Y-111379701D01* 306 | X233382701Y-105707299D02* 307 | X228895103Y-105707299D01* 308 | X237490000Y-101600000D02* 309 | X233382701Y-105707299D01* 310 | X235400010Y-111309990D02* 311 | X236842301Y-109867699D01* 312 | X236842301Y-109867699D02* 313 | X237490000Y-109220000D01* 314 | X235400010Y-118294990D02* 315 | X235400010Y-111309990D01* 316 | X231775000Y-121920000D02* 317 | X235400010Y-118294990D01* 318 | X236842301Y-107327699D02* 319 | X237490000Y-106680000D01* 320 | X234950000Y-115209394D02* 321 | X234950000Y-109220000D01* 322 | X234950000Y-109220000D02* 323 | X236842301Y-107327699D01* 324 | X229235000Y-120924394D02* 325 | X234950000Y-115209394D01* 326 | X229235000Y-121920000D02* 327 | X229235000Y-120924394D01* 328 | X237490000Y-105055986D02* 329 | X237490000Y-104140000D01* 330 | X226695000Y-115850986D02* 331 | X237490000Y-105055986D01* 332 | X226695000Y-121920000D02* 333 | X226695000Y-115850986D01* 334 | X237490000Y-112675986D02* 335 | X237490000Y-111760000D01* 336 | X237490000Y-117749394D02* 337 | X237490000Y-112675986D01* 338 | X234315000Y-120924394D02* 339 | X237490000Y-117749394D01* 340 | X234315000Y-121920000D02* 341 | X234315000Y-120924394D01* 342 | X176530000Y-124460000D02* 343 | X176530000Y-121920000D01* 344 | X180340000Y-129540000D02* 345 | X176530000Y-124460000D01* 346 | X177800000Y-111219999D02* 347 | X177800000Y-106680000D01* 348 | X178640993Y-114249497D02* 349 | X177800000Y-111219999D01* 350 | X176530000Y-118110000D02* 351 | X178640993Y-114249497D01* 352 | X177800000Y-106680000D02* 353 | X180340000Y-104140000D01* 354 | X171006898Y-120650000D02* 355 | X171893102Y-120650000D01* 356 | X171893102Y-120650000D02* 357 | X175260000Y-118110000D01* 358 | X175260000Y-118110000D02* 359 | X176530000Y-118110000D01* 360 | X170292499Y-121364399D02* 361 | X171006898Y-120650000D01* 362 | X170292499Y-123302499D02* 363 | X170292499Y-121364399D01* 364 | X171450000Y-124460000D02* 365 | X170292499Y-123302499D01* 366 | X194780001Y-104939999D02* 367 | X195580000Y-104140000D01* 368 | X151130000Y-119380000D02* 369 | X151130000Y-107950000D01* 370 | X151130000Y-107950000D02* 371 | X158750000Y-100330000D01* 372 | X191770000Y-100330000D02* 373 | X195580000Y-104140000D01* 374 | X158750000Y-100330000D02* 375 | X191770000Y-100330000D01* 376 | X179070000Y-96520000D02* 377 | X179070000Y-90170000D01* 378 | X179070000Y-90170000D02* 379 | X185420000Y-83820000D01* 380 | X217170000Y-83820000D02* 381 | X222250000Y-88900000D01* 382 | X185420000Y-83820000D02* 383 | X217170000Y-83820000D01* 384 | X179070000Y-90170000D02* 385 | X166370000Y-90170000D01* 386 | X166370000Y-90170000D02* 387 | X146050000Y-110490000D01* 388 | X146050000Y-110490000D02* 389 | X146050000Y-132080000D01* 390 | X151130000Y-137160000D02* 391 | X180340000Y-137160000D01* 392 | X146050000Y-132080000D02* 393 | X151130000Y-137160000D01* 394 | X194780001Y-107479999D02* 395 | X195580000Y-106680000D01* 396 | X181465001Y-130080001D02* 397 | X181465001Y-120794999D01* 398 | X180880001Y-130665001D02* 399 | X181465001Y-130080001D01* 400 | X179799999Y-130665001D02* 401 | X180880001Y-130665001D01* 402 | X181465001Y-120794999D02* 403 | X194780001Y-107479999D01* 404 | X174530001Y-130080001D02* 405 | X179214999Y-130080001D01* 406 | X179214999Y-130080001D02* 407 | X179799999Y-130665001D01* 408 | X171450000Y-127000000D02* 409 | X174530001Y-130080001D01* 410 | X196379999Y-108420001D02* 411 | X195580000Y-109220000D01* 412 | X196705001Y-108094999D02* 413 | X196379999Y-108420001D01* 414 | X196120001Y-105554999D02* 415 | X196705001Y-106139999D01* 416 | X196705001Y-106139999D02* 417 | X196705001Y-108094999D01* 418 | X195039999Y-105554999D02* 419 | X196120001Y-105554999D01* 420 | X194454999Y-106139999D02* 421 | X195039999Y-105554999D01* 422 | X194454999Y-106930003D02* 423 | X194454999Y-106139999D01* 424 | X180880001Y-120505001D02* 425 | X194454999Y-106930003D01* 426 | X178925001Y-120505001D02* 427 | X180880001Y-120505001D01* 428 | X175260000Y-119380000D02* 429 | X177800000Y-119380000D01* 430 | X177800000Y-119380000D02* 431 | X178925001Y-120505001D01* 432 | X172864999Y-120505001D02* 433 | X175260000Y-119380000D01* 434 | X171450000Y-121920000D02* 435 | X172864999Y-120505001D01* 436 | X201930000Y-121920000D02* 437 | X214630000Y-109220000D01* 438 | X195580000Y-121920000D02* 439 | X201930000Y-121920000D01* 440 | X199760000Y-87630000D02* 441 | X200660000Y-87630000D01* 442 | X194780001Y-126200001D02* 443 | X195580000Y-127000000D01* 444 | X194454999Y-125874999D02* 445 | X194780001Y-126200001D01* 446 | X194454999Y-121379999D02* 447 | X194454999Y-125874999D01* 448 | X195039999Y-120794999D02* 449 | X194454999Y-121379999D01* 450 | X195830003Y-120794999D02* 451 | X195039999Y-120794999D01* 452 | X200660000Y-115965002D02* 453 | X195830003Y-120794999D01* 454 | X200660000Y-87630000D02* 455 | X200660000Y-115965002D01* 456 | M02* 457 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-In2_Cu.gbr: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.5-0-10_14)* 2 | G04 #@! TF.CreationDate,2020-01-09T16:24:32-05:00* 3 | G04 #@! TF.ProjectId,branchControllerPCB,6272616e-6368-4436-9f6e-74726f6c6c65,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Copper,L3,Inr* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (5.1.5-0-10_14)) date 2020-01-09 16:24:32* 10 | %MOMM*% 11 | %LPD*% 12 | G04 APERTURE LIST* 13 | %ADD10O,1.700000X1.700000*% 14 | %ADD11R,1.700000X1.700000*% 15 | %ADD12C,1.600000*% 16 | %ADD13R,1.600000X1.600000*% 17 | %ADD14C,1.900000*% 18 | %ADD15R,1.665000X1.665000*% 19 | %ADD16C,1.665000*% 20 | %ADD17C,1.800000*% 21 | %ADD18C,0.100000*% 22 | %ADD19R,1.295400X1.295400*% 23 | %ADD20C,1.295400*% 24 | %ADD21O,2.400000X2.400000*% 25 | %ADD22C,2.400000*% 26 | %ADD23C,1.408000*% 27 | %ADD24R,1.408000X1.408000*% 28 | %ADD25C,2.550000*% 29 | %ADD26R,1.800000X1.800000*% 30 | %ADD27C,0.250000*% 31 | G04 APERTURE END LIST* 32 | D10* 33 | X179070000Y-96520000D03* 34 | X176530000Y-96520000D03* 35 | X173990000Y-96520000D03* 36 | X171450000Y-96520000D03* 37 | X168910000Y-96520000D03* 38 | D11* 39 | X166370000Y-96520000D03* 40 | D12* 41 | X187960000Y-104140000D03* 42 | X185420000Y-104140000D03* 43 | X182880000Y-104140000D03* 44 | X180340000Y-104140000D03* 45 | X190500000Y-104140000D03* 46 | X193040000Y-104140000D03* 47 | X195580000Y-104140000D03* 48 | X180340000Y-106680000D03* 49 | X180340000Y-109220000D03* 50 | X180340000Y-111760000D03* 51 | X180340000Y-114300000D03* 52 | X180340000Y-116840000D03* 53 | X180340000Y-119380000D03* 54 | X180340000Y-121920000D03* 55 | X180340000Y-124460000D03* 56 | X180340000Y-127000000D03* 57 | X180340000Y-129540000D03* 58 | X180340000Y-132080000D03* 59 | X180340000Y-134620000D03* 60 | X180340000Y-137160000D03* 61 | X182880000Y-134620000D03* 62 | X182880000Y-129540000D03* 63 | X182880000Y-127000000D03* 64 | X182880000Y-124460000D03* 65 | X195580000Y-106680000D03* 66 | X195580000Y-109220000D03* 67 | X195580000Y-111760000D03* 68 | X195580000Y-114300000D03* 69 | X195580000Y-116840000D03* 70 | X195580000Y-119380000D03* 71 | X195580000Y-121920000D03* 72 | X195580000Y-124460000D03* 73 | X195580000Y-127000000D03* 74 | X195580000Y-129540000D03* 75 | X195580000Y-132080000D03* 76 | X195580000Y-134620000D03* 77 | D13* 78 | X195580000Y-137160000D03* 79 | D14* 80 | X187960000Y-127000000D03* 81 | X187960000Y-130810000D03* 82 | D15* 83 | X171450000Y-132080000D03* 84 | D16* 85 | X171450000Y-129540000D03* 86 | X171450000Y-127000000D03* 87 | X171450000Y-124460000D03* 88 | X171450000Y-121920000D03* 89 | X171450000Y-119380000D03* 90 | D15* 91 | X151130000Y-132080000D03* 92 | D16* 93 | X151130000Y-129540000D03* 94 | X151130000Y-127000000D03* 95 | X151130000Y-124460000D03* 96 | X151130000Y-121920000D03* 97 | X151130000Y-119380000D03* 98 | D17* 99 | X205740000Y-87630000D03* 100 | X203200000Y-87630000D03* 101 | G04 #@! TA.AperFunction,ViaPad* 102 | D18* 103 | G36* 104 | X201335947Y-86731196D02* 105 | G01* 106 | X201360060Y-86734773D01* 107 | X201383707Y-86740696D01* 108 | X201406659Y-86748908D01* 109 | X201428695Y-86759331D01* 110 | X201449604Y-86771863D01* 111 | X201469183Y-86786384D01* 112 | X201487245Y-86802755D01* 113 | X201503616Y-86820817D01* 114 | X201518137Y-86840396D01* 115 | X201530669Y-86861305D01* 116 | X201541092Y-86883341D01* 117 | X201549304Y-86906293D01* 118 | X201555227Y-86929940D01* 119 | X201558804Y-86954053D01* 120 | X201560000Y-86978400D01* 121 | X201560000Y-88281600D01* 122 | X201558804Y-88305947D01* 123 | X201555227Y-88330060D01* 124 | X201549304Y-88353707D01* 125 | X201541092Y-88376659D01* 126 | X201530669Y-88398695D01* 127 | X201518137Y-88419604D01* 128 | X201503616Y-88439183D01* 129 | X201487245Y-88457245D01* 130 | X201469183Y-88473616D01* 131 | X201449604Y-88488137D01* 132 | X201428695Y-88500669D01* 133 | X201406659Y-88511092D01* 134 | X201383707Y-88519304D01* 135 | X201360060Y-88525227D01* 136 | X201335947Y-88528804D01* 137 | X201311600Y-88530000D01* 138 | X200008400Y-88530000D01* 139 | X199984053Y-88528804D01* 140 | X199959940Y-88525227D01* 141 | X199936293Y-88519304D01* 142 | X199913341Y-88511092D01* 143 | X199891305Y-88500669D01* 144 | X199870396Y-88488137D01* 145 | X199850817Y-88473616D01* 146 | X199832755Y-88457245D01* 147 | X199816384Y-88439183D01* 148 | X199801863Y-88419604D01* 149 | X199789331Y-88398695D01* 150 | X199778908Y-88376659D01* 151 | X199770696Y-88353707D01* 152 | X199764773Y-88330060D01* 153 | X199761196Y-88305947D01* 154 | X199760000Y-88281600D01* 155 | X199760000Y-86978400D01* 156 | X199761196Y-86954053D01* 157 | X199764773Y-86929940D01* 158 | X199770696Y-86906293D01* 159 | X199778908Y-86883341D01* 160 | X199789331Y-86861305D01* 161 | X199801863Y-86840396D01* 162 | X199816384Y-86820817D01* 163 | X199832755Y-86802755D01* 164 | X199850817Y-86786384D01* 165 | X199870396Y-86771863D01* 166 | X199891305Y-86759331D01* 167 | X199913341Y-86748908D01* 168 | X199936293Y-86740696D01* 169 | X199959940Y-86734773D01* 170 | X199984053Y-86731196D01* 171 | X200008400Y-86730000D01* 172 | X201311600Y-86730000D01* 173 | X201335947Y-86731196D01* 174 | G37* 175 | G04 #@! TD.AperFunction* 176 | D19* 177 | X214630000Y-88900000D03* 178 | D20* 179 | X214630000Y-91440000D03* 180 | X214630000Y-93980000D03* 181 | X214630000Y-96520000D03* 182 | X214630000Y-99060000D03* 183 | X214630000Y-101600000D03* 184 | X214630000Y-104140000D03* 185 | X214630000Y-106680000D03* 186 | X214630000Y-109220000D03* 187 | X214630000Y-111760000D03* 188 | X222250000Y-111760000D03* 189 | X222250000Y-109220000D03* 190 | X222250000Y-106680000D03* 191 | X222250000Y-104140000D03* 192 | X222250000Y-101600000D03* 193 | X222250000Y-99060000D03* 194 | X222250000Y-96520000D03* 195 | X222250000Y-93980000D03* 196 | X222250000Y-91440000D03* 197 | X222250000Y-88900000D03* 198 | D19* 199 | X229362000Y-93980000D03* 200 | D20* 201 | X229362000Y-96520000D03* 202 | X229362000Y-99060000D03* 203 | X229362000Y-101600000D03* 204 | X229362000Y-104140000D03* 205 | X229362000Y-106680000D03* 206 | X229362000Y-109220000D03* 207 | X229362000Y-111760000D03* 208 | X237490000Y-111760000D03* 209 | X237490000Y-109220000D03* 210 | X237490000Y-106680000D03* 211 | X237490000Y-104140000D03* 212 | X237490000Y-101600000D03* 213 | X237490000Y-99060000D03* 214 | X237490000Y-96520000D03* 215 | X237490000Y-93980000D03* 216 | D21* 217 | X176530000Y-121920000D03* 218 | D22* 219 | X176530000Y-114300000D03* 220 | D23* 221 | X231775000Y-121920000D03* 222 | X229235000Y-121920000D03* 223 | X226695000Y-121920000D03* 224 | X230505000Y-124460000D03* 225 | X227965000Y-124460000D03* 226 | D24* 227 | X225425000Y-124460000D03* 228 | D23* 229 | X233045000Y-124460000D03* 230 | X234315000Y-121920000D03* 231 | D25* 232 | X222155000Y-133860000D03* 233 | X237585000Y-133860000D03* 234 | X217265000Y-133860000D03* 235 | X201835000Y-133860000D03* 236 | D23* 237 | X213995000Y-121920000D03* 238 | X212725000Y-124460000D03* 239 | D24* 240 | X205105000Y-124460000D03* 241 | D23* 242 | X207645000Y-124460000D03* 243 | X210185000Y-124460000D03* 244 | X206375000Y-121920000D03* 245 | X208915000Y-121920000D03* 246 | X211455000Y-121920000D03* 247 | D17* 248 | X160020000Y-107950000D03* 249 | D26* 250 | X157480000Y-107950000D03* 251 | D27* 252 | X213714014Y-93980000D02* 253 | X214630000Y-93980000D01* 254 | X193914998Y-93980000D02* 255 | X213714014Y-93980000D01* 256 | X184294999Y-103599999D02* 257 | X193914998Y-93980000D01* 258 | X184294999Y-104390003D02* 259 | X184294999Y-103599999D01* 260 | X182005002Y-106680000D02* 261 | X184294999Y-104390003D01* 262 | X180340000Y-106680000D02* 263 | X182005002Y-106680000D01* 264 | X180340000Y-116840000D02* 265 | X175260000Y-116840000D01* 266 | X166370000Y-95420000D02* 267 | X166370000Y-96520000D01* 268 | X169474001Y-95344999D02* 269 | X166445001Y-95344999D01* 270 | X170085001Y-95955999D02* 271 | X169474001Y-95344999D01* 272 | X166445001Y-95344999D02* 273 | X166370000Y-95420000D01* 274 | X170085001Y-111665001D02* 275 | X170085001Y-95955999D01* 276 | X175260000Y-116840000D02* 277 | X170085001Y-111665001D01* 278 | X168910000Y-97722081D02* 279 | X168910000Y-96520000D01* 280 | X168910000Y-111477002D02* 281 | X168910000Y-97722081D01* 282 | X176812998Y-119380000D02* 283 | X168910000Y-111477002D01* 284 | X180340000Y-119380000D02* 285 | X176812998Y-119380000D01* 286 | X213982301Y-103492301D02* 287 | X214630000Y-104140000D01* 288 | X195039999Y-103014999D02* 289 | X213504999Y-103014999D01* 290 | X213504999Y-103014999D02* 291 | X213982301Y-103492301D01* 292 | X194454999Y-103599999D02* 293 | X195039999Y-103014999D01* 294 | X194454999Y-107805001D02* 295 | X194454999Y-103599999D01* 296 | X180340000Y-121920000D02* 297 | X194454999Y-107805001D01* 298 | X208135001Y-113174999D02* 299 | X213982301Y-107327699D01* 300 | X195039999Y-113174999D02* 301 | X208135001Y-113174999D01* 302 | X194454999Y-113759999D02* 303 | X195039999Y-113174999D01* 304 | X194454999Y-114550003D02* 305 | X194454999Y-113759999D01* 306 | X213982301Y-107327699D02* 307 | X214630000Y-106680000D01* 308 | X183420001Y-125585001D02* 309 | X194454999Y-114550003D01* 310 | X181465001Y-125585001D02* 311 | X183420001Y-125585001D01* 312 | X180340000Y-124460000D02* 313 | X181465001Y-125585001D01* 314 | X215277699Y-99707699D02* 315 | X214630000Y-99060000D01* 316 | X215096897Y-110192701D02* 317 | X215602701Y-109686897D01* 318 | X215602701Y-109686897D02* 319 | X215602701Y-100032701D01* 320 | X214757701Y-110192701D02* 321 | X215096897Y-110192701D01* 322 | X210650402Y-114300000D02* 323 | X214757701Y-110192701D01* 324 | X215602701Y-100032701D02* 325 | X215277699Y-99707699D01* 326 | X195580000Y-114300000D02* 327 | X210650402Y-114300000D01* 328 | X215277699Y-97167699D02* 329 | X214630000Y-96520000D01* 330 | X216052711Y-97942711D02* 331 | X215277699Y-97167699D01* 332 | X216052711Y-111776887D02* 333 | X216052711Y-97942711D01* 334 | X210989598Y-116840000D02* 335 | X216052711Y-111776887D01* 336 | X195580000Y-116840000D02* 337 | X210989598Y-116840000D01* 338 | X213657299Y-100627299D02* 339 | X213982301Y-100952301D01* 340 | X213657299Y-96053103D02* 341 | X213657299Y-100627299D01* 342 | X213982301Y-100952301D02* 343 | X214630000Y-101600000D01* 344 | X214163103Y-95547299D02* 345 | X213657299Y-96053103D01* 346 | X215096897Y-95547299D02* 347 | X214163103Y-95547299D01* 348 | X216502721Y-96953123D02* 349 | X215096897Y-95547299D01* 350 | X216502721Y-111963287D02* 351 | X216502721Y-96953123D01* 352 | X209086008Y-119380000D02* 353 | X216502721Y-111963287D01* 354 | X195580000Y-119380000D02* 355 | X209086008Y-119380000D01* 356 | X215277699Y-92087699D02* 357 | X214630000Y-91440000D01* 358 | X216952731Y-93762731D02* 359 | X215277699Y-92087699D01* 360 | X209272409Y-119830009D02* 361 | X216952731Y-112149687D01* 362 | X205289991Y-119830009D02* 363 | X209272409Y-119830009D01* 364 | X216952731Y-112149687D02* 365 | X216952731Y-93762731D01* 366 | X195580000Y-129540000D02* 367 | X205289991Y-119830009D01* 368 | M02* 369 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad (5.1.5-0-10_14)} date Thursday, January 09, 2020 at 04:06:23 PM 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2020-01-09T16:06:23-05:00 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.1.5-0-10_14) 6 | ; #@! TF.FileFunction,NonPlated,1,4,NPTH 7 | FMAT,2 8 | INCH 9 | T1C0.1260 10 | % 11 | G90 12 | G05 13 | T1 14 | X8.025Y-5.15 15 | X8.475Y-5.15 16 | X8.825Y-5.15 17 | X9.275Y-5.15 18 | T0 19 | M30 20 | -------------------------------------------------------------------------------- /gerber/branchControllerPCB-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ; DRILL file {KiCad (5.1.5-0-10_14)} date Thursday, January 09, 2020 at 04:06:23 PM 3 | ; FORMAT={-:-/ absolute / inch / decimal} 4 | ; #@! TF.CreationDate,2020-01-09T16:06:23-05:00 5 | ; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.1.5-0-10_14) 6 | ; #@! TF.FileFunction,Plated,1,4,PTH 7 | FMAT,2 8 | INCH 9 | T1C0.0197 10 | T2C0.0310 11 | T3C0.0354 12 | T4C0.0394 13 | T5C0.0433 14 | T6C0.0437 15 | T7C0.0472 16 | T8C0.0669 17 | % 18 | G90 19 | G05 20 | T1 21 | X7.4Y-5.0 22 | X7.4Y-5.15 23 | T2 24 | X9.03Y-3.7 25 | X9.03Y-3.8 26 | X9.03Y-3.9 27 | X9.03Y-4.0 28 | X9.03Y-4.1 29 | X9.03Y-4.2 30 | X9.03Y-4.3 31 | X9.03Y-4.4 32 | X9.35Y-3.7 33 | X9.35Y-3.8 34 | X9.35Y-3.9 35 | X9.35Y-4.0 36 | X9.35Y-4.1 37 | X9.35Y-4.2 38 | X9.35Y-4.3 39 | X9.35Y-4.4 40 | X8.45Y-3.5 41 | X8.45Y-3.6 42 | X8.45Y-3.7 43 | X8.45Y-3.8 44 | X8.45Y-3.9 45 | X8.45Y-4.0 46 | X8.45Y-4.1 47 | X8.45Y-4.2 48 | X8.45Y-4.3 49 | X8.45Y-4.4 50 | X8.75Y-3.5 51 | X8.75Y-3.6 52 | X8.75Y-3.7 53 | X8.75Y-3.8 54 | X8.75Y-3.9 55 | X8.75Y-4.0 56 | X8.75Y-4.1 57 | X8.75Y-4.2 58 | X8.75Y-4.3 59 | X8.75Y-4.4 60 | T3 61 | X7.9Y-3.45 62 | X8.0Y-3.45 63 | X8.1Y-3.45 64 | X6.2Y-4.25 65 | X6.3Y-4.25 66 | X8.075Y-4.9 67 | X8.125Y-4.8 68 | X8.175Y-4.9 69 | X8.225Y-4.8 70 | X8.275Y-4.9 71 | X8.325Y-4.8 72 | X8.375Y-4.9 73 | X8.425Y-4.8 74 | X8.875Y-4.9 75 | X8.925Y-4.8 76 | X8.975Y-4.9 77 | X9.025Y-4.8 78 | X9.075Y-4.9 79 | X9.125Y-4.8 80 | X9.175Y-4.9 81 | X9.225Y-4.8 82 | T4 83 | X6.55Y-3.8 84 | X6.65Y-3.8 85 | X6.75Y-3.8 86 | X6.85Y-3.8 87 | X6.95Y-3.8 88 | X7.05Y-3.8 89 | T5 90 | X7.1Y-4.1 91 | X7.1Y-4.2 92 | X7.1Y-4.3 93 | X7.1Y-4.4 94 | X7.1Y-4.5 95 | X7.1Y-4.6 96 | X7.1Y-4.7 97 | X7.1Y-4.8 98 | X7.1Y-4.9 99 | X7.1Y-5.0 100 | X7.1Y-5.1 101 | X7.1Y-5.2 102 | X7.1Y-5.3 103 | X7.1Y-5.4 104 | X7.2Y-4.1 105 | X7.2Y-4.9 106 | X7.2Y-5.0 107 | X7.2Y-5.1 108 | X7.2Y-5.3 109 | X7.3Y-4.1 110 | X7.4Y-4.1 111 | X7.5Y-4.1 112 | X7.6Y-4.1 113 | X7.7Y-4.1 114 | X7.7Y-4.2 115 | X7.7Y-4.3 116 | X7.7Y-4.4 117 | X7.7Y-4.5 118 | X7.7Y-4.6 119 | X7.7Y-4.7 120 | X7.7Y-4.8 121 | X7.7Y-4.9 122 | X7.7Y-5.0 123 | X7.7Y-5.1 124 | X7.7Y-5.2 125 | X7.7Y-5.3 126 | X7.7Y-5.4 127 | T6 128 | X5.95Y-4.7 129 | X5.95Y-4.8 130 | X5.95Y-4.9 131 | X5.95Y-5.0 132 | X5.95Y-5.1 133 | X5.95Y-5.2 134 | X6.75Y-4.7 135 | X6.75Y-4.8 136 | X6.75Y-4.9 137 | X6.75Y-5.0 138 | X6.75Y-5.1 139 | X6.75Y-5.2 140 | T7 141 | X6.95Y-4.5 142 | X6.95Y-4.8 143 | T8 144 | X7.9463Y-5.2701 145 | X8.5537Y-5.2701 146 | X8.7463Y-5.2701 147 | X9.3537Y-5.2701 148 | T0 149 | M30 150 | -------------------------------------------------------------------------------- /include/BranchController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define pinIRReceiver 3 4 | #define pinEthernetCS 10 5 | #define pinHeartbeat 23 6 | 7 | #define MAX_LEDS_PER_STRIP 550 8 | // Pin layouts for LEDs will be: 2,14,7,8,6,20,21,5 9 | 10 | #define OPEN_PIXEL_PORT 7890 11 | 12 | #define BRIGHTNESS 32 13 | 14 | -------------------------------------------------------------------------------- /include/README.md: -------------------------------------------------------------------------------- 1 | Hey! I hate C++ objects. So I don't really use them that much. We use namespaces instead. 2 | 3 | Each "module" defines one namespace and consists of a .h file and a .cpp file. The average module implements both setup() and void() which do the usual Arduino things. 4 | 5 | Global constants (like pin assignments) go in BranchController.h. 6 | Specific settings to this module go in ModuleName.h. 7 | 8 | ModuleName.h 9 | --- 10 | 11 | ``` 12 | // Description of the module is 13 | // in the .h file 14 | 15 | #pragma once 16 | 17 | namespace ModuleName { 18 | void setup(void); 19 | void loop(void); 20 | } 21 | 22 | ``` 23 | 24 | ModuleName.cpp 25 | --- 26 | 27 | ``` 28 | #include 29 | #include 30 | #include 31 | 32 | namespace ModuleName { 33 | 34 | void setup(void) 35 | { 36 | 37 | } 38 | 39 | void loop(void) 40 | { 41 | 42 | } 43 | 44 | } 45 | ``` 46 | -------------------------------------------------------------------------------- /kicad/BranchControllerSchematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jspolsky/branchController2/214cceb3d85411d83ebd88c1b07040e1b2c9dc87/kicad/BranchControllerSchematic.png -------------------------------------------------------------------------------- /kicad/branchController.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP Adafruit_4400_OLED 4 | D Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/) 5 | K connector 6 | F ~ 7 | $ENDCMP 8 | # 9 | $CMP WIZ850io 10 | D Networking Modules W5500 + MAG Jack ioPlatform Mod 11 | F http://wizwiki.net/wiki/doku.php?id=products:wiz850io:start#hardware_specification 12 | $ENDCMP 13 | # 14 | #End Doc Library 15 | -------------------------------------------------------------------------------- /kicad/branchController.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # Adafruit_4400_OLED 5 | # 6 | DEF Adafruit_4400_OLED J 0 40 Y N 1 F N 7 | F0 "J" 0 300 50 H V C CNN 8 | F1 "Adafruit_4400_OLED" 0 -400 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Connector*:*_1x??_* 13 | $ENDFPLIST 14 | DRAW 15 | S -50 -295 0 -305 1 1 6 N 16 | S -50 -195 0 -205 1 1 6 N 17 | S -50 -95 0 -105 1 1 6 N 18 | S -50 5 0 -5 1 1 6 N 19 | S -50 105 0 95 1 1 6 N 20 | S -50 205 0 195 1 1 6 N 21 | S -50 250 50 -350 1 1 10 f 22 | X 5 3VO -200 -200 150 R 50 50 1 1 N 23 | X 4 GND -200 -100 150 R 50 50 1 1 W 24 | X 3 RESET -200 0 150 R 50 50 1 1 N 25 | X 2 SCL -200 100 150 R 50 50 1 1 I 26 | X 1 SDA -200 200 150 R 50 50 1 1 I 27 | X 6 VIN -200 -300 150 R 50 50 1 1 W 28 | ENDDRAW 29 | ENDDEF 30 | # 31 | # WIZ850io 32 | # 33 | DEF WIZ850io IC 0 30 Y Y 1 F N 34 | F0 "IC" 1150 300 50 H V L CNN 35 | F1 "WIZ850io" 1150 200 50 H V L CNN 36 | F2 "WIZ850io" 1150 100 50 H I L CNN 37 | F3 "http://wizwiki.net/wiki/doku.php?id=products:wiz850io:start#hardware_specification" 1150 0 50 H I L CNN 38 | F4 "Networking Modules W5500 + MAG Jack ioPlatform Mod" 1150 -100 50 H I L CNN "Description" 39 | F5 "12" 1150 -200 50 H I L CNN "Height" 40 | F6 "950-WIZ850IO" 1150 -300 50 H I L CNN "Mouser Part Number" 41 | F7 "https://www.mouser.com/Search/Refine.aspx?Keyword=950-WIZ850IO" 1150 -400 50 H I L CNN "Mouser Price/Stock" 42 | F8 "WIZnet Inc" 1150 -500 50 H I L CNN "Manufacturer_Name" 43 | F9 "WIZ850io" 1150 -600 50 H I L CNN "Manufacturer_Part_Number" 44 | DRAW 45 | P 5 0 1 6 200 100 1100 100 1100 -600 200 -600 200 100 N 46 | X GND_1 1 0 0 200 R 50 50 0 0 U 47 | X NC 10 1300 -300 200 L 50 50 0 0 N 48 | X RSTN 11 1300 -400 200 L 50 50 0 0 U 49 | X MISO 12 1300 -500 200 L 50 50 0 0 U 50 | X GND_2 2 0 -100 200 R 50 50 0 0 U 51 | X MOSI 3 0 -200 200 R 50 50 0 0 U 52 | X SCLK 4 0 -300 200 R 50 50 0 0 U 53 | X SCNN 5 0 -400 200 R 50 50 0 0 U 54 | X INTN 6 0 -500 200 R 50 50 0 0 U 55 | X GND_3 7 1300 0 200 L 50 50 0 0 U 56 | X 3.3V_1 8 1300 -100 200 L 50 50 0 0 U 57 | X 3.3V_2 9 1300 -200 200 L 50 50 0 0 U 58 | ENDDRAW 59 | ENDDEF 60 | # 61 | #End Library 62 | -------------------------------------------------------------------------------- /kicad/branchController.pretty/4116R-1-101LF.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 4116R-1-101LF (layer F.Cu) (tedit 0) 2 | (fp_text reference REF** (at -4.064 -8.89) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value BO_4116R (at -4.064 -8.89) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_arc (start -4.064 -19.8755) (end -3.7592 -19.8755) (angle 180) (layer F.Fab) (width 0.1524)) 9 | (fp_line (start -0.4445 0.7874) (end 0.9017 0.7874) (layer F.CrtYd) (width 0.1524)) 10 | (fp_line (start -0.4445 2.3495) (end -0.4445 0.7874) (layer F.CrtYd) (width 0.1524)) 11 | (fp_line (start -7.6835 2.3495) (end -0.4445 2.3495) (layer F.CrtYd) (width 0.1524)) 12 | (fp_line (start -7.6835 0.7874) (end -7.6835 2.3495) (layer F.CrtYd) (width 0.1524)) 13 | (fp_line (start -9.0297 0.7874) (end -7.6835 0.7874) (layer F.CrtYd) (width 0.1524)) 14 | (fp_line (start -9.0297 -18.5674) (end -9.0297 0.7874) (layer F.CrtYd) (width 0.1524)) 15 | (fp_line (start -7.6835 -18.5674) (end -9.0297 -18.5674) (layer F.CrtYd) (width 0.1524)) 16 | (fp_line (start -7.6835 -20.1295) (end -7.6835 -18.5674) (layer F.CrtYd) (width 0.1524)) 17 | (fp_line (start -0.4445 -20.1295) (end -7.6835 -20.1295) (layer F.CrtYd) (width 0.1524)) 18 | (fp_line (start -0.4445 -18.5674) (end -0.4445 -20.1295) (layer F.CrtYd) (width 0.1524)) 19 | (fp_line (start 0.9017 -18.5674) (end -0.4445 -18.5674) (layer F.CrtYd) (width 0.1524)) 20 | (fp_line (start 0.9017 0.7874) (end 0.9017 -18.5674) (layer F.CrtYd) (width 0.1524)) 21 | (fp_line (start -0.5715 -18.576649) (end -0.5715 -20.0025) (layer F.SilkS) (width 0.1524)) 22 | (fp_line (start -0.5715 -16.036649) (end -0.5715 -16.983351) (layer F.SilkS) (width 0.1524)) 23 | (fp_line (start -0.5715 -13.496649) (end -0.5715 -14.443351) (layer F.SilkS) (width 0.1524)) 24 | (fp_line (start -0.5715 -10.956649) (end -0.5715 -11.903351) (layer F.SilkS) (width 0.1524)) 25 | (fp_line (start -0.5715 -8.416649) (end -0.5715 -9.363351) (layer F.SilkS) (width 0.1524)) 26 | (fp_line (start -0.5715 -5.876649) (end -0.5715 -6.823351) (layer F.SilkS) (width 0.1524)) 27 | (fp_line (start -0.5715 -3.336649) (end -0.5715 -4.283351) (layer F.SilkS) (width 0.1524)) 28 | (fp_line (start -0.5715 -0.796649) (end -0.5715 -1.743351) (layer F.SilkS) (width 0.1524)) 29 | (fp_line (start -7.5565 0.796649) (end -7.5565 2.2225) (layer F.SilkS) (width 0.1524)) 30 | (fp_line (start -7.5565 -1.743351) (end -7.5565 -0.796649) (layer F.SilkS) (width 0.1524)) 31 | (fp_line (start -7.5565 -4.283351) (end -7.5565 -3.336649) (layer F.SilkS) (width 0.1524)) 32 | (fp_line (start -7.5565 -6.823351) (end -7.5565 -5.876649) (layer F.SilkS) (width 0.1524)) 33 | (fp_line (start -7.5565 -9.363351) (end -7.5565 -8.416649) (layer F.SilkS) (width 0.1524)) 34 | (fp_line (start -7.5565 -11.903351) (end -7.5565 -10.956649) (layer F.SilkS) (width 0.1524)) 35 | (fp_line (start -7.5565 -14.443351) (end -7.5565 -13.496649) (layer F.SilkS) (width 0.1524)) 36 | (fp_line (start -7.5565 -16.79956) (end -7.5565 -16.036649) (layer F.SilkS) (width 0.1524)) 37 | (fp_line (start -7.4295 -19.8755) (end -7.4295 2.0955) (layer F.Fab) (width 0.1524)) 38 | (fp_line (start -0.6985 -19.8755) (end -7.4295 -19.8755) (layer F.Fab) (width 0.1524)) 39 | (fp_line (start -0.6985 2.0955) (end -0.6985 -19.8755) (layer F.Fab) (width 0.1524)) 40 | (fp_line (start -7.4295 2.0955) (end -0.6985 2.0955) (layer F.Fab) (width 0.1524)) 41 | (fp_line (start -7.5565 -20.0025) (end -7.5565 -18.76044) (layer F.SilkS) (width 0.1524)) 42 | (fp_line (start -0.5715 -20.0025) (end -7.5565 -20.0025) (layer F.SilkS) (width 0.1524)) 43 | (fp_line (start -0.5715 2.2225) (end -0.5715 0.796649) (layer F.SilkS) (width 0.1524)) 44 | (fp_line (start -7.5565 2.2225) (end -0.5715 2.2225) (layer F.SilkS) (width 0.1524)) 45 | (fp_line (start 0.3937 -18.1737) (end -0.6985 -18.1737) (layer F.Fab) (width 0.1524)) 46 | (fp_line (start 0.3937 -17.3863) (end 0.3937 -18.1737) (layer F.Fab) (width 0.1524)) 47 | (fp_line (start -0.6985 -17.3863) (end 0.3937 -17.3863) (layer F.Fab) (width 0.1524)) 48 | (fp_line (start -0.6985 -18.1737) (end -0.6985 -17.3863) (layer F.Fab) (width 0.1524)) 49 | (fp_line (start 0.3937 -15.6337) (end -0.6985 -15.6337) (layer F.Fab) (width 0.1524)) 50 | (fp_line (start 0.3937 -14.8463) (end 0.3937 -15.6337) (layer F.Fab) (width 0.1524)) 51 | (fp_line (start -0.6985 -14.8463) (end 0.3937 -14.8463) (layer F.Fab) (width 0.1524)) 52 | (fp_line (start -0.6985 -15.6337) (end -0.6985 -14.8463) (layer F.Fab) (width 0.1524)) 53 | (fp_line (start 0.3937 -13.0937) (end -0.6985 -13.0937) (layer F.Fab) (width 0.1524)) 54 | (fp_line (start 0.3937 -12.3063) (end 0.3937 -13.0937) (layer F.Fab) (width 0.1524)) 55 | (fp_line (start -0.6985 -12.3063) (end 0.3937 -12.3063) (layer F.Fab) (width 0.1524)) 56 | (fp_line (start -0.6985 -13.0937) (end -0.6985 -12.3063) (layer F.Fab) (width 0.1524)) 57 | (fp_line (start 0.3937 -10.5537) (end -0.6985 -10.5537) (layer F.Fab) (width 0.1524)) 58 | (fp_line (start 0.3937 -9.7663) (end 0.3937 -10.5537) (layer F.Fab) (width 0.1524)) 59 | (fp_line (start -0.6985 -9.7663) (end 0.3937 -9.7663) (layer F.Fab) (width 0.1524)) 60 | (fp_line (start -0.6985 -10.5537) (end -0.6985 -9.7663) (layer F.Fab) (width 0.1524)) 61 | (fp_line (start 0.3937 -8.0137) (end -0.6985 -8.0137) (layer F.Fab) (width 0.1524)) 62 | (fp_line (start 0.3937 -7.2263) (end 0.3937 -8.0137) (layer F.Fab) (width 0.1524)) 63 | (fp_line (start -0.6985 -7.2263) (end 0.3937 -7.2263) (layer F.Fab) (width 0.1524)) 64 | (fp_line (start -0.6985 -8.0137) (end -0.6985 -7.2263) (layer F.Fab) (width 0.1524)) 65 | (fp_line (start 0.3937 -5.4737) (end -0.6985 -5.4737) (layer F.Fab) (width 0.1524)) 66 | (fp_line (start 0.3937 -4.6863) (end 0.3937 -5.4737) (layer F.Fab) (width 0.1524)) 67 | (fp_line (start -0.6985 -4.6863) (end 0.3937 -4.6863) (layer F.Fab) (width 0.1524)) 68 | (fp_line (start -0.6985 -5.4737) (end -0.6985 -4.6863) (layer F.Fab) (width 0.1524)) 69 | (fp_line (start 0.3937 -2.9337) (end -0.6985 -2.9337) (layer F.Fab) (width 0.1524)) 70 | (fp_line (start 0.3937 -2.1463) (end 0.3937 -2.9337) (layer F.Fab) (width 0.1524)) 71 | (fp_line (start -0.6985 -2.1463) (end 0.3937 -2.1463) (layer F.Fab) (width 0.1524)) 72 | (fp_line (start -0.6985 -2.9337) (end -0.6985 -2.1463) (layer F.Fab) (width 0.1524)) 73 | (fp_line (start 0.3937 -0.3937) (end -0.6985 -0.3937) (layer F.Fab) (width 0.1524)) 74 | (fp_line (start 0.3937 0.3937) (end 0.3937 -0.3937) (layer F.Fab) (width 0.1524)) 75 | (fp_line (start -0.6985 0.3937) (end 0.3937 0.3937) (layer F.Fab) (width 0.1524)) 76 | (fp_line (start -0.6985 -0.3937) (end -0.6985 0.3937) (layer F.Fab) (width 0.1524)) 77 | (fp_line (start -8.5217 0.3937) (end -7.4295 0.3937) (layer F.Fab) (width 0.1524)) 78 | (fp_line (start -8.5217 -0.3937) (end -8.5217 0.3937) (layer F.Fab) (width 0.1524)) 79 | (fp_line (start -7.4295 -0.3937) (end -8.5217 -0.3937) (layer F.Fab) (width 0.1524)) 80 | (fp_line (start -7.4295 0.3937) (end -7.4295 -0.3937) (layer F.Fab) (width 0.1524)) 81 | (fp_line (start -8.5217 -2.1463) (end -7.4295 -2.1463) (layer F.Fab) (width 0.1524)) 82 | (fp_line (start -8.5217 -2.9337) (end -8.5217 -2.1463) (layer F.Fab) (width 0.1524)) 83 | (fp_line (start -7.4295 -2.9337) (end -8.5217 -2.9337) (layer F.Fab) (width 0.1524)) 84 | (fp_line (start -7.4295 -2.1463) (end -7.4295 -2.9337) (layer F.Fab) (width 0.1524)) 85 | (fp_line (start -8.5217 -4.6863) (end -7.4295 -4.6863) (layer F.Fab) (width 0.1524)) 86 | (fp_line (start -8.5217 -5.4737) (end -8.5217 -4.6863) (layer F.Fab) (width 0.1524)) 87 | (fp_line (start -7.4295 -5.4737) (end -8.5217 -5.4737) (layer F.Fab) (width 0.1524)) 88 | (fp_line (start -7.4295 -4.6863) (end -7.4295 -5.4737) (layer F.Fab) (width 0.1524)) 89 | (fp_line (start -8.5217 -7.2263) (end -7.4295 -7.2263) (layer F.Fab) (width 0.1524)) 90 | (fp_line (start -8.5217 -8.0137) (end -8.5217 -7.2263) (layer F.Fab) (width 0.1524)) 91 | (fp_line (start -7.4295 -8.0137) (end -8.5217 -8.0137) (layer F.Fab) (width 0.1524)) 92 | (fp_line (start -7.4295 -7.2263) (end -7.4295 -8.0137) (layer F.Fab) (width 0.1524)) 93 | (fp_line (start -8.5217 -9.7663) (end -7.4295 -9.7663) (layer F.Fab) (width 0.1524)) 94 | (fp_line (start -8.5217 -10.5537) (end -8.5217 -9.7663) (layer F.Fab) (width 0.1524)) 95 | (fp_line (start -7.4295 -10.5537) (end -8.5217 -10.5537) (layer F.Fab) (width 0.1524)) 96 | (fp_line (start -7.4295 -9.7663) (end -7.4295 -10.5537) (layer F.Fab) (width 0.1524)) 97 | (fp_line (start -8.5217 -12.3063) (end -7.4295 -12.3063) (layer F.Fab) (width 0.1524)) 98 | (fp_line (start -8.5217 -13.0937) (end -8.5217 -12.3063) (layer F.Fab) (width 0.1524)) 99 | (fp_line (start -7.4295 -13.0937) (end -8.5217 -13.0937) (layer F.Fab) (width 0.1524)) 100 | (fp_line (start -7.4295 -12.3063) (end -7.4295 -13.0937) (layer F.Fab) (width 0.1524)) 101 | (fp_line (start -8.5217 -14.8463) (end -7.4295 -14.8463) (layer F.Fab) (width 0.1524)) 102 | (fp_line (start -8.5217 -15.6337) (end -8.5217 -14.8463) (layer F.Fab) (width 0.1524)) 103 | (fp_line (start -7.4295 -15.6337) (end -8.5217 -15.6337) (layer F.Fab) (width 0.1524)) 104 | (fp_line (start -7.4295 -14.8463) (end -7.4295 -15.6337) (layer F.Fab) (width 0.1524)) 105 | (fp_line (start -8.5217 -17.3863) (end -7.4295 -17.3863) (layer F.Fab) (width 0.1524)) 106 | (fp_line (start -8.5217 -18.1737) (end -8.5217 -17.3863) (layer F.Fab) (width 0.1524)) 107 | (fp_line (start -7.4295 -18.1737) (end -8.5217 -18.1737) (layer F.Fab) (width 0.1524)) 108 | (fp_line (start -7.4295 -17.3863) (end -7.4295 -18.1737) (layer F.Fab) (width 0.1524)) 109 | (fp_text user * (at -8.128 -19.1897) (layer F.SilkS) 110 | (effects (font (size 1 1) (thickness 0.15))) 111 | ) 112 | (fp_text user * (at -7.1755 -17.78) (layer F.Fab) 113 | (effects (font (size 1 1) (thickness 0.15))) 114 | ) 115 | (fp_text user 0.051in/1.295mm (at -8.128 4.5085) (layer Dwgs.User) 116 | (effects (font (size 1 1) (thickness 0.15))) 117 | ) 118 | (fp_text user 0.32in/8.128mm (at -4.064 -22.2885) (layer Dwgs.User) 119 | (effects (font (size 1 1) (thickness 0.15))) 120 | ) 121 | (fp_text user 0.051in/1.295mm (at 3.048 -17.78) (layer Dwgs.User) 122 | (effects (font (size 1 1) (thickness 0.15))) 123 | ) 124 | (fp_text user 0.1in/2.54mm (at -11.176 -16.51) (layer Dwgs.User) 125 | (effects (font (size 1 1) (thickness 0.15))) 126 | ) 127 | (fp_text user * (at -7.1755 -17.78) (layer F.Fab) 128 | (effects (font (size 1 1) (thickness 0.15))) 129 | ) 130 | (fp_text user * (at -8.128 -19.1897) (layer F.SilkS) 131 | (effects (font (size 1 1) (thickness 0.15))) 132 | ) 133 | (fp_text user "Copyright 2016 Accelerated Designs. All rights reserved." (at 0 0) (layer Cmts.User) 134 | (effects (font (size 0.127 0.127) (thickness 0.002))) 135 | ) 136 | (pad 16 thru_hole circle (at 0 -17.78) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 137 | (pad 15 thru_hole circle (at 0 -15.24) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 138 | (pad 14 thru_hole circle (at 0 -12.7) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 139 | (pad 13 thru_hole circle (at 0 -10.16) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 140 | (pad 12 thru_hole circle (at 0 -7.62) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 141 | (pad 11 thru_hole circle (at 0 -5.08) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 142 | (pad 10 thru_hole circle (at 0 -2.54) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 143 | (pad 9 thru_hole circle (at 0 0) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 144 | (pad 8 thru_hole circle (at -8.128 0) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 145 | (pad 7 thru_hole circle (at -8.128 -2.54) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 146 | (pad 6 thru_hole circle (at -8.128 -5.08) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 147 | (pad 5 thru_hole circle (at -8.128 -7.62) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 148 | (pad 4 thru_hole circle (at -8.128 -10.16) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 149 | (pad 3 thru_hole circle (at -8.128 -12.7) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 150 | (pad 2 thru_hole circle (at -8.128 -15.24) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 151 | (pad 1 thru_hole rect (at -8.128 -17.78) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 152 | ) 153 | -------------------------------------------------------------------------------- /kicad/branchController.pretty/ASSMANN_A-2004-1-4-LP-N-R.kicad_mod: -------------------------------------------------------------------------------- 1 | (module ASSMANN_A-2004-1-4-LP-N-R (layer F.Cu) (tedit 5DFFA04E) 2 | (fp_text reference REF** (at -5.78656 -11.5496) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.015))) 4 | ) 5 | (fp_text value ASSMANN_A-2004-1-4-LP-N-R (at 6.7718 9.0301) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.015))) 7 | ) 8 | (fp_circle (center -9.62 -6.35) (end -9.52 -6.35) (layer F.Fab) (width 0.2)) 9 | (fp_line (start -9.25 8.38) (end -9.25 -10.62) (layer F.CrtYd) (width 0.05)) 10 | (fp_line (start 9.25 8.38) (end -9.25 8.38) (layer F.CrtYd) (width 0.05)) 11 | (fp_line (start 9.25 -10.62) (end 9.25 8.38) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start -9.25 -10.62) (end 9.25 -10.62) (layer F.CrtYd) (width 0.05)) 13 | (fp_circle (center -9.62 -6.35) (end -9.52 -6.35) (layer F.SilkS) (width 0.2)) 14 | (fp_line (start -8 1.48) (end -8 -10.37) (layer F.SilkS) (width 0.127)) 15 | (fp_line (start -8 8.13) (end -8 4.62) (layer F.SilkS) (width 0.127)) 16 | (fp_line (start 8 8.13) (end -8 8.13) (layer F.SilkS) (width 0.127)) 17 | (fp_line (start 8 4.62) (end 8 8.13) (layer F.SilkS) (width 0.127)) 18 | (fp_line (start 8 -10.37) (end 8 1.48) (layer F.SilkS) (width 0.127)) 19 | (fp_line (start -8 -10.37) (end 8 -10.37) (layer F.SilkS) (width 0.127)) 20 | (fp_line (start -8 8.13) (end -8 -10.37) (layer F.Fab) (width 0.127)) 21 | (fp_line (start 8 8.13) (end -8 8.13) (layer F.Fab) (width 0.127)) 22 | (fp_line (start 8 -10.37) (end 8 8.13) (layer F.Fab) (width 0.127)) 23 | (fp_line (start -8 -10.37) (end 8 -10.37) (layer F.Fab) (width 0.127)) 24 | (pad S2 thru_hole circle (at 7.715 3.05) (size 2.55 2.55) (drill 1.7) (layers *.Cu *.Mask)) 25 | (pad S1 thru_hole circle (at -7.715 3.05) (size 2.55 2.55) (drill 1.7) (layers *.Cu *.Mask)) 26 | (pad 8 thru_hole circle (at 4.445 -8.89) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 27 | (pad 7 thru_hole circle (at 3.175 -6.35) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 28 | (pad 1 thru_hole rect (at -4.445 -6.35) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 29 | (pad 3 thru_hole circle (at -1.905 -6.35) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 30 | (pad 5 thru_hole circle (at 0.635 -6.35) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 31 | (pad 2 thru_hole circle (at -3.175 -8.89) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 32 | (pad 4 thru_hole circle (at -0.635 -8.89) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 33 | (pad None np_thru_hole circle (at 5.715 0) (size 3.2 3.2) (drill 3.2) (layers *.Cu *.Mask)) 34 | (pad None np_thru_hole circle (at -5.715 0) (size 3.2 3.2) (drill 3.2) (layers *.Cu *.Mask)) 35 | (pad 6 thru_hole circle (at 1.905 -8.89) (size 1.408 1.408) (drill 0.9) (layers *.Cu *.Mask)) 36 | ) 37 | -------------------------------------------------------------------------------- /kicad/branchController.pretty/AdaFruit4400LED.kicad_mod: -------------------------------------------------------------------------------- 1 | (module AdaFruit4400LED (layer F.Cu) (tedit 5E00EBC5) 2 | (descr "Through hole straight socket strip, 1x06, 2.54mm pitch, single row (from Kicad 4.0.7), script generated") 3 | (tags "Through hole socket strip THT 1x06 2.54mm single row") 4 | (fp_text reference REF** (at 0 -2.77) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value AdaFruit4400LED (at 16.51 6.35 270 unlocked) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start -1.27 -1.27) (end 0.635 -1.27) (layer F.Fab) (width 0.1)) 11 | (fp_line (start 0.635 -1.27) (end 1.27 -0.635) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 1.27 -0.635) (end 1.27 13.97) (layer F.Fab) (width 0.1)) 13 | (fp_line (start 1.27 13.97) (end -1.27 13.97) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -1.27 13.97) (end -1.27 -1.27) (layer F.Fab) (width 0.1)) 15 | (fp_text user %R (at 0 6.35 90) (layer F.Fab) 16 | (effects (font (size 1 1) (thickness 0.15))) 17 | ) 18 | (fp_line (start -2.54 -10.16) (end -2.54 22.86) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start -2.54 -10.16) (end 19.05 -10.16) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 19.05 -10.16) (end 19.05 22.86) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start 19.05 22.86) (end -2.54 22.86) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start 20.32 -11.43) (end 20.32 24.13) (layer F.CrtYd) (width 0.12)) 23 | (fp_line (start -3.81 -11.43) (end 20.32 -11.43) (layer F.CrtYd) (width 0.12)) 24 | (fp_line (start 20.32 24.13) (end -3.81 24.13) (layer F.CrtYd) (width 0.12)) 25 | (fp_line (start -3.81 24.13) (end -3.81 -11.43) (layer F.CrtYd) (width 0.12)) 26 | (fp_line (start -3.81 -11.43) (end 20.32 -11.43) (layer F.CrtYd) (width 0.12)) 27 | (fp_line (start -1.27 -1.27) (end -1.27 1.27) (layer F.SilkS) (width 0.12)) 28 | (fp_line (start -1.27 1.27) (end -1.27 -1.27) (layer F.SilkS) (width 0.12)) 29 | (fp_line (start -1.27 -1.27) (end 1.27 -1.27) (layer F.SilkS) (width 0.12)) 30 | (fp_line (start 1.27 -1.27) (end 1.27 1.27) (layer F.SilkS) (width 0.12)) 31 | (fp_line (start 1.27 -1.27) (end -1.27 -1.27) (layer F.SilkS) (width 0.12)) 32 | (fp_line (start -1.27 1.27) (end -1.27 13.97) (layer F.SilkS) (width 0.12)) 33 | (fp_line (start -1.27 13.97) (end 1.27 13.97) (layer F.SilkS) (width 0.12)) 34 | (fp_line (start 1.27 13.97) (end 1.27 1.27) (layer F.SilkS) (width 0.12)) 35 | (fp_line (start -1.27 1.27) (end -1.27 13.97) (layer F.SilkS) (width 0.12)) 36 | (fp_line (start -1.27 13.97) (end 1.27 13.97) (layer F.SilkS) (width 0.12)) 37 | (pad SDA thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 38 | (pad SCL thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 39 | (pad RESET thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 40 | (pad GND thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 41 | (pad 3VO thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 42 | (pad VIN thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 43 | (model ${KISYS3DMOD}/Connector_PinSocket_2.54mm.3dshapes/PinSocket_1x06_P2.54mm_Vertical.wrl 44 | (at (xyz 0 0 0)) 45 | (scale (xyz 1 1 1)) 46 | (rotate (xyz 0 0 0)) 47 | ) 48 | ) 49 | -------------------------------------------------------------------------------- /kicad/branchController.pretty/SN74HCT245N.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SN74HCT245N (layer F.Cu) (tedit 0) 2 | (fp_text reference REF** (at -3.81 -11.43) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value N20 (at -3.81 -11.43) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_arc (start -3.81 -24.892) (end -3.5052 -24.892) (angle 180) (layer F.Fab) (width 0.1524)) 9 | (fp_line (start -0.254 0.254) (end 0.9017 0.254) (layer F.CrtYd) (width 0.1524)) 10 | (fp_line (start -0.254 2.286) (end -0.254 0.254) (layer F.CrtYd) (width 0.1524)) 11 | (fp_line (start -7.366 2.286) (end -0.254 2.286) (layer F.CrtYd) (width 0.1524)) 12 | (fp_line (start -7.366 0.254) (end -7.366 2.286) (layer F.CrtYd) (width 0.1524)) 13 | (fp_line (start -8.5217 0.254) (end -7.366 0.254) (layer F.CrtYd) (width 0.1524)) 14 | (fp_line (start -8.5217 -23.114) (end -8.5217 0.254) (layer F.CrtYd) (width 0.1524)) 15 | (fp_line (start -7.366 -23.114) (end -8.5217 -23.114) (layer F.CrtYd) (width 0.1524)) 16 | (fp_line (start -7.366 -25.146) (end -7.366 -23.114) (layer F.CrtYd) (width 0.1524)) 17 | (fp_line (start -0.254 -25.146) (end -7.366 -25.146) (layer F.CrtYd) (width 0.1524)) 18 | (fp_line (start -0.254 -23.114) (end -0.254 -25.146) (layer F.CrtYd) (width 0.1524)) 19 | (fp_line (start 0.9017 -23.114) (end -0.254 -23.114) (layer F.CrtYd) (width 0.1524)) 20 | (fp_line (start 0.9017 0.254) (end 0.9017 -23.114) (layer F.CrtYd) (width 0.1524)) 21 | (fp_line (start -0.381 -23.763383) (end -0.381 -25.019) (layer F.SilkS) (width 0.1524)) 22 | (fp_line (start -0.381 -21.223383) (end -0.381 -21.956617) (layer F.SilkS) (width 0.1524)) 23 | (fp_line (start -0.381 -18.683383) (end -0.381 -19.416617) (layer F.SilkS) (width 0.1524)) 24 | (fp_line (start -0.381 -16.143383) (end -0.381 -16.876617) (layer F.SilkS) (width 0.1524)) 25 | (fp_line (start -0.381 -13.603383) (end -0.381 -14.336617) (layer F.SilkS) (width 0.1524)) 26 | (fp_line (start -0.381 -11.063383) (end -0.381 -11.796617) (layer F.SilkS) (width 0.1524)) 27 | (fp_line (start -0.381 -8.523383) (end -0.381 -9.256617) (layer F.SilkS) (width 0.1524)) 28 | (fp_line (start -0.381 -5.983383) (end -0.381 -6.716617) (layer F.SilkS) (width 0.1524)) 29 | (fp_line (start -0.381 -3.443383) (end -0.381 -4.176617) (layer F.SilkS) (width 0.1524)) 30 | (fp_line (start -0.381 -0.903383) (end -0.381 -1.636617) (layer F.SilkS) (width 0.1524)) 31 | (fp_line (start -7.239 0.903383) (end -7.239 2.159) (layer F.SilkS) (width 0.1524)) 32 | (fp_line (start -7.239 -1.636617) (end -7.239 -0.903383) (layer F.SilkS) (width 0.1524)) 33 | (fp_line (start -7.239 -4.176617) (end -7.239 -3.443383) (layer F.SilkS) (width 0.1524)) 34 | (fp_line (start -7.239 -6.716617) (end -7.239 -5.983383) (layer F.SilkS) (width 0.1524)) 35 | (fp_line (start -7.239 -9.256617) (end -7.239 -8.523383) (layer F.SilkS) (width 0.1524)) 36 | (fp_line (start -7.239 -11.796617) (end -7.239 -11.063383) (layer F.SilkS) (width 0.1524)) 37 | (fp_line (start -7.239 -14.336617) (end -7.239 -13.603383) (layer F.SilkS) (width 0.1524)) 38 | (fp_line (start -7.239 -16.876617) (end -7.239 -16.143383) (layer F.SilkS) (width 0.1524)) 39 | (fp_line (start -7.239 -19.416617) (end -7.239 -18.683383) (layer F.SilkS) (width 0.1524)) 40 | (fp_line (start -7.239 -21.87956) (end -7.239 -21.223383) (layer F.SilkS) (width 0.1524)) 41 | (fp_line (start -7.112 -24.892) (end -7.112 2.032) (layer F.Fab) (width 0.1524)) 42 | (fp_line (start -0.508 -24.892) (end -7.112 -24.892) (layer F.Fab) (width 0.1524)) 43 | (fp_line (start -0.508 2.032) (end -0.508 -24.892) (layer F.Fab) (width 0.1524)) 44 | (fp_line (start -7.112 2.032) (end -0.508 2.032) (layer F.Fab) (width 0.1524)) 45 | (fp_line (start -7.239 -25.019) (end -7.239 -23.84044) (layer F.SilkS) (width 0.1524)) 46 | (fp_line (start -0.381 -25.019) (end -7.239 -25.019) (layer F.SilkS) (width 0.1524)) 47 | (fp_line (start -0.381 2.159) (end -0.381 0.903383) (layer F.SilkS) (width 0.1524)) 48 | (fp_line (start -7.239 2.159) (end -0.381 2.159) (layer F.SilkS) (width 0.1524)) 49 | (fp_line (start 0.3937 -23.2537) (end -0.508 -23.2537) (layer F.Fab) (width 0.1524)) 50 | (fp_line (start 0.3937 -22.4663) (end 0.3937 -23.2537) (layer F.Fab) (width 0.1524)) 51 | (fp_line (start -0.508 -22.4663) (end 0.3937 -22.4663) (layer F.Fab) (width 0.1524)) 52 | (fp_line (start -0.508 -23.2537) (end -0.508 -22.4663) (layer F.Fab) (width 0.1524)) 53 | (fp_line (start 0.3937 -20.7137) (end -0.508 -20.7137) (layer F.Fab) (width 0.1524)) 54 | (fp_line (start 0.3937 -19.9263) (end 0.3937 -20.7137) (layer F.Fab) (width 0.1524)) 55 | (fp_line (start -0.508 -19.9263) (end 0.3937 -19.9263) (layer F.Fab) (width 0.1524)) 56 | (fp_line (start -0.508 -20.7137) (end -0.508 -19.9263) (layer F.Fab) (width 0.1524)) 57 | (fp_line (start 0.3937 -18.1737) (end -0.508 -18.1737) (layer F.Fab) (width 0.1524)) 58 | (fp_line (start 0.3937 -17.3863) (end 0.3937 -18.1737) (layer F.Fab) (width 0.1524)) 59 | (fp_line (start -0.508 -17.3863) (end 0.3937 -17.3863) (layer F.Fab) (width 0.1524)) 60 | (fp_line (start -0.508 -18.1737) (end -0.508 -17.3863) (layer F.Fab) (width 0.1524)) 61 | (fp_line (start 0.3937 -15.6337) (end -0.508 -15.6337) (layer F.Fab) (width 0.1524)) 62 | (fp_line (start 0.3937 -14.8463) (end 0.3937 -15.6337) (layer F.Fab) (width 0.1524)) 63 | (fp_line (start -0.508 -14.8463) (end 0.3937 -14.8463) (layer F.Fab) (width 0.1524)) 64 | (fp_line (start -0.508 -15.6337) (end -0.508 -14.8463) (layer F.Fab) (width 0.1524)) 65 | (fp_line (start 0.3937 -13.0937) (end -0.508 -13.0937) (layer F.Fab) (width 0.1524)) 66 | (fp_line (start 0.3937 -12.3063) (end 0.3937 -13.0937) (layer F.Fab) (width 0.1524)) 67 | (fp_line (start -0.508 -12.3063) (end 0.3937 -12.3063) (layer F.Fab) (width 0.1524)) 68 | (fp_line (start -0.508 -13.0937) (end -0.508 -12.3063) (layer F.Fab) (width 0.1524)) 69 | (fp_line (start 0.3937 -10.5537) (end -0.508 -10.5537) (layer F.Fab) (width 0.1524)) 70 | (fp_line (start 0.3937 -9.7663) (end 0.3937 -10.5537) (layer F.Fab) (width 0.1524)) 71 | (fp_line (start -0.508 -9.7663) (end 0.3937 -9.7663) (layer F.Fab) (width 0.1524)) 72 | (fp_line (start -0.508 -10.5537) (end -0.508 -9.7663) (layer F.Fab) (width 0.1524)) 73 | (fp_line (start 0.3937 -8.0137) (end -0.508 -8.0137) (layer F.Fab) (width 0.1524)) 74 | (fp_line (start 0.3937 -7.2263) (end 0.3937 -8.0137) (layer F.Fab) (width 0.1524)) 75 | (fp_line (start -0.508 -7.2263) (end 0.3937 -7.2263) (layer F.Fab) (width 0.1524)) 76 | (fp_line (start -0.508 -8.0137) (end -0.508 -7.2263) (layer F.Fab) (width 0.1524)) 77 | (fp_line (start 0.3937 -5.4737) (end -0.508 -5.4737) (layer F.Fab) (width 0.1524)) 78 | (fp_line (start 0.3937 -4.6863) (end 0.3937 -5.4737) (layer F.Fab) (width 0.1524)) 79 | (fp_line (start -0.508 -4.6863) (end 0.3937 -4.6863) (layer F.Fab) (width 0.1524)) 80 | (fp_line (start -0.508 -5.4737) (end -0.508 -4.6863) (layer F.Fab) (width 0.1524)) 81 | (fp_line (start 0.3937 -2.9337) (end -0.508 -2.9337) (layer F.Fab) (width 0.1524)) 82 | (fp_line (start 0.3937 -2.1463) (end 0.3937 -2.9337) (layer F.Fab) (width 0.1524)) 83 | (fp_line (start -0.508 -2.1463) (end 0.3937 -2.1463) (layer F.Fab) (width 0.1524)) 84 | (fp_line (start -0.508 -2.9337) (end -0.508 -2.1463) (layer F.Fab) (width 0.1524)) 85 | (fp_line (start 0.3937 -0.3937) (end -0.508 -0.3937) (layer F.Fab) (width 0.1524)) 86 | (fp_line (start 0.3937 0.3937) (end 0.3937 -0.3937) (layer F.Fab) (width 0.1524)) 87 | (fp_line (start -0.508 0.3937) (end 0.3937 0.3937) (layer F.Fab) (width 0.1524)) 88 | (fp_line (start -0.508 -0.3937) (end -0.508 0.3937) (layer F.Fab) (width 0.1524)) 89 | (fp_line (start -8.0137 0.3937) (end -7.112 0.3937) (layer F.Fab) (width 0.1524)) 90 | (fp_line (start -8.0137 -0.3937) (end -8.0137 0.3937) (layer F.Fab) (width 0.1524)) 91 | (fp_line (start -7.112 -0.3937) (end -8.0137 -0.3937) (layer F.Fab) (width 0.1524)) 92 | (fp_line (start -7.112 0.3937) (end -7.112 -0.3937) (layer F.Fab) (width 0.1524)) 93 | (fp_line (start -8.0137 -2.1463) (end -7.112 -2.1463) (layer F.Fab) (width 0.1524)) 94 | (fp_line (start -8.0137 -2.9337) (end -8.0137 -2.1463) (layer F.Fab) (width 0.1524)) 95 | (fp_line (start -7.112 -2.9337) (end -8.0137 -2.9337) (layer F.Fab) (width 0.1524)) 96 | (fp_line (start -7.112 -2.1463) (end -7.112 -2.9337) (layer F.Fab) (width 0.1524)) 97 | (fp_line (start -8.0137 -4.6863) (end -7.112 -4.6863) (layer F.Fab) (width 0.1524)) 98 | (fp_line (start -8.0137 -5.4737) (end -8.0137 -4.6863) (layer F.Fab) (width 0.1524)) 99 | (fp_line (start -7.112 -5.4737) (end -8.0137 -5.4737) (layer F.Fab) (width 0.1524)) 100 | (fp_line (start -7.112 -4.6863) (end -7.112 -5.4737) (layer F.Fab) (width 0.1524)) 101 | (fp_line (start -8.0137 -7.2263) (end -7.112 -7.2263) (layer F.Fab) (width 0.1524)) 102 | (fp_line (start -8.0137 -8.0137) (end -8.0137 -7.2263) (layer F.Fab) (width 0.1524)) 103 | (fp_line (start -7.112 -8.0137) (end -8.0137 -8.0137) (layer F.Fab) (width 0.1524)) 104 | (fp_line (start -7.112 -7.2263) (end -7.112 -8.0137) (layer F.Fab) (width 0.1524)) 105 | (fp_line (start -8.0137 -9.7663) (end -7.112 -9.7663) (layer F.Fab) (width 0.1524)) 106 | (fp_line (start -8.0137 -10.5537) (end -8.0137 -9.7663) (layer F.Fab) (width 0.1524)) 107 | (fp_line (start -7.112 -10.5537) (end -8.0137 -10.5537) (layer F.Fab) (width 0.1524)) 108 | (fp_line (start -7.112 -9.7663) (end -7.112 -10.5537) (layer F.Fab) (width 0.1524)) 109 | (fp_line (start -8.0137 -12.3063) (end -7.112 -12.3063) (layer F.Fab) (width 0.1524)) 110 | (fp_line (start -8.0137 -13.0937) (end -8.0137 -12.3063) (layer F.Fab) (width 0.1524)) 111 | (fp_line (start -7.112 -13.0937) (end -8.0137 -13.0937) (layer F.Fab) (width 0.1524)) 112 | (fp_line (start -7.112 -12.3063) (end -7.112 -13.0937) (layer F.Fab) (width 0.1524)) 113 | (fp_line (start -8.0137 -14.8463) (end -7.112 -14.8463) (layer F.Fab) (width 0.1524)) 114 | (fp_line (start -8.0137 -15.6337) (end -8.0137 -14.8463) (layer F.Fab) (width 0.1524)) 115 | (fp_line (start -7.112 -15.6337) (end -8.0137 -15.6337) (layer F.Fab) (width 0.1524)) 116 | (fp_line (start -7.112 -14.8463) (end -7.112 -15.6337) (layer F.Fab) (width 0.1524)) 117 | (fp_line (start -8.0137 -17.3863) (end -7.112 -17.3863) (layer F.Fab) (width 0.1524)) 118 | (fp_line (start -8.0137 -18.1737) (end -8.0137 -17.3863) (layer F.Fab) (width 0.1524)) 119 | (fp_line (start -7.112 -18.1737) (end -8.0137 -18.1737) (layer F.Fab) (width 0.1524)) 120 | (fp_line (start -7.112 -17.3863) (end -7.112 -18.1737) (layer F.Fab) (width 0.1524)) 121 | (fp_line (start -8.0137 -19.9263) (end -7.112 -19.9263) (layer F.Fab) (width 0.1524)) 122 | (fp_line (start -8.0137 -20.7137) (end -8.0137 -19.9263) (layer F.Fab) (width 0.1524)) 123 | (fp_line (start -7.112 -20.7137) (end -8.0137 -20.7137) (layer F.Fab) (width 0.1524)) 124 | (fp_line (start -7.112 -19.9263) (end -7.112 -20.7137) (layer F.Fab) (width 0.1524)) 125 | (fp_line (start -8.0137 -22.4663) (end -7.112 -22.4663) (layer F.Fab) (width 0.1524)) 126 | (fp_line (start -8.0137 -23.2537) (end -8.0137 -22.4663) (layer F.Fab) (width 0.1524)) 127 | (fp_line (start -7.112 -23.2537) (end -8.0137 -23.2537) (layer F.Fab) (width 0.1524)) 128 | (fp_line (start -7.112 -22.4663) (end -7.112 -23.2537) (layer F.Fab) (width 0.1524)) 129 | (fp_text user * (at -7.62 -24.2697) (layer F.SilkS) 130 | (effects (font (size 1 1) (thickness 0.15))) 131 | ) 132 | (fp_text user * (at -6.858 -22.86) (layer F.Fab) 133 | (effects (font (size 1 1) (thickness 0.15))) 134 | ) 135 | (fp_text user 0.051in/1.295mm (at -7.62 4.445) (layer Dwgs.User) 136 | (effects (font (size 1 1) (thickness 0.15))) 137 | ) 138 | (fp_text user 0.3in/7.62mm (at -3.81 -27.305) (layer Dwgs.User) 139 | (effects (font (size 1 1) (thickness 0.15))) 140 | ) 141 | (fp_text user 0.051in/1.295mm (at 3.048 -22.86) (layer Dwgs.User) 142 | (effects (font (size 1 1) (thickness 0.15))) 143 | ) 144 | (fp_text user 0.1in/2.54mm (at -10.668 -21.59) (layer Dwgs.User) 145 | (effects (font (size 1 1) (thickness 0.15))) 146 | ) 147 | (fp_text user * (at -6.858 -22.86) (layer F.Fab) 148 | (effects (font (size 1 1) (thickness 0.15))) 149 | ) 150 | (fp_text user * (at -7.62 -24.2697) (layer F.SilkS) 151 | (effects (font (size 1 1) (thickness 0.15))) 152 | ) 153 | (fp_text user "Copyright 2016 Accelerated Designs. All rights reserved." (at 0 0) (layer Cmts.User) 154 | (effects (font (size 0.127 0.127) (thickness 0.002))) 155 | ) 156 | (pad 20 thru_hole circle (at 0 -22.86) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 157 | (pad 19 thru_hole circle (at 0 -20.32) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 158 | (pad 18 thru_hole circle (at 0 -17.78) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 159 | (pad 17 thru_hole circle (at 0 -15.24) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 160 | (pad 16 thru_hole circle (at 0 -12.7) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 161 | (pad 15 thru_hole circle (at 0 -10.16) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 162 | (pad 14 thru_hole circle (at 0 -7.62) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 163 | (pad 13 thru_hole circle (at 0 -5.08) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 164 | (pad 12 thru_hole circle (at 0 -2.54) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 165 | (pad 11 thru_hole circle (at 0 0) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 166 | (pad 10 thru_hole circle (at -7.62 0) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 167 | (pad 9 thru_hole circle (at -7.62 -2.54) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 168 | (pad 8 thru_hole circle (at -7.62 -5.08) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 169 | (pad 7 thru_hole circle (at -7.62 -7.62) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 170 | (pad 6 thru_hole circle (at -7.62 -10.16) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 171 | (pad 5 thru_hole circle (at -7.62 -12.7) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 172 | (pad 4 thru_hole circle (at -7.62 -15.24) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 173 | (pad 3 thru_hole circle (at -7.62 -17.78) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 174 | (pad 2 thru_hole circle (at -7.62 -20.32) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 175 | (pad 1 thru_hole rect (at -7.62 -22.86) (size 1.2954 1.2954) (drill 0.7874) (layers *.Cu *.Mask)) 176 | ) 177 | -------------------------------------------------------------------------------- /kicad/branchController.pretty/WIZ850io.kicad_mod: -------------------------------------------------------------------------------- 1 | (module WIZ850io (layer F.Cu) (tedit 0) 2 | (descr WIZ850io-7) 3 | (tags "Integrated Circuit") 4 | (fp_text reference IC** (at 10.16 6.1) (layer F.SilkS) 5 | (effects (font (size 1.27 1.27) (thickness 0.254))) 6 | ) 7 | (fp_text value WIZ850io (at 10.16 6.1) (layer F.SilkS) hide 8 | (effects (font (size 1.27 1.27) (thickness 0.254))) 9 | ) 10 | (fp_line (start -2.34 19.6) (end -2.34 -7.4) (layer F.CrtYd) (width 0.1)) 11 | (fp_line (start 22.66 19.6) (end -2.34 19.6) (layer F.CrtYd) (width 0.1)) 12 | (fp_line (start 22.66 -7.4) (end 22.66 19.6) (layer F.CrtYd) (width 0.1)) 13 | (fp_line (start -2.34 -7.4) (end 22.66 -7.4) (layer F.CrtYd) (width 0.1)) 14 | (fp_line (start -1.34 18.6) (end -1.34 -6.4) (layer F.SilkS) (width 0.1)) 15 | (fp_line (start 21.66 18.6) (end -1.34 18.6) (layer F.SilkS) (width 0.1)) 16 | (fp_line (start 21.66 -6.4) (end 21.66 18.6) (layer F.SilkS) (width 0.1)) 17 | (fp_line (start -1.34 -6.4) (end 21.66 -6.4) (layer F.SilkS) (width 0.1)) 18 | (fp_line (start -1.34 18.6) (end -1.34 -6.4) (layer F.Fab) (width 0.2)) 19 | (fp_line (start 21.66 18.6) (end -1.34 18.6) (layer F.Fab) (width 0.2)) 20 | (fp_line (start 21.66 -6.4) (end 21.66 18.6) (layer F.Fab) (width 0.2)) 21 | (fp_line (start -1.34 -6.4) (end 21.66 -6.4) (layer F.Fab) (width 0.2)) 22 | (fp_text user %R (at 10.16 6.1) (layer F.Fab) 23 | (effects (font (size 1.27 1.27) (thickness 0.254))) 24 | ) 25 | (pad 12 thru_hole circle (at 20.32 12.7) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 26 | (pad 11 thru_hole circle (at 20.32 10.16) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 27 | (pad 10 thru_hole circle (at 20.32 7.62) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 28 | (pad 9 thru_hole circle (at 20.32 5.08) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 29 | (pad 8 thru_hole circle (at 20.32 2.54) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 30 | (pad 7 thru_hole rect (at 20.32 0) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 31 | (pad 6 thru_hole circle (at 0 12.7) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 32 | (pad 5 thru_hole circle (at 0 10.16) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 33 | (pad 4 thru_hole circle (at 0 7.62) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 34 | (pad 3 thru_hole circle (at 0 5.08) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 35 | (pad 2 thru_hole circle (at 0 2.54) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 36 | (pad 1 thru_hole rect (at 0 0) (size 1.665 1.665) (drill 1.11) (layers *.Cu *.Mask)) 37 | (model WIZ850io.stp 38 | (at (xyz 0 0 0)) 39 | (scale (xyz 1 1 1)) 40 | (rotate (xyz 0 0 0)) 41 | ) 42 | ) 43 | -------------------------------------------------------------------------------- /kicad/branchControllerPCB-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # 74xx_74HC245 5 | # 6 | DEF 74xx_74HC245 U 0 40 Y Y 1 L N 7 | F0 "U" -300 650 50 H V C CNN 8 | F1 "74xx_74HC245" -300 -650 50 H V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | ALIAS 74HC245 12 | $FPLIST 13 | DIP?20* 14 | $ENDFPLIST 15 | DRAW 16 | S -300 600 300 -600 1 1 10 f 17 | P 3 1 0 0 -25 -50 -25 50 25 50 N 18 | P 4 1 0 0 -50 -50 25 -50 25 50 50 50 N 19 | X A->B 1 -500 -400 200 R 50 50 1 0 I 20 | X GND 10 0 -800 200 U 50 50 1 0 W 21 | X B7 11 500 -200 200 L 50 50 1 0 T 22 | X B6 12 500 -100 200 L 50 50 1 0 T 23 | X B5 13 500 0 200 L 50 50 1 0 T 24 | X B4 14 500 100 200 L 50 50 1 0 T 25 | X B3 15 500 200 200 L 50 50 1 0 T 26 | X B2 16 500 300 200 L 50 50 1 0 T 27 | X B1 17 500 400 200 L 50 50 1 0 T 28 | X B0 18 500 500 200 L 50 50 1 0 T 29 | X CE 19 -500 -500 200 R 50 50 1 0 I I 30 | X A0 2 -500 500 200 R 50 50 1 0 T 31 | X VCC 20 0 800 200 D 50 50 1 0 W 32 | X A1 3 -500 400 200 R 50 50 1 0 T 33 | X A2 4 -500 300 200 R 50 50 1 0 T 34 | X A3 5 -500 200 200 R 50 50 1 0 T 35 | X A4 6 -500 100 200 R 50 50 1 0 T 36 | X A5 7 -500 0 200 R 50 50 1 0 T 37 | X A6 8 -500 -100 200 R 50 50 1 0 T 38 | X A7 9 -500 -200 200 R 50 50 1 0 T 39 | ENDDRAW 40 | ENDDEF 41 | # 42 | # Connector_RJ45 43 | # 44 | DEF Connector_RJ45 J 0 40 Y Y 1 F N 45 | F0 "J" -200 550 50 H V R CNN 46 | F1 "Connector_RJ45" 100 550 50 H V L CNN 47 | F2 "" 0 25 50 V I C CNN 48 | F3 "" 0 25 50 V I C CNN 49 | ALIAS RJ31 RJ32 RJ33 RJ34 RJ35 RJ41 RJ45 RJ49 RJ61 50 | $FPLIST 51 | 8P8C* 52 | RJ31* 53 | RJ32* 54 | RJ33* 55 | RJ34* 56 | RJ35* 57 | RJ41* 58 | RJ45* 59 | RJ49* 60 | RJ61* 61 | $ENDFPLIST 62 | DRAW 63 | S 300 500 -300 -400 0 1 10 f 64 | P 2 0 1 0 -200 175 -250 175 N 65 | P 2 0 1 0 -200 225 -250 225 N 66 | P 3 0 1 0 -250 -125 -200 -125 -200 -125 N 67 | P 3 0 1 0 -250 -75 -200 -75 -200 -75 N 68 | P 3 0 1 0 -250 -25 -200 -25 -200 -25 N 69 | P 3 0 1 0 -250 25 -200 25 -200 25 N 70 | P 3 0 1 0 -250 75 -200 75 -200 75 N 71 | P 3 0 1 0 -200 125 -250 125 -250 125 N 72 | P 14 0 1 0 -250 -175 -250 275 150 275 150 175 200 175 200 125 250 125 250 -25 200 -25 200 -75 150 -75 150 -175 -250 -175 -250 -175 N 73 | X ~ 1 400 -300 100 L 50 50 1 1 P 74 | X ~ 2 400 -200 100 L 50 50 1 1 P 75 | X ~ 3 400 -100 100 L 50 50 1 1 P 76 | X ~ 4 400 0 100 L 50 50 1 1 P 77 | X ~ 5 400 100 100 L 50 50 1 1 P 78 | X ~ 6 400 200 100 L 50 50 1 1 P 79 | X ~ 7 400 300 100 L 50 50 1 1 P 80 | X ~ 8 400 400 100 L 50 50 1 1 P 81 | ENDDRAW 82 | ENDDEF 83 | # 84 | # Device_LED 85 | # 86 | DEF Device_LED D 0 40 N N 1 F N 87 | F0 "D" 0 100 50 H V C CNN 88 | F1 "Device_LED" 0 -100 50 H V C CNN 89 | F2 "" 0 0 50 H I C CNN 90 | F3 "" 0 0 50 H I C CNN 91 | $FPLIST 92 | LED* 93 | LED_SMD:* 94 | LED_THT:* 95 | $ENDFPLIST 96 | DRAW 97 | P 2 0 1 8 -50 -50 -50 50 N 98 | P 2 0 1 0 -50 0 50 0 N 99 | P 4 0 1 8 50 -50 50 50 -50 0 50 -50 N 100 | P 5 0 1 0 -120 -30 -180 -90 -150 -90 -180 -90 -180 -60 N 101 | P 5 0 1 0 -70 -30 -130 -90 -100 -90 -130 -90 -130 -60 N 102 | X K 1 -150 0 100 R 50 50 1 1 P 103 | X A 2 150 0 100 L 50 50 1 1 P 104 | ENDDRAW 105 | ENDDEF 106 | # 107 | # Device_R_Pack08 108 | # 109 | DEF Device_R_Pack08 RN 0 0 Y N 1 F N 110 | F0 "RN" -500 0 50 V V C CNN 111 | F1 "Device_R_Pack08" 400 0 50 V V C CNN 112 | F2 "" 475 0 50 V I C CNN 113 | F3 "" 0 0 50 H I C CNN 114 | $FPLIST 115 | DIP* 116 | SOIC* 117 | $ENDFPLIST 118 | DRAW 119 | S -450 -95 350 95 0 1 10 f 120 | S -425 75 -375 -75 0 1 10 N 121 | S -325 75 -275 -75 0 1 10 N 122 | S -225 75 -175 -75 0 1 10 N 123 | S -125 75 -75 -75 0 1 10 N 124 | S -25 75 25 -75 0 1 10 N 125 | S 75 75 125 -75 0 1 10 N 126 | S 175 75 225 -75 0 1 10 N 127 | S 275 75 325 -75 0 1 10 N 128 | P 2 0 1 0 -400 -100 -400 -75 N 129 | P 2 0 1 0 -400 75 -400 100 N 130 | P 2 0 1 0 -300 -100 -300 -75 N 131 | P 2 0 1 0 -300 75 -300 100 N 132 | P 2 0 1 0 -200 -100 -200 -75 N 133 | P 2 0 1 0 -200 75 -200 100 N 134 | P 2 0 1 0 -100 -100 -100 -75 N 135 | P 2 0 1 0 -100 75 -100 100 N 136 | P 2 0 1 0 0 -100 0 -75 N 137 | P 2 0 1 0 0 75 0 100 N 138 | P 2 0 1 0 100 -100 100 -75 N 139 | P 2 0 1 0 100 75 100 100 N 140 | P 2 0 1 0 200 -100 200 -75 N 141 | P 2 0 1 0 200 75 200 100 N 142 | P 2 0 1 0 300 -100 300 -75 N 143 | P 2 0 1 0 300 75 300 100 N 144 | X R1.1 1 -400 -200 100 U 50 50 1 1 P 145 | X R7.2 10 200 200 100 D 50 50 1 1 P 146 | X R6.2 11 100 200 100 D 50 50 1 1 P 147 | X R5.2 12 0 200 100 D 50 50 1 1 P 148 | X R4.2 13 -100 200 100 D 50 50 1 1 P 149 | X R3.2 14 -200 200 100 D 50 50 1 1 P 150 | X R2.2 15 -300 200 100 D 50 50 1 1 P 151 | X R1.2 16 -400 200 100 D 50 50 1 1 P 152 | X R2.1 2 -300 -200 100 U 50 50 1 1 P 153 | X R3.1 3 -200 -200 100 U 50 50 1 1 P 154 | X R4.1 4 -100 -200 100 U 50 50 1 1 P 155 | X R5.1 5 0 -200 100 U 50 50 1 1 P 156 | X R6.1 6 100 -200 100 U 50 50 1 1 P 157 | X R7.1 7 200 -200 100 U 50 50 1 1 P 158 | X R8.1 8 300 -200 100 U 50 50 1 1 P 159 | X R8.2 9 300 200 100 D 50 50 1 1 P 160 | ENDDRAW 161 | ENDDEF 162 | # 163 | # Device_R_US 164 | # 165 | DEF Device_R_US R 0 0 N Y 1 F N 166 | F0 "R" 100 0 50 V V C CNN 167 | F1 "Device_R_US" -100 0 50 V V C CNN 168 | F2 "" 40 -10 50 V I C CNN 169 | F3 "" 0 0 50 H I C CNN 170 | $FPLIST 171 | R_* 172 | $ENDFPLIST 173 | DRAW 174 | P 2 0 1 0 0 -90 0 -100 N 175 | P 2 0 1 0 0 90 0 100 N 176 | P 5 0 1 0 0 -30 40 -45 0 -60 -40 -75 0 -90 N 177 | P 5 0 1 0 0 30 40 15 0 0 -40 -15 0 -30 N 178 | P 5 0 1 0 0 90 40 75 0 60 -40 45 0 30 N 179 | X ~ 1 0 150 50 D 50 50 1 1 P 180 | X ~ 2 0 -150 50 U 50 50 1 1 P 181 | ENDDRAW 182 | ENDDEF 183 | # 184 | # Interface_Optical_TSOP343xx 185 | # 186 | DEF Interface_Optical_TSOP343xx U 0 40 Y Y 1 F N 187 | F0 "U" -400 300 50 H V L CNN 188 | F1 "Interface_Optical_TSOP343xx" -400 -300 50 H V L CNN 189 | F2 "OptoDevice:Vishay_MOLD-3Pin" -50 -375 50 H I C CNN 190 | F3 "" 650 300 50 H I C CNN 191 | ALIAS TSDP343xx TSOP341xx TSOP343xx TSOP345xx TSOP41xx TSOP43xx TSOP45xx TSOP348xx 192 | $FPLIST 193 | Vishay*MOLD* 194 | $ENDFPLIST 195 | DRAW 196 | A -360 -7 77 1260 -1255 0 0 10 f -405 55 -405 -70 197 | T 900 -125 10 60 0 0 0 DEMOD Normal 0 C C 198 | S -240 220 5 -220 0 1 0 N 199 | S 100 50 50 175 0 1 0 N 200 | S 300 250 -400 -250 0 1 10 f 201 | P 2 0 0 0 75 -200 5 -200 N 202 | P 2 0 0 0 75 200 5 200 N 203 | P 2 0 1 0 -345 15 -380 50 N 204 | P 2 0 1 0 -345 15 -365 15 N 205 | P 2 0 1 0 -345 15 -345 35 N 206 | P 2 0 1 0 -340 -25 -375 10 N 207 | P 2 0 1 0 -340 -25 -360 -25 N 208 | P 2 0 1 0 -340 -25 -340 -5 N 209 | P 2 0 1 0 -330 -40 -265 -40 N 210 | P 2 0 1 0 50 -115 5 -115 N 211 | P 2 0 1 0 50 -75 50 -150 N 212 | P 2 0 1 0 55 -140 60 -140 N 213 | P 2 0 1 0 65 -140 60 -140 N 214 | P 2 0 1 0 65 -140 65 -130 N 215 | P 2 0 1 0 75 0 75 50 N 216 | P 3 0 1 0 75 175 75 200 100 200 N 217 | P 4 0 1 0 -330 25 -265 25 -300 -40 -330 25 F 218 | P 4 0 1 0 -240 55 -300 55 -300 -70 -240 -70 N 219 | P 4 0 1 0 50 -125 75 -150 75 -200 100 -200 N 220 | P 4 0 1 0 50 -100 75 -75 75 0 100 0 N 221 | X OUT 1 400 0 100 L 50 50 1 1 O 222 | X GND 2 400 -200 100 L 50 50 1 1 W 223 | X Vs 3 400 200 100 L 50 50 1 1 W 224 | ENDDRAW 225 | ENDDEF 226 | # 227 | # branchController_Adafruit_4400_OLED 228 | # 229 | DEF branchController_Adafruit_4400_OLED J 0 40 Y N 1 F N 230 | F0 "J" 0 300 50 H V C CNN 231 | F1 "branchController_Adafruit_4400_OLED" 0 -400 50 H V C CNN 232 | F2 "" 0 0 50 H I C CNN 233 | F3 "" 0 0 50 H I C CNN 234 | $FPLIST 235 | Connector*:*_1x??_* 236 | $ENDFPLIST 237 | DRAW 238 | S -50 -295 0 -305 1 1 6 N 239 | S -50 -195 0 -205 1 1 6 N 240 | S -50 -95 0 -105 1 1 6 N 241 | S -50 5 0 -5 1 1 6 N 242 | S -50 105 0 95 1 1 6 N 243 | S -50 205 0 195 1 1 6 N 244 | S -50 250 50 -350 1 1 10 f 245 | X 5 3VO -200 -200 150 R 50 50 1 1 N 246 | X 4 GND -200 -100 150 R 50 50 1 1 W 247 | X 3 RESET -200 0 150 R 50 50 1 1 N 248 | X 2 SCL -200 100 150 R 50 50 1 1 I 249 | X 1 SDA -200 200 150 R 50 50 1 1 I 250 | X 6 VIN -200 -300 150 R 50 50 1 1 W 251 | ENDDRAW 252 | ENDDEF 253 | # 254 | # branchController_WIZ850io 255 | # 256 | DEF branchController_WIZ850io IC 0 30 Y Y 1 F N 257 | F0 "IC" 1150 300 50 H V L CNN 258 | F1 "branchController_WIZ850io" 1150 200 50 H V L CNN 259 | F2 "WIZ850io" 1150 100 50 H I L CNN 260 | F3 "http://wizwiki.net/wiki/doku.php?id=products:wiz850io:start#hardware_specification" 1150 0 50 H I L CNN 261 | F4 "Networking Modules W5500 + MAG Jack ioPlatform Mod" 1150 -100 50 H I L CNN "Description" 262 | F5 "12" 1150 -200 50 H I L CNN "Height" 263 | F6 "950-WIZ850IO" 1150 -300 50 H I L CNN "Mouser Part Number" 264 | F7 "https://www.mouser.com/Search/Refine.aspx?Keyword=950-WIZ850IO" 1150 -400 50 H I L CNN "Mouser Price/Stock" 265 | F8 "WIZnet Inc" 1150 -500 50 H I L CNN "Manufacturer_Name" 266 | F9 "WIZ850io" 1150 -600 50 H I L CNN "Manufacturer_Part_Number" 267 | DRAW 268 | P 5 0 1 6 200 100 1100 100 1100 -600 200 -600 200 100 N 269 | X GND_1 1 0 0 200 R 50 50 0 0 U 270 | X NC 10 1300 -300 200 L 50 50 0 0 N 271 | X RSTN 11 1300 -400 200 L 50 50 0 0 U 272 | X MISO 12 1300 -500 200 L 50 50 0 0 U 273 | X GND_2 2 0 -100 200 R 50 50 0 0 U 274 | X MOSI 3 0 -200 200 R 50 50 0 0 U 275 | X SCLK 4 0 -300 200 R 50 50 0 0 U 276 | X SCNN 5 0 -400 200 R 50 50 0 0 U 277 | X INTN 6 0 -500 200 R 50 50 0 0 U 278 | X GND_3 7 1300 0 200 L 50 50 0 0 U 279 | X 3.3V_1 8 1300 -100 200 L 50 50 0 0 U 280 | X 3.3V_2 9 1300 -200 200 L 50 50 0 0 U 281 | ENDDRAW 282 | ENDDEF 283 | # 284 | # power_+3.3V 285 | # 286 | DEF power_+3.3V #PWR 0 0 Y Y 1 F P 287 | F0 "#PWR" 0 -150 50 H I C CNN 288 | F1 "power_+3.3V" 0 140 50 H V C CNN 289 | F2 "" 0 0 50 H I C CNN 290 | F3 "" 0 0 50 H I C CNN 291 | ALIAS +3.3V 292 | DRAW 293 | P 2 0 1 0 -30 50 0 100 N 294 | P 2 0 1 0 0 0 0 100 N 295 | P 2 0 1 0 0 100 30 50 N 296 | X +3V3 1 0 0 0 U 50 50 1 1 W N 297 | ENDDRAW 298 | ENDDEF 299 | # 300 | # power_+5V 301 | # 302 | DEF power_+5V #PWR 0 0 Y Y 1 F P 303 | F0 "#PWR" 0 -150 50 H I C CNN 304 | F1 "power_+5V" 0 140 50 H V C CNN 305 | F2 "" 0 0 50 H I C CNN 306 | F3 "" 0 0 50 H I C CNN 307 | DRAW 308 | P 2 0 1 0 -30 50 0 100 N 309 | P 2 0 1 0 0 0 0 100 N 310 | P 2 0 1 0 0 100 30 50 N 311 | X +5V 1 0 0 0 U 50 50 1 1 W N 312 | ENDDRAW 313 | ENDDEF 314 | # 315 | # power_GND 316 | # 317 | DEF power_GND #PWR 0 0 Y Y 1 F P 318 | F0 "#PWR" 0 -250 50 H I C CNN 319 | F1 "power_GND" 0 -150 50 H V C CNN 320 | F2 "" 0 0 50 H I C CNN 321 | F3 "" 0 0 50 H I C CNN 322 | DRAW 323 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 324 | X GND 1 0 0 0 D 50 50 1 1 W N 325 | ENDDRAW 326 | ENDDEF 327 | # 328 | # teensy_Teensy3.2 329 | # 330 | DEF teensy_Teensy3.2 U 0 40 Y Y 1 F N 331 | F0 "U" 0 1550 60 H V C CNN 332 | F1 "teensy_Teensy3.2" 0 -1550 60 H V C CNN 333 | F2 "" 0 -750 60 H V C CNN 334 | F3 "" 0 -750 60 H V C CNN 335 | DRAW 336 | T 0 350 -950 50 0 0 0 "3.6V to 6.0V" Normal 0 C C 337 | T 0 300 -1150 50 0 0 0 "max 250mA" Normal 0 C C 338 | S -800 -1450 800 1450 0 1 0 N 339 | X GND 1 -1000 1350 200 R 50 50 1 1 W 340 | X 8_TX3_DIN 10 -1000 450 200 R 50 50 1 1 B 341 | X 9_RX2_CS_PWM 11 -1000 350 200 R 50 50 1 1 B 342 | X 10_TX2_CS_PWM 12 -1000 250 200 R 50 50 1 1 B 343 | X 11_DOUT 13 -1000 150 200 R 50 50 1 1 B 344 | X 12_DIN 14 -1000 50 200 R 50 50 1 1 B 345 | X VBat 15 -1000 -50 200 R 50 50 1 1 W 346 | X 3.3V 16 -1000 -150 200 R 50 50 1 1 w 347 | X GND 17 -1000 -250 200 R 50 50 1 1 W 348 | X Program 18 -1000 -350 200 R 50 50 1 1 I 349 | X A14/DAC 19 -1000 -450 200 R 50 50 1 1 B 350 | X 0_RX1_Touch 2 -1000 1250 200 R 50 50 1 1 B 351 | X 13_LED_SCK 20 -1000 -550 200 R 50 50 1 1 B 352 | X 14_A0_SCK 21 -1000 -650 200 R 50 50 1 1 B 353 | X 15_A1_CS_Touch 22 -1000 -750 200 R 50 50 1 1 B 354 | X 16_A2_SCL0_Touch 23 -1000 -850 200 R 50 50 1 1 B 355 | X 17_A3_SDA0_Touch 24 -1000 -950 200 R 50 50 1 1 B 356 | X 18_A4_SDA0_Touch 25 -1000 -1050 200 R 50 50 1 1 B 357 | X 19_A5_SCL0_Touch 26 -1000 -1150 200 R 50 50 1 1 B 358 | X 20_A6_CS_PWM 27 -1000 -1250 200 R 50 50 1 1 B 359 | X 21_A7_RX1_CS_PWM 28 -1000 -1350 200 R 50 50 1 1 B 360 | X 22_A8_Touch_PWM 29 1000 -1350 200 L 50 50 1 1 B 361 | X 1_TX1_Touch 3 -1000 1150 200 R 50 50 1 1 B 362 | X 23_A9_Touch_PWM 30 1000 -1250 200 L 50 50 1 1 B 363 | X 3.3V 31 1000 -1150 200 L 50 50 1 1 w 364 | X AGND 32 1000 -1050 200 L 50 50 1 1 w 365 | X Vin 33 1000 -950 200 L 50 50 1 1 W 366 | X VUSB 34 1000 -850 200 L 50 50 1 1 W 367 | X AREF 35 1000 -750 200 L 50 50 1 1 I 368 | X A10 36 1000 -650 200 L 50 50 1 1 B 369 | X A11 37 1000 -550 200 L 50 50 1 1 B 370 | X 2 4 -1000 1050 200 R 50 50 1 1 B 371 | X 3_TX_PWM 5 -1000 950 200 R 50 50 1 1 B 372 | X 4_RX_PWM 6 -1000 850 200 R 50 50 1 1 B 373 | X 5_TX1_PWM 7 -1000 750 200 R 50 50 1 1 B 374 | X 6_PWM 8 -1000 650 200 R 50 50 1 1 B 375 | X 7_RX3_DOUT 9 -1000 550 200 R 50 50 1 1 B 376 | X 24 ~ 1000 -50 200 L 50 50 1 1 B 377 | X 25_Touch_PWM ~ 1000 50 200 L 50 50 1 1 B 378 | X 26_A15_RX2 ~ 1000 150 200 L 50 50 1 1 B 379 | X 27_A16 ~ 1000 250 200 L 50 50 1 1 B 380 | X 28_A17 ~ 1000 350 200 L 50 50 1 1 B 381 | X 29_A18_SCL1 ~ 1000 450 200 L 50 50 1 1 B 382 | X 3.3V ~ 1000 950 200 L 50 50 1 1 w 383 | X 30_A19_SDA1 ~ 1000 550 200 L 50 50 1 1 B 384 | X 31_A20_TX2 ~ 1000 650 200 L 50 50 1 1 B 385 | X 32_Touch_PWM ~ 1000 750 200 L 50 50 1 1 B 386 | X 33_Touch ~ 1000 850 200 L 50 50 1 1 B 387 | X A12 ~ 1000 -250 200 L 50 50 1 1 B 388 | X A13 ~ 1000 1050 200 L 50 50 1 1 B 389 | X D+ ~ 1000 1250 200 L 50 50 1 1 B 390 | X D- ~ 1000 1350 200 L 50 50 1 1 B 391 | X GND ~ 1000 -150 200 L 50 50 1 1 W 392 | X Reset ~ 1000 1150 200 L 50 50 1 1 I 393 | ENDDRAW 394 | ENDDEF 395 | # 396 | #End Library 397 | -------------------------------------------------------------------------------- /kicad/branchControllerPCB.pro: -------------------------------------------------------------------------------- 1 | update=Sunday, December 22, 2019 at 04:13:37 PM 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [schematic_editor] 16 | version=1 17 | PageLayoutDescrFile= 18 | PlotDirectoryName= 19 | SubpartIdSeparator=0 20 | SubpartFirstId=65 21 | NetFmtName=Pcbnew 22 | SpiceAjustPassiveValues=0 23 | LabSize=50 24 | ERC_TestSimilarLabels=1 25 | [pcbnew] 26 | version=1 27 | PageLayoutDescrFile= 28 | LastNetListRead= 29 | CopperLayerCount=4 30 | BoardThickness=1.6 31 | AllowMicroVias=0 32 | AllowBlindVias=0 33 | RequireCourtyardDefinitions=0 34 | ProhibitOverlappingCourtyards=1 35 | MinTrackWidth=0.2 36 | MinViaDiameter=0.4 37 | MinViaDrill=0.3 38 | MinMicroViaDiameter=0.2 39 | MinMicroViaDrill=0.09999999999999999 40 | MinHoleToHole=0.25 41 | TrackWidth1=0.25 42 | ViaDiameter1=0.8 43 | ViaDrill1=0.4 44 | dPairWidth1=0.2 45 | dPairGap1=0.25 46 | dPairViaGap1=0.25 47 | SilkLineWidth=0.12 48 | SilkTextSizeV=1 49 | SilkTextSizeH=1 50 | SilkTextSizeThickness=0.15 51 | SilkTextItalic=0 52 | SilkTextUpright=1 53 | CopperLineWidth=0.2 54 | CopperTextSizeV=1.5 55 | CopperTextSizeH=1.5 56 | CopperTextThickness=0.3 57 | CopperTextItalic=0 58 | CopperTextUpright=1 59 | EdgeCutLineWidth=0.05 60 | CourtyardLineWidth=0.05 61 | OthersLineWidth=0.15 62 | OthersTextSizeV=1 63 | OthersTextSizeH=1 64 | OthersTextSizeThickness=0.15 65 | OthersTextItalic=0 66 | OthersTextUpright=1 67 | SolderMaskClearance=0.051 68 | SolderMaskMinWidth=0.25 69 | SolderPasteClearance=0 70 | SolderPasteRatio=-0 71 | [pcbnew/Layer.F.Cu] 72 | Name=F.Cu 73 | Type=1 74 | Enabled=1 75 | [pcbnew/Layer.In1.Cu] 76 | Name=In1.Cu 77 | Type=0 78 | Enabled=1 79 | [pcbnew/Layer.In2.Cu] 80 | Name=In2.Cu 81 | Type=0 82 | Enabled=1 83 | [pcbnew/Layer.In3.Cu] 84 | Name=In3.Cu 85 | Type=0 86 | Enabled=0 87 | [pcbnew/Layer.In4.Cu] 88 | Name=In4.Cu 89 | Type=0 90 | Enabled=0 91 | [pcbnew/Layer.In5.Cu] 92 | Name=In5.Cu 93 | Type=0 94 | Enabled=0 95 | [pcbnew/Layer.In6.Cu] 96 | Name=In6.Cu 97 | Type=0 98 | Enabled=0 99 | [pcbnew/Layer.In7.Cu] 100 | Name=In7.Cu 101 | Type=0 102 | Enabled=0 103 | [pcbnew/Layer.In8.Cu] 104 | Name=In8.Cu 105 | Type=0 106 | Enabled=0 107 | [pcbnew/Layer.In9.Cu] 108 | Name=In9.Cu 109 | Type=0 110 | Enabled=0 111 | [pcbnew/Layer.In10.Cu] 112 | Name=In10.Cu 113 | Type=0 114 | Enabled=0 115 | [pcbnew/Layer.In11.Cu] 116 | Name=In11.Cu 117 | Type=0 118 | Enabled=0 119 | [pcbnew/Layer.In12.Cu] 120 | Name=In12.Cu 121 | Type=0 122 | Enabled=0 123 | [pcbnew/Layer.In13.Cu] 124 | Name=In13.Cu 125 | Type=0 126 | Enabled=0 127 | [pcbnew/Layer.In14.Cu] 128 | Name=In14.Cu 129 | Type=0 130 | Enabled=0 131 | [pcbnew/Layer.In15.Cu] 132 | Name=In15.Cu 133 | Type=0 134 | Enabled=0 135 | [pcbnew/Layer.In16.Cu] 136 | Name=In16.Cu 137 | Type=0 138 | Enabled=0 139 | [pcbnew/Layer.In17.Cu] 140 | Name=In17.Cu 141 | Type=0 142 | Enabled=0 143 | [pcbnew/Layer.In18.Cu] 144 | Name=In18.Cu 145 | Type=0 146 | Enabled=0 147 | [pcbnew/Layer.In19.Cu] 148 | Name=In19.Cu 149 | Type=0 150 | Enabled=0 151 | [pcbnew/Layer.In20.Cu] 152 | Name=In20.Cu 153 | Type=0 154 | Enabled=0 155 | [pcbnew/Layer.In21.Cu] 156 | Name=In21.Cu 157 | Type=0 158 | Enabled=0 159 | [pcbnew/Layer.In22.Cu] 160 | Name=In22.Cu 161 | Type=0 162 | Enabled=0 163 | [pcbnew/Layer.In23.Cu] 164 | Name=In23.Cu 165 | Type=0 166 | Enabled=0 167 | [pcbnew/Layer.In24.Cu] 168 | Name=In24.Cu 169 | Type=0 170 | Enabled=0 171 | [pcbnew/Layer.In25.Cu] 172 | Name=In25.Cu 173 | Type=0 174 | Enabled=0 175 | [pcbnew/Layer.In26.Cu] 176 | Name=In26.Cu 177 | Type=0 178 | Enabled=0 179 | [pcbnew/Layer.In27.Cu] 180 | Name=In27.Cu 181 | Type=0 182 | Enabled=0 183 | [pcbnew/Layer.In28.Cu] 184 | Name=In28.Cu 185 | Type=0 186 | Enabled=0 187 | [pcbnew/Layer.In29.Cu] 188 | Name=In29.Cu 189 | Type=0 190 | Enabled=0 191 | [pcbnew/Layer.In30.Cu] 192 | Name=In30.Cu 193 | Type=0 194 | Enabled=0 195 | [pcbnew/Layer.B.Cu] 196 | Name=B.Cu 197 | Type=1 198 | Enabled=1 199 | [pcbnew/Layer.B.Adhes] 200 | Enabled=1 201 | [pcbnew/Layer.F.Adhes] 202 | Enabled=1 203 | [pcbnew/Layer.B.Paste] 204 | Enabled=1 205 | [pcbnew/Layer.F.Paste] 206 | Enabled=1 207 | [pcbnew/Layer.B.SilkS] 208 | Enabled=1 209 | [pcbnew/Layer.F.SilkS] 210 | Enabled=1 211 | [pcbnew/Layer.B.Mask] 212 | Enabled=1 213 | [pcbnew/Layer.F.Mask] 214 | Enabled=1 215 | [pcbnew/Layer.Dwgs.User] 216 | Enabled=1 217 | [pcbnew/Layer.Cmts.User] 218 | Enabled=1 219 | [pcbnew/Layer.Eco1.User] 220 | Enabled=1 221 | [pcbnew/Layer.Eco2.User] 222 | Enabled=1 223 | [pcbnew/Layer.Edge.Cuts] 224 | Enabled=1 225 | [pcbnew/Layer.Margin] 226 | Enabled=1 227 | [pcbnew/Layer.B.CrtYd] 228 | Enabled=1 229 | [pcbnew/Layer.F.CrtYd] 230 | Enabled=1 231 | [pcbnew/Layer.B.Fab] 232 | Enabled=1 233 | [pcbnew/Layer.F.Fab] 234 | Enabled=1 235 | [pcbnew/Layer.Rescue] 236 | Enabled=0 237 | [pcbnew/Netclasses] 238 | [pcbnew/Netclasses/Default] 239 | Name=Default 240 | Clearance=0.2 241 | TrackWidth=0.25 242 | ViaDiameter=0.8 243 | ViaDrill=0.4 244 | uViaDiameter=0.3 245 | uViaDrill=0.1 246 | dPairWidth=0.2 247 | dPairGap=0.25 248 | dPairViaGap=0.25 249 | -------------------------------------------------------------------------------- /kicad/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name footprintlibrary)(type KiCad)(uri ${KIPRJMOD}/footprintlibrary.pretty)(options "")(descr "")(disabled)) 3 | (lib (name teensy)(type KiCad)(uri ${KIPRJMOD}/teensy.pretty)(options "")(descr "")) 4 | (lib (name branchController)(type KiCad)(uri ${KIPRJMOD}/branchController.pretty)(options "")(descr "")) 5 | ) 6 | -------------------------------------------------------------------------------- /kicad/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name teensy)(type Legacy)(uri /Users/spolsky/Downloads/teensy_library-master/teensy.lib)(options "")(descr "")) 3 | (lib (name branchController)(type Legacy)(uri ${KIPRJMOD}/branchController.lib)(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /kicad/teensy.pretty/Teensy30_31_32_LC.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Teensy30_31_32_LC (layer F.Cu) (tedit 5D5216D8) 2 | (fp_text reference REF** (at 0 -10.16) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value Teensy3.0/3.1/3.2/LC (at 0 10.16) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text user MK20DX128VLH5 (at 4.445 -1.524) (layer F.SilkS) 9 | (effects (font (size 0.7 0.7) (thickness 0.15))) 10 | ) 11 | (fp_text user MKL26Z64VFT4 (at 4.445 -0.254) (layer F.SilkS) 12 | (effects (font (size 0.7 0.7) (thickness 0.15))) 13 | ) 14 | (fp_text user MK20DX256VLH7 (at 4.445 -2.794) (layer F.SilkS) 15 | (effects (font (size 0.7 0.7) (thickness 0.15))) 16 | ) 17 | (fp_poly (pts (xy 4.826 2.921) (xy 4.572 2.667) (xy 4.953 2.413) (xy 5.207 2.667)) (layer F.SilkS) (width 0.1)) 18 | (fp_poly (pts (xy 3.81 3.683) (xy 3.556 3.429) (xy 3.937 3.175) (xy 4.191 3.429)) (layer F.SilkS) (width 0.1)) 19 | (fp_poly (pts (xy 4.572 4.445) (xy 4.318 4.191) (xy 4.699 3.937) (xy 4.953 4.191)) (layer F.SilkS) (width 0.1)) 20 | (fp_poly (pts (xy 4.445 2.54) (xy 4.191 2.286) (xy 4.572 2.032) (xy 4.826 2.286)) (layer F.SilkS) (width 0.1)) 21 | (fp_poly (pts (xy 4.191 4.064) (xy 3.937 3.81) (xy 4.318 3.556) (xy 4.572 3.81)) (layer F.SilkS) (width 0.1)) 22 | (fp_poly (pts (xy 4.953 2.159) (xy 4.699 1.905) (xy 5.08 1.651) (xy 5.334 1.905)) (layer F.SilkS) (width 0.1)) 23 | (fp_poly (pts (xy 4.318 3.302) (xy 4.064 3.048) (xy 4.445 2.794) (xy 4.699 3.048)) (layer F.SilkS) (width 0.1)) 24 | (fp_poly (pts (xy 3.937 2.921) (xy 3.683 2.667) (xy 4.064 2.413) (xy 4.318 2.667)) (layer F.SilkS) (width 0.1)) 25 | (fp_line (start -17.78 8.89) (end -17.78 -8.89) (layer F.SilkS) (width 0.15)) 26 | (fp_line (start 17.78 8.89) (end -17.78 8.89) (layer F.SilkS) (width 0.15)) 27 | (fp_line (start 17.78 -8.89) (end 17.78 8.89) (layer F.SilkS) (width 0.15)) 28 | (fp_line (start -17.78 -8.89) (end 17.78 -8.89) (layer F.SilkS) (width 0.15)) 29 | (fp_line (start 8.89 5.08) (end 0 5.08) (layer F.SilkS) (width 0.15)) 30 | (fp_line (start 8.89 -5.08) (end 0 -5.08) (layer F.SilkS) (width 0.15)) 31 | (fp_line (start 0 -5.08) (end 0 5.08) (layer F.SilkS) (width 0.15)) 32 | (fp_line (start 8.89 5.08) (end 8.89 -5.08) (layer F.SilkS) (width 0.15)) 33 | (fp_line (start 12.7 -2.54) (end 15.24 -2.54) (layer F.SilkS) (width 0.15)) 34 | (fp_line (start 12.7 2.54) (end 12.7 -2.54) (layer F.SilkS) (width 0.15)) 35 | (fp_line (start 15.24 2.54) (end 12.7 2.54) (layer F.SilkS) (width 0.15)) 36 | (fp_line (start 15.24 -2.54) (end 15.24 2.54) (layer F.SilkS) (width 0.15)) 37 | (fp_line (start -11.43 2.54) (end -11.43 5.08) (layer F.SilkS) (width 0.15)) 38 | (fp_line (start -8.89 2.54) (end -11.43 2.54) (layer F.SilkS) (width 0.15)) 39 | (fp_line (start -8.89 5.08) (end -8.89 2.54) (layer F.SilkS) (width 0.15)) 40 | (fp_line (start -11.43 5.08) (end -8.89 5.08) (layer F.SilkS) (width 0.15)) 41 | (fp_line (start -12.7 3.81) (end -17.78 3.81) (layer F.SilkS) (width 0.15)) 42 | (fp_line (start -12.7 -3.81) (end -17.78 -3.81) (layer F.SilkS) (width 0.15)) 43 | (fp_line (start -12.7 3.81) (end -12.7 -3.81) (layer F.SilkS) (width 0.15)) 44 | (fp_line (start -6.35 2.54) (end -6.35 5.08) (layer F.SilkS) (width 0.15)) 45 | (fp_line (start -2.54 2.54) (end -6.35 2.54) (layer F.SilkS) (width 0.15)) 46 | (fp_line (start -2.54 5.08) (end -2.54 2.54) (layer F.SilkS) (width 0.15)) 47 | (fp_line (start -6.35 5.08) (end -2.54 5.08) (layer F.SilkS) (width 0.15)) 48 | (fp_line (start -19.05 -3.81) (end -17.78 -3.81) (layer F.SilkS) (width 0.15)) 49 | (fp_line (start -19.05 3.81) (end -19.05 -3.81) (layer F.SilkS) (width 0.15)) 50 | (fp_line (start -17.78 3.81) (end -19.05 3.81) (layer F.SilkS) (width 0.15)) 51 | (fp_text user T3.1 (at -6.35 -2.54 90) (layer F.SilkS) 52 | (effects (font (size 1 1) (thickness 0.15))) 53 | ) 54 | (fp_text user T3.2 (at -10.16 -2.54 90) (layer F.SilkS) 55 | (effects (font (size 1 1) (thickness 0.15))) 56 | ) 57 | (pad 52 thru_hole circle (at -10.16 0) (size 1.9 1.9) (drill 0.5) (layers *.Cu *.Mask)) 58 | (pad 52 thru_hole circle (at -6.35 0) (size 1.9 1.9) (drill 0.5) (layers *.Cu *.Mask)) 59 | (pad 1 thru_hole rect (at -16.51 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 60 | (pad 2 thru_hole circle (at -13.97 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 61 | (pad 3 thru_hole circle (at -11.43 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 62 | (pad 4 thru_hole circle (at -8.89 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 63 | (pad 5 thru_hole circle (at -6.35 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 64 | (pad 6 thru_hole circle (at -3.81 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 65 | (pad 7 thru_hole circle (at -1.27 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 66 | (pad 8 thru_hole circle (at 1.27 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 67 | (pad 9 thru_hole circle (at 3.81 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 68 | (pad 10 thru_hole circle (at 6.35 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 69 | (pad 11 thru_hole circle (at 8.89 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 70 | (pad 12 thru_hole circle (at 11.43 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 71 | (pad 13 thru_hole circle (at 13.97 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 72 | (pad 37 thru_hole circle (at -3.81 -5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 73 | (pad 36 thru_hole circle (at -6.35 -5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 74 | (pad 35 thru_hole circle (at -8.89 -5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 75 | (pad 34 thru_hole circle (at -13.97 -5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 76 | (pad 33 thru_hole circle (at -16.51 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 77 | (pad 32 thru_hole circle (at -13.97 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 78 | (pad 31 thru_hole circle (at -11.43 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 79 | (pad 30 thru_hole circle (at -8.89 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 80 | (pad 29 thru_hole circle (at -6.35 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 81 | (pad 28 thru_hole circle (at -3.81 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 82 | (pad 27 thru_hole circle (at -1.27 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 83 | (pad 26 thru_hole circle (at 1.27 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 84 | (pad 25 thru_hole circle (at 3.81 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 85 | (pad 24 thru_hole circle (at 6.35 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 86 | (pad 23 thru_hole circle (at 8.89 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 87 | (pad 22 thru_hole circle (at 11.43 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 88 | (pad 21 thru_hole circle (at 13.97 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 89 | (pad 14 thru_hole circle (at 16.51 7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 90 | (pad 15 thru_hole circle (at 16.51 5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 91 | (pad 16 thru_hole circle (at 16.51 2.54) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 92 | (pad 20 thru_hole circle (at 16.51 -7.62) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 93 | (pad 19 thru_hole circle (at 16.51 -5.08) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 94 | (pad 18 thru_hole circle (at 16.51 -2.54) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 95 | (pad 17 thru_hole circle (at 16.51 0) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask)) 96 | ) 97 | -------------------------------------------------------------------------------- /lib/Display/Display.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Code for driving 128x32 monochrome OLED display, connected with I2C 4 | // Product page: https://www.adafruit.com/product/4440 5 | 6 | #include 7 | 8 | #define CB_DISPLAY_LINE 22 9 | 10 | namespace Display { 11 | 12 | void setup(); 13 | void status(int line, const char* msg); 14 | void write_lines(); 15 | void off(); 16 | void on(); 17 | 18 | #ifdef ADAFRUIT_SAMPLE_CODE 19 | void adafruitSampleCode(); // Runs an infinite loop of adafruit sample code, consisting of these functions: 20 | void testdrawline(); // Draw many lines 21 | void testdrawrect(); // Draw rectangles (outlines) 22 | void testfillrect(); // Draw rectangles (filled) 23 | void testdrawcircle(); // Draw circles (outlines) 24 | void testfillcircle(); // Draw circles (filled) 25 | void testdrawroundrect(); // Draw rounded rectangles (outlines) 26 | void testfillroundrect(); // Draw rounded rectangles (filled) 27 | void testdrawtriangle(); // Draw triangles (outlines) 28 | void testfilltriangle(); // Draw triangles (filled) 29 | void testdrawchar(); // Draw characters of the default font 30 | void testdrawstyles(); // Draw 'stylized' characters 31 | void testscrolltext(); // Draw scrolling text 32 | void testdrawbitmap(); // Draw a small bitmap image 33 | void testanimate(const uint8_t *bitmap, uint8_t w, uint8_t h); 34 | #endif 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lib/Heartbeat/Heartbeat.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace Heartbeat { 8 | 9 | void setup(void) 10 | { 11 | // initialize LED digital pin as an output. 12 | pinMode(pinHeartbeat, OUTPUT); 13 | } 14 | 15 | void loop(void) 16 | { 17 | uint32_t tm = millis() % HEARTBEAT_PERIOD_MS; 18 | double rad = tm * PI * 2 / HEARTBEAT_PERIOD_MS; 19 | double brightness = (sin(rad) + 1.0) * 128.0; 20 | if (cos(rad) > 0) brightness = 255.0 - brightness; 21 | 22 | // turn the LED on (HIGH is the voltage level) 23 | analogWrite(pinHeartbeat, int(brightness)); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /lib/Heartbeat/Heartbeat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define HEARTBEAT_PERIOD_MS 1700 4 | 5 | namespace Heartbeat { 6 | void setup(void); 7 | void loop(void); 8 | } 9 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/.library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "IRremote", 3 | "keywords": [ 4 | "infrared", 5 | "ir", 6 | "remote" 7 | ], 8 | "description": "Send and receive infrared signals with multiple protocols", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/z3t0/Arduino-IRremote.git" 12 | }, 13 | "version": "2.3.3", 14 | "frameworks": [ 15 | "arduino" 16 | ], 17 | "platforms": [ 18 | "atmelavr" 19 | ], 20 | "authors": [ 21 | { 22 | "email": "zetoslab@gmail.com", 23 | "url": null, 24 | "maintainer": false, 25 | "name": "Rafi Khan" 26 | }, 27 | { 28 | "email": "ken.shirriff@gmail.com", 29 | "url": null, 30 | "maintainer": false, 31 | "name": "Ken Shirriff" 32 | } 33 | ], 34 | "id": 4 35 | } -------------------------------------------------------------------------------- /lib/IRremote_ID4/Contributing.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidlines 2 | 3 | This library is the culmination of the expertise of many members of the open source community who have dedicated their time and hard work. The best way to ask for help or propose a new idea is to [create a new issue](https://github.com/z3t0/Arduino-IRremote/issues/new) while creating a Pull Request with your code changes allows you to share your own innovations with the rest of the community. 4 | 5 | The following are some guidelines to observe when creating issues or PRs: 6 | - Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and it is okay for people to have different ideas 7 | - [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); it helps us help you when we can read your code! On that note also refrain from pasting more than 30 lines of code in a post, instead [create a gist](https://gist.github.com/) if you need to share large snippets 8 | - Use reasonable titles; refrain from using overly long or capitalized titles as they are usually annoying and do little to encourage others to help :smile: 9 | - Be detailed; refrain from mentioning code problems without sharing your source code and always give information regarding your board and version of the library 10 | 11 | If there is any need to contact me then you can find my email on the README, I do not mind responding to emails but it would be in your own interests to create issues if you need help with the library as responses would be from a larger community with greater knowledge! -------------------------------------------------------------------------------- /lib/IRremote_ID4/Contributors.md: -------------------------------------------------------------------------------- 1 | ## Contributors 2 | These are the active contributors of this project that you may contact if there is anything you need help with or if you have suggestions. 3 | 4 | - [z3t0](https://github.com/z3t0) : Active Contributor and currently also the main contributor. 5 | * Email: zetoslab@gmail.com 6 | - [shirriff](https://github.com/shirriff) : An amazing person who worked to create this awesome library and provide unending support 7 | - [AnalysIR](https:/github.com/AnalysIR): Active contributor and is amazing with providing support! 8 | - [Informatic](https://github.com/Informatic) : Active contributor 9 | - [fmeschia](https://github.com/fmeschia) : Active contributor 10 | - [PaulStoffregen](https://github.com/paulstroffregen) : Active contributor 11 | - [crash7](https://github.com/crash7) : Active contributor 12 | - [Neco777](https://github.com/neco777) : Active contributor 13 | - [Lauszus](https://github.com/lauszus) : Active contributor 14 | - [csBlueChip](https://github.com/csbluechip) : Active contributor, who contributed major and vital changes to the code base. 15 | - [Sebazzz](https://github.com/sebazz): Contributor 16 | - [lumbric](https://github.com/lumbric): Contributor 17 | - [ElectricRCAircraftGuy](https://github.com/electricrcaircraftguy): Active Contributor 18 | - [philipphenkel](https://github.com/philipphenkel): Active Contributor 19 | - [MCUdude](https://github.com/MCUdude): Contributor 20 | - [marcmerlin](https://github.com/marcmerlin): Contributor (ESP32 port) 21 | 22 | Note: This list is being updated constantly so please let [z3t0](https://github.com/z3t0) know if you have been missed. 23 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/IRremote.cpp: -------------------------------------------------------------------------------- 1 | //****************************************************************************** 2 | // IRremote 3 | // Version 2.0.1 June, 2015 4 | // Copyright 2009 Ken Shirriff 5 | // For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html 6 | // 7 | // Modified by Paul Stoffregen to support other boards and timers 8 | // Modified by Mitra Ardron 9 | // Added Sanyo and Mitsubishi controllers 10 | // Modified Sony to spot the repeat codes that some Sony's send 11 | // 12 | // Interrupt code based on NECIRrcv by Joe Knapp 13 | // http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 14 | // Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/ 15 | // 16 | // JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) 17 | // LG added by Darryl Smith (based on the JVC protocol) 18 | // Whynter A/C ARC-110WD added by Francesco Meschia 19 | //****************************************************************************** 20 | 21 | // Defining IR_GLOBAL here allows us to declare the instantiation of global variables 22 | #define IR_GLOBAL 23 | # include "IRremote.h" 24 | # include "IRremoteInt.h" 25 | #undef IR_GLOBAL 26 | 27 | #ifndef IR_TIMER_USE_ESP32 28 | #include 29 | #endif 30 | 31 | 32 | //+============================================================================= 33 | // The match functions were (apparently) originally MACROs to improve code speed 34 | // (although this would have bloated the code) hence the names being CAPS 35 | // A later release implemented debug output and so they needed to be converted 36 | // to functions. 37 | // I tried to implement a dual-compile mode (DEBUG/non-DEBUG) but for some 38 | // reason, no matter what I did I could not get them to function as macros again. 39 | // I have found a *lot* of bugs in the Arduino compiler over the last few weeks, 40 | // and I am currently assuming that one of these bugs is my problem. 41 | // I may revisit this code at a later date and look at the assembler produced 42 | // in a hope of finding out what is going on, but for now they will remain as 43 | // functions even in non-DEBUG mode 44 | // 45 | int MATCH (int measured, int desired) 46 | { 47 | DBG_PRINT(F("Testing: ")); 48 | DBG_PRINT(TICKS_LOW(desired), DEC); 49 | DBG_PRINT(F(" <= ")); 50 | DBG_PRINT(measured, DEC); 51 | DBG_PRINT(F(" <= ")); 52 | DBG_PRINT(TICKS_HIGH(desired), DEC); 53 | 54 | bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired))); 55 | if (passed) 56 | DBG_PRINTLN(F("?; passed")); 57 | else 58 | DBG_PRINTLN(F("?; FAILED")); 59 | return passed; 60 | } 61 | 62 | //+======================================================== 63 | // Due to sensor lag, when received, Marks tend to be 100us too long 64 | // 65 | int MATCH_MARK (int measured_ticks, int desired_us) 66 | { 67 | DBG_PRINT(F("Testing mark (actual vs desired): ")); 68 | DBG_PRINT(measured_ticks * USECPERTICK, DEC); 69 | DBG_PRINT(F("us vs ")); 70 | DBG_PRINT(desired_us, DEC); 71 | DBG_PRINT("us"); 72 | DBG_PRINT(": "); 73 | DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC); 74 | DBG_PRINT(F(" <= ")); 75 | DBG_PRINT(measured_ticks * USECPERTICK, DEC); 76 | DBG_PRINT(F(" <= ")); 77 | DBG_PRINT(TICKS_HIGH(desired_us + MARK_EXCESS) * USECPERTICK, DEC); 78 | 79 | bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS)) 80 | && (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS))); 81 | if (passed) 82 | DBG_PRINTLN(F("?; passed")); 83 | else 84 | DBG_PRINTLN(F("?; FAILED")); 85 | return passed; 86 | } 87 | 88 | //+======================================================== 89 | // Due to sensor lag, when received, Spaces tend to be 100us too short 90 | // 91 | int MATCH_SPACE (int measured_ticks, int desired_us) 92 | { 93 | DBG_PRINT(F("Testing space (actual vs desired): ")); 94 | DBG_PRINT(measured_ticks * USECPERTICK, DEC); 95 | DBG_PRINT(F("us vs ")); 96 | DBG_PRINT(desired_us, DEC); 97 | DBG_PRINT("us"); 98 | DBG_PRINT(": "); 99 | DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC); 100 | DBG_PRINT(F(" <= ")); 101 | DBG_PRINT(measured_ticks * USECPERTICK, DEC); 102 | DBG_PRINT(F(" <= ")); 103 | DBG_PRINT(TICKS_HIGH(desired_us - MARK_EXCESS) * USECPERTICK, DEC); 104 | 105 | bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS)) 106 | && (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS))); 107 | if (passed) 108 | DBG_PRINTLN(F("?; passed")); 109 | else 110 | DBG_PRINTLN(F("?; FAILED")); 111 | return passed; 112 | } 113 | 114 | //+============================================================================= 115 | // Interrupt Service Routine - Fires every 50uS 116 | // TIMER2 interrupt code to collect raw data. 117 | // Widths of alternating SPACE, MARK are recorded in rawbuf. 118 | // Recorded in ticks of 50uS [microseconds, 0.000050 seconds] 119 | // 'rawlen' counts the number of entries recorded so far. 120 | // First entry is the SPACE between transmissions. 121 | // As soon as a the first [SPACE] entry gets long: 122 | // Ready is set; State switches to IDLE; Timing of SPACE continues. 123 | // As soon as first MARK arrives: 124 | // Gap width is recorded; Ready is cleared; New logging starts 125 | // 126 | #ifdef IR_TIMER_USE_ESP32 127 | void IRTimer() 128 | #else 129 | ISR (TIMER_INTR_NAME) 130 | #endif 131 | { 132 | TIMER_RESET; 133 | 134 | // Read if IR Receiver -> SPACE [xmt LED off] or a MARK [xmt LED on] 135 | // digitalRead() is very slow. Optimisation is possible, but makes the code unportable 136 | uint8_t irdata = (uint8_t)digitalRead(irparams.recvpin); 137 | 138 | irparams.timer++; // One more 50uS tick 139 | if (irparams.rawlen >= RAWBUF) irparams.rcvstate = STATE_OVERFLOW ; // Buffer overflow 140 | 141 | switch(irparams.rcvstate) { 142 | //...................................................................... 143 | case STATE_IDLE: // In the middle of a gap 144 | if (irdata == MARK) { 145 | if (irparams.timer < GAP_TICKS) { // Not big enough to be a gap. 146 | irparams.timer = 0; 147 | 148 | } else { 149 | // Gap just ended; Record duration; Start recording transmission 150 | irparams.overflow = false; 151 | irparams.rawlen = 0; 152 | irparams.rawbuf[irparams.rawlen++] = irparams.timer; 153 | irparams.timer = 0; 154 | irparams.rcvstate = STATE_MARK; 155 | } 156 | } 157 | break; 158 | //...................................................................... 159 | case STATE_MARK: // Timing Mark 160 | if (irdata == SPACE) { // Mark ended; Record time 161 | irparams.rawbuf[irparams.rawlen++] = irparams.timer; 162 | irparams.timer = 0; 163 | irparams.rcvstate = STATE_SPACE; 164 | } 165 | break; 166 | //...................................................................... 167 | case STATE_SPACE: // Timing Space 168 | if (irdata == MARK) { // Space just ended; Record time 169 | irparams.rawbuf[irparams.rawlen++] = irparams.timer; 170 | irparams.timer = 0; 171 | irparams.rcvstate = STATE_MARK; 172 | 173 | } else if (irparams.timer > GAP_TICKS) { // Space 174 | // A long Space, indicates gap between codes 175 | // Flag the current code as ready for processing 176 | // Switch to STOP 177 | // Don't reset timer; keep counting Space width 178 | irparams.rcvstate = STATE_STOP; 179 | } 180 | break; 181 | //...................................................................... 182 | case STATE_STOP: // Waiting; Measuring Gap 183 | if (irdata == MARK) irparams.timer = 0 ; // Reset gap timer 184 | break; 185 | //...................................................................... 186 | case STATE_OVERFLOW: // Flag up a read overflow; Stop the State Machine 187 | irparams.overflow = true; 188 | irparams.rcvstate = STATE_STOP; 189 | break; 190 | } 191 | 192 | // If requested, flash LED while receiving IR data 193 | if (irparams.blinkflag) { 194 | if (irdata == MARK) 195 | if (irparams.blinkpin) digitalWrite(irparams.blinkpin, HIGH); // Turn user defined pin LED on 196 | else BLINKLED_ON() ; // if no user defined LED pin, turn default LED pin for the hardware on 197 | else if (irparams.blinkpin) digitalWrite(irparams.blinkpin, LOW); // Turn user defined pin LED on 198 | else BLINKLED_OFF() ; // if no user defined LED pin, turn default LED pin for the hardware on 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/IRremote.h: -------------------------------------------------------------------------------- 1 | 2 | //****************************************************************************** 3 | // IRremote 4 | // Version 2.0.1 June, 2015 5 | // Copyright 2009 Ken Shirriff 6 | // For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html 7 | // Edited by Mitra to add new controller SANYO 8 | // 9 | // Interrupt code based on NECIRrcv by Joe Knapp 10 | // http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 11 | // Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/ 12 | // 13 | // JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) 14 | // LG added by Darryl Smith (based on the JVC protocol) 15 | // Whynter A/C ARC-110WD added by Francesco Meschia 16 | //****************************************************************************** 17 | 18 | #ifndef IRremote_h 19 | #define IRremote_h 20 | 21 | //------------------------------------------------------------------------------ 22 | // The ISR header contains several useful macros the user may wish to use 23 | // 24 | #include "IRremoteInt.h" 25 | 26 | //------------------------------------------------------------------------------ 27 | // Supported IR protocols 28 | // Each protocol you include costs memory and, during decode, costs time 29 | // Disable (set to 0) all the protocols you do not need/want! 30 | // 31 | #define DECODE_RC5 0 32 | #define SEND_RC5 0 33 | 34 | #define DECODE_RC6 0 35 | #define SEND_RC6 0 36 | 37 | #define DECODE_NEC 1 38 | #define SEND_NEC 0 39 | 40 | #define DECODE_SONY 0 41 | #define SEND_SONY 0 42 | 43 | #define DECODE_PANASONIC 0 44 | #define SEND_PANASONIC 0 45 | 46 | #define DECODE_JVC 0 47 | #define SEND_JVC 0 48 | 49 | #define DECODE_SAMSUNG 0 50 | #define SEND_SAMSUNG 0 51 | 52 | #define DECODE_WHYNTER 0 53 | #define SEND_WHYNTER 0 54 | 55 | #define DECODE_AIWA_RC_T501 0 56 | #define SEND_AIWA_RC_T501 0 57 | 58 | #define DECODE_LG 0 59 | #define SEND_LG 0 60 | 61 | #define DECODE_SANYO 0 62 | #define SEND_SANYO 0 // NOT WRITTEN 63 | 64 | #define DECODE_MITSUBISHI 0 65 | #define SEND_MITSUBISHI 0 // NOT WRITTEN 66 | 67 | #define DECODE_DISH 0 // NOT WRITTEN 68 | #define SEND_DISH 0 69 | 70 | #define DECODE_SHARP 0 // NOT WRITTEN 71 | #define SEND_SHARP 0 72 | 73 | #define DECODE_DENON 0 74 | #define SEND_DENON 0 75 | 76 | #define DECODE_PRONTO 0 // This function doe not logically make sense 77 | #define SEND_PRONTO 0 78 | 79 | #define DECODE_LEGO_PF 0 // NOT WRITTEN 80 | #define SEND_LEGO_PF 0 81 | 82 | //------------------------------------------------------------------------------ 83 | // When sending a Pronto code we request to send either the "once" code 84 | // or the "repeat" code 85 | // If the code requested does not exist we can request to fallback on the 86 | // other code (the one we did not explicitly request) 87 | // 88 | // I would suggest that "fallback" will be the standard calling method 89 | // The last paragraph on this page discusses the rationale of this idea: 90 | // http://www.remotecentral.com/features/irdisp2.htm 91 | // 92 | #define PRONTO_ONCE false 93 | #define PRONTO_REPEAT true 94 | #define PRONTO_FALLBACK true 95 | #define PRONTO_NOFALLBACK false 96 | 97 | //------------------------------------------------------------------------------ 98 | // An enumerated list of all supported formats 99 | // You do NOT need to remove entries from this list when disabling protocols! 100 | // 101 | typedef 102 | enum { 103 | UNKNOWN = -1, 104 | UNUSED = 0, 105 | RC5, 106 | RC6, 107 | NEC, 108 | SONY, 109 | PANASONIC, 110 | JVC, 111 | SAMSUNG, 112 | WHYNTER, 113 | AIWA_RC_T501, 114 | LG, 115 | SANYO, 116 | MITSUBISHI, 117 | DISH, 118 | SHARP, 119 | DENON, 120 | PRONTO, 121 | LEGO_PF, 122 | } 123 | decode_type_t; 124 | 125 | //------------------------------------------------------------------------------ 126 | // Set DEBUG_IRREMOTE to 1 for lots of lovely debug output 127 | // 128 | #define DEBUG_IRREMOTE 0 129 | 130 | //------------------------------------------------------------------------------ 131 | // Debug directives 132 | // 133 | #if DEBUG_IRREMOTE 134 | # define DBG_PRINT(...) Serial.print(__VA_ARGS__) 135 | # define DBG_PRINTLN(...) Serial.println(__VA_ARGS__) 136 | #else 137 | # define DBG_PRINT(...) 138 | # define DBG_PRINTLN(...) 139 | #endif 140 | 141 | //------------------------------------------------------------------------------ 142 | // Mark & Space matching functions 143 | // 144 | int MATCH (int measured, int desired) ; 145 | int MATCH_MARK (int measured_ticks, int desired_us) ; 146 | int MATCH_SPACE (int measured_ticks, int desired_us) ; 147 | 148 | //------------------------------------------------------------------------------ 149 | // Results returned from the decoder 150 | // 151 | class decode_results 152 | { 153 | public: 154 | decode_type_t decode_type; // UNKNOWN, NEC, SONY, RC5, ... 155 | unsigned int address; // Used by Panasonic & Sharp [16-bits] 156 | unsigned long value; // Decoded value [max 32-bits] 157 | int bits; // Number of bits in decoded value 158 | volatile unsigned int *rawbuf; // Raw intervals in 50uS ticks 159 | int rawlen; // Number of records in rawbuf 160 | int overflow; // true iff IR raw code too long 161 | }; 162 | 163 | //------------------------------------------------------------------------------ 164 | // Decoded value for NEC when a repeat code is received 165 | // 166 | #define REPEAT 0xFFFFFFFF 167 | 168 | //------------------------------------------------------------------------------ 169 | // Main class for receiving IR 170 | // 171 | class IRrecv 172 | { 173 | public: 174 | IRrecv (int recvpin) ; 175 | IRrecv (int recvpin, int blinkpin); 176 | 177 | void blink13 (int blinkflag) ; 178 | int decode (decode_results *results) ; 179 | void enableIRIn ( ) ; 180 | bool isIdle ( ) ; 181 | void resume ( ) ; 182 | 183 | private: 184 | long decodeHash (decode_results *results) ; 185 | int compare (unsigned int oldval, unsigned int newval) ; 186 | 187 | //...................................................................... 188 | # if (DECODE_RC5 || DECODE_RC6) 189 | // This helper function is shared by RC5 and RC6 190 | int getRClevel (decode_results *results, int *offset, int *used, int t1) ; 191 | # endif 192 | # if DECODE_RC5 193 | bool decodeRC5 (decode_results *results) ; 194 | # endif 195 | # if DECODE_RC6 196 | bool decodeRC6 (decode_results *results) ; 197 | # endif 198 | //...................................................................... 199 | # if DECODE_NEC 200 | bool decodeNEC (decode_results *results) ; 201 | # endif 202 | //...................................................................... 203 | # if DECODE_SONY 204 | bool decodeSony (decode_results *results) ; 205 | # endif 206 | //...................................................................... 207 | # if DECODE_PANASONIC 208 | bool decodePanasonic (decode_results *results) ; 209 | # endif 210 | //...................................................................... 211 | # if DECODE_JVC 212 | bool decodeJVC (decode_results *results) ; 213 | # endif 214 | //...................................................................... 215 | # if DECODE_SAMSUNG 216 | bool decodeSAMSUNG (decode_results *results) ; 217 | # endif 218 | //...................................................................... 219 | # if DECODE_WHYNTER 220 | bool decodeWhynter (decode_results *results) ; 221 | # endif 222 | //...................................................................... 223 | # if DECODE_AIWA_RC_T501 224 | bool decodeAiwaRCT501 (decode_results *results) ; 225 | # endif 226 | //...................................................................... 227 | # if DECODE_LG 228 | bool decodeLG (decode_results *results) ; 229 | # endif 230 | //...................................................................... 231 | # if DECODE_SANYO 232 | bool decodeSanyo (decode_results *results) ; 233 | # endif 234 | //...................................................................... 235 | # if DECODE_MITSUBISHI 236 | bool decodeMitsubishi (decode_results *results) ; 237 | # endif 238 | //...................................................................... 239 | # if DECODE_DISH 240 | bool decodeDish (decode_results *results) ; // NOT WRITTEN 241 | # endif 242 | //...................................................................... 243 | # if DECODE_SHARP 244 | bool decodeSharp (decode_results *results) ; // NOT WRITTEN 245 | # endif 246 | //...................................................................... 247 | # if DECODE_DENON 248 | bool decodeDenon (decode_results *results) ; 249 | # endif 250 | //...................................................................... 251 | # if DECODE_LEGO_PF 252 | bool decodeLegoPowerFunctions (decode_results *results) ; 253 | # endif 254 | } ; 255 | 256 | //------------------------------------------------------------------------------ 257 | // Main class for sending IR 258 | // 259 | class IRsend 260 | { 261 | public: 262 | IRsend () { } 263 | 264 | void custom_delay_usec (unsigned long uSecs); 265 | void enableIROut (int khz) ; 266 | void mark (unsigned int usec) ; 267 | void space (unsigned int usec) ; 268 | void sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz) ; 269 | 270 | //...................................................................... 271 | # if SEND_RC5 272 | void sendRC5 (unsigned long data, int nbits) ; 273 | # endif 274 | # if SEND_RC6 275 | void sendRC6 (unsigned long data, int nbits) ; 276 | # endif 277 | //...................................................................... 278 | # if SEND_NEC 279 | void sendNEC (unsigned long data, int nbits) ; 280 | # endif 281 | //...................................................................... 282 | # if SEND_SONY 283 | void sendSony (unsigned long data, int nbits) ; 284 | # endif 285 | //...................................................................... 286 | # if SEND_PANASONIC 287 | void sendPanasonic (unsigned int address, unsigned long data) ; 288 | # endif 289 | //...................................................................... 290 | # if SEND_JVC 291 | // JVC does NOT repeat by sending a separate code (like NEC does). 292 | // The JVC protocol repeats by skipping the header. 293 | // To send a JVC repeat signal, send the original code value 294 | // and set 'repeat' to true 295 | void sendJVC (unsigned long data, int nbits, bool repeat) ; 296 | # endif 297 | //...................................................................... 298 | # if SEND_SAMSUNG 299 | void sendSAMSUNG (unsigned long data, int nbits) ; 300 | # endif 301 | //...................................................................... 302 | # if SEND_WHYNTER 303 | void sendWhynter (unsigned long data, int nbits) ; 304 | # endif 305 | //...................................................................... 306 | # if SEND_AIWA_RC_T501 307 | void sendAiwaRCT501 (int code) ; 308 | # endif 309 | //...................................................................... 310 | # if SEND_LG 311 | void sendLG (unsigned long data, int nbits) ; 312 | # endif 313 | //...................................................................... 314 | # if SEND_SANYO 315 | void sendSanyo ( ) ; // NOT WRITTEN 316 | # endif 317 | //...................................................................... 318 | # if SEND_MISUBISHI 319 | void sendMitsubishi ( ) ; // NOT WRITTEN 320 | # endif 321 | //...................................................................... 322 | # if SEND_DISH 323 | void sendDISH (unsigned long data, int nbits) ; 324 | # endif 325 | //...................................................................... 326 | # if SEND_SHARP 327 | void sendSharpRaw (unsigned long data, int nbits) ; 328 | void sendSharp (unsigned int address, unsigned int command) ; 329 | # endif 330 | //...................................................................... 331 | # if SEND_DENON 332 | void sendDenon (unsigned long data, int nbits) ; 333 | # endif 334 | //...................................................................... 335 | # if SEND_PRONTO 336 | void sendPronto (char* code, bool repeat, bool fallback) ; 337 | # endif 338 | //...................................................................... 339 | # if SEND_LEGO_PF 340 | void sendLegoPowerFunctions (uint16_t data, bool repeat = true) ; 341 | # endif 342 | } ; 343 | 344 | #endif 345 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/IRremoteInt.h: -------------------------------------------------------------------------------- 1 | //****************************************************************************** 2 | // IRremote 3 | // Version 2.0.1 June, 2015 4 | // Copyright 2009 Ken Shirriff 5 | // For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html 6 | // 7 | // Modified by Paul Stoffregen to support other boards and timers 8 | // 9 | // Interrupt code based on NECIRrcv by Joe Knapp 10 | // http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556 11 | // Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/ 12 | // 13 | // JVC and Panasonic protocol added by Kristian Lauszus (Thanks to zenwheel and other people at the original blog post) 14 | // Whynter A/C ARC-110WD added by Francesco Meschia 15 | //****************************************************************************** 16 | 17 | #ifndef IRremoteint_h 18 | #define IRremoteint_h 19 | 20 | //------------------------------------------------------------------------------ 21 | // Include the right Arduino header 22 | // 23 | #if defined(ARDUINO) && (ARDUINO >= 100) 24 | # include 25 | #else 26 | # if !defined(IRPRONTO) 27 | # include 28 | # endif 29 | #endif 30 | 31 | //------------------------------------------------------------------------------ 32 | // This handles definition and access to global variables 33 | // 34 | #ifdef IR_GLOBAL 35 | # define EXTERN 36 | #else 37 | # define EXTERN extern 38 | #endif 39 | 40 | //------------------------------------------------------------------------------ 41 | // Information for the Interrupt Service Routine 42 | // 43 | #define RAWBUF 101 // Maximum length of raw duration buffer 44 | 45 | typedef 46 | struct { 47 | // The fields are ordered to reduce memory over caused by struct-padding 48 | uint8_t rcvstate; // State Machine state 49 | uint8_t recvpin; // Pin connected to IR data from detector 50 | uint8_t blinkpin; 51 | uint8_t blinkflag; // true -> enable blinking of pin on IR processing 52 | uint8_t rawlen; // counter of entries in rawbuf 53 | unsigned int timer; // State timer, counts 50uS ticks. 54 | unsigned int rawbuf[RAWBUF]; // raw data 55 | uint8_t overflow; // Raw buffer overflow occurred 56 | } 57 | irparams_t; 58 | 59 | // ISR State-Machine : Receiver States 60 | #define STATE_IDLE 2 61 | #define STATE_MARK 3 62 | #define STATE_SPACE 4 63 | #define STATE_STOP 5 64 | #define STATE_OVERFLOW 6 65 | 66 | // Allow all parts of the code access to the ISR data 67 | // NB. The data can be changed by the ISR at any time, even mid-function 68 | // Therefore we declare it as "volatile" to stop the compiler/CPU caching it 69 | EXTERN volatile irparams_t irparams; 70 | 71 | //------------------------------------------------------------------------------ 72 | // Defines for setting and clearing register bits 73 | // 74 | #ifndef cbi 75 | # define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 76 | #endif 77 | 78 | #ifndef sbi 79 | # define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) 80 | #endif 81 | 82 | //------------------------------------------------------------------------------ 83 | // Pulse parms are ((X*50)-100) for the Mark and ((X*50)+100) for the Space. 84 | // First MARK is the one after the long gap 85 | // Pulse parameters in uSec 86 | // 87 | 88 | // Due to sensor lag, when received, Marks tend to be 100us too long and 89 | // Spaces tend to be 100us too short 90 | #define MARK_EXCESS 100 91 | 92 | // Upper and Lower percentage tolerances in measurements 93 | #define TOLERANCE 25 94 | #define LTOL (1.0 - (TOLERANCE/100.)) 95 | #define UTOL (1.0 + (TOLERANCE/100.)) 96 | 97 | // Minimum gap between IR transmissions 98 | #define _GAP 5000 99 | #define GAP_TICKS (_GAP/USECPERTICK) 100 | 101 | #define TICKS_LOW(us) ((int)(((us)*LTOL/USECPERTICK))) 102 | #define TICKS_HIGH(us) ((int)(((us)*UTOL/USECPERTICK + 1))) 103 | 104 | //------------------------------------------------------------------------------ 105 | // IR detector output is active low 106 | // 107 | #define MARK 0 108 | #define SPACE 1 109 | 110 | // All board specific stuff has been moved to its own file, included here. 111 | #include "boarddefs.h" 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Board:** ARDUINO UNO 2 | **Library Version:** 2.1.0 3 | **Protocol:** Sony (if any) 4 | 5 | **Code Block:** 6 | ```c 7 | 8 | #include 9 | 10 | ..... 11 | 12 | ``` 13 | 14 | Use [a gist](gist.github.com) if the code exceeds 30 lines 15 | 16 | **checklist:** 17 | - [] I have **read** the README.md file thoroughly 18 | - [] I have searched existing issues to see if there is anything I have missed. 19 | - [] The latest [release](https://github.com/z3t0/Arduino-IRremote/releases/latest) is used 20 | - [] Any code referenced is provided and if over 30 lines a gist is linked INSTEAD of it being pasted in here 21 | - [] The title of the issue is helpful and relevant 22 | 23 | ** We will start to close issues that do not follow these guidelines as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!** 24 | 25 | The above is a short template allowing you to make detailed issues! 26 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/README.md: -------------------------------------------------------------------------------- 1 | # IRremote Arduino Library 2 | 3 | [![Build Status](https://travis-ci.org/z3t0/Arduino-IRremote.svg?branch=master)](https://travis-ci.org/z3t0/Arduino-IRremote) 4 | 5 | [![Join the chat at https://gitter.im/z3t0/Arduino-IRremote](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/z3t0/Arduino-IRremote?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | This library enables you to send and receive using infra-red signals on an Arduino. 8 | 9 | Tutorials and more information will be made available on [the official homepage](http://z3t0.github.io/Arduino-IRremote/). 10 | 11 | ## Version - 2.2.3 12 | 13 | ## Installation 14 | 1. Navigate to the [Releases](https://github.com/z3t0/Arduino-IRremote/releases) page. 15 | 2. Download the latest release. 16 | 3. Extract the zip file 17 | 4. Move the "IRremote" folder that has been extracted to your libraries directory. 18 | 5. Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors. 19 | 20 | 21 | ## FAQ 22 | - IR does not work right when I use Neopixels (aka WS2811/WS2812/WS2812B) 23 | Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled on many lower end CPUs like the basic arduinos. In turn, this stops the IR interrupt handler from running when it needs to. There are some solutions to this on some processors, [see this page from Marc MERLIN](http://marc.merlins.org/perso/arduino/post_2017-04-03_Arduino-328P-Uno-Teensy3_1-ESP8266-ESP32-IR-and-Neopixels.html) 24 | 25 | 26 | ## Supported Boards 27 | - Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc. 28 | - Teensy 1.0 / 1.0++ / 2.0 / 2++ / 3.0 / 3.1 / Teensy-LC; Credits: @PaulStoffregen (Teensy Team) 29 | - Sanguino 30 | - ATmega8, 48, 88, 168, 328 31 | - ATmega8535, 16, 32, 164, 324, 644, 1284, 32 | - ATmega64, 128 33 | - ATtiny 84 / 85 34 | - ESP32 (receive only) 35 | - ESP8266 is supported in a fork based on an old codebase that isn't as recent, but it works reasonably well given that perfectly timed sub millisecond interrupts are different on that chip. See https://github.com/markszabo/IRremoteESP8266 36 | - Sparkfun Pro Micro 37 | 38 | We are open to suggestions for adding support to new boards, however we highly recommend you contact your supplier first and ask them to provide support from their side. 39 | 40 | ### Hardware specifications 41 | 42 | | Board/CPU | Send Pin | Timers | 43 | |--------------------------------------------------------------------------|---------------------|-------------------| 44 | | [ATtiny84](https://github.com/SpenceKonde/ATTinyCore) | **6** | **1** | 45 | | [ATtiny85](https://github.com/SpenceKonde/ATTinyCore) | **1** | **TINY0** | 46 | | [ATmega8](https://github.com/MCUdude/MiniCore) | **9** | **1** | 47 | | Atmega32u4 | 5, 9, **13** | 1, 3, **4** | 48 | | [ATmega48, ATmega88, ATmega168, ATmega328](https://github.com/MCUdude/MiniCore) | **3**, 9 | 1, **2** | 49 | | [ATmega1284](https://github.com/MCUdude/MightyCore) | 13, 14, 6 | 1, **2**, 3 | 50 | | [ATmega164, ATmega324, ATmega644](https://github.com/MCUdude/MightyCore) | 13, **14** | 1, **2** | 51 | | [ATmega8535 ATmega16, ATmega32](https://github.com/MCUdude/MightyCore) | **13** | **1** | 52 | | [ATmega64, ATmega128](https://github.com/MCUdude/MegaCore) | **13** | **1** | 53 | | ATmega1280, ATmega2560 | 5, 6, **9**, 11, 46 | 1, **2**, 3, 4, 5 | 54 | | [ESP32](http://esp32.net/) | N/A (not supported) | **1** | 55 | | [Sparkfun Pro Micro](https://www.sparkfun.com/products/12640) | 9, **5**, 5 | 1, **3**, 4_HS | 56 | | [Teensy 1.0](https://www.pjrc.com/teensy/) | **17** | **1** | 57 | | [Teensy 2.0](https://www.pjrc.com/teensy/) | 9, **10**, 14 | 1, 3, **4_HS** | 58 | | [Teensy++ 1.0 / 2.0](https://www.pjrc.com/teensy/) | **1**, 16, 25 | 1, **2**, 3 | 59 | | [Teensy 3.0 / 3.1](https://www.pjrc.com/teensy/) | **5** | **CMT** | 60 | | [Teensy-LC](https://www.pjrc.com/teensy/) | **16** | **TPM1** | 61 | 62 | 63 | ### Experimental patches 64 | The following are strictly community supported patches that have yet to make it into mainstream. If you have issues feel free to ask here. If it works well then let us know! 65 | 66 | [Arduino 101](https://github.com/z3t0/Arduino-IRremote/pull/481#issuecomment-311243146) 67 | 68 | The table above lists the currently supported timers and corresponding send pins, many of these can have additional pins opened up and we are open to requests if a need arises for other pins. 69 | 70 | ## Usage 71 | - TODO (Check examples for now) 72 | 73 | ## Contributing 74 | If you want to contribute to this project: 75 | - Report bugs and errors 76 | - Ask for enhancements 77 | - Create issues and pull requests 78 | - Tell other people about this library 79 | - Contribute new protocols 80 | 81 | Check [here](Contributing.md) for some guidelines. 82 | 83 | ## Contact 84 | Email: zetoslab@gmail.com 85 | Please only email me if it is more appropriate than creating an Issue / PR. I **will** not respond to requests for adding support for particular boards, unless of course you are the creator of the board and would like to cooperate on the project. I will also **ignore** any emails asking me to tell you how to implement your ideas. However, if you have a private inquiry that you would only apply to you and you would prefer it to be via email, by all means. 86 | 87 | ## Contributors 88 | Check [here](Contributors.md) 89 | 90 | ## Copyright 91 | Copyright 2009-2012 Ken Shirriff 92 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/changelog.md: -------------------------------------------------------------------------------- 1 | ## 2.3.3 - 2017/03/31 2 | - Added ESP32 IR receive support [PR #427](https://github.com/z3t0/Arduino-IRremote/pull/425) 3 | 4 | ## 2.2.3 - 2017/03/27 5 | - Fix calculation of pause length in LEGO PF protocol [PR #427](https://github.com/z3t0/Arduino-IRremote/pull/427) 6 | 7 | ## 2.2.2 - 2017/01/20 8 | - Fixed naming bug [PR #398](https://github.com/z3t0/Arduino-IRremote/pull/398) 9 | 10 | ## 2.2.1 - 2016/07/27 11 | - Added tests for Lego Power Functions Protocol [PR #336](https://github.com/z3t0/Arduino-IRremote/pull/336) 12 | 13 | ## 2.2.0 - 2016/06/28 14 | - Added support for ATmega8535 15 | - Added support for ATmega16 16 | - Added support for ATmega32 17 | - Added support for ATmega164 18 | - Added support for ATmega324 19 | - Added support for ATmega644 20 | - Added support for ATmega1284 21 | - Added support for ATmega64 22 | - Added support for ATmega128 23 | 24 | [PR](https://github.com/z3t0/Arduino-IRremote/pull/324) 25 | 26 | ## 2.1.1 - 2016/05/04 27 | - Added Lego Power Functions Protocol [PR #309](https://github.com/z3t0/Arduino-IRremote/pull/309) 28 | 29 | ## 2.1.0 - 2016/02/20 30 | - Improved Debugging [PR #258](https://github.com/z3t0/Arduino-IRremote/pull/258) 31 | - Display TIME instead of TICKS [PR #258](https://github.com/z3t0/Arduino-IRremote/pull/258) 32 | 33 | ## 2.0.4 - 2016/02/20 34 | - Add Panasonic and JVC to IRrecord example [PR](https://github.com/z3t0/Arduino-IRremote/pull/54) 35 | 36 | ## 2.0.3 - 2016/02/20 37 | - Change IRSend Raw parameter to const [PR](https://github.com/z3t0/Arduino-IRremote/pull/227) 38 | 39 | ## 2.0.2 - 2015/12/02 40 | - Added IRremoteInfo Sketch - [PR](https://github.com/z3t0/Arduino-IRremote/pull/241) 41 | - Enforcing changelog.md 42 | 43 | ## 2.0.1 - 2015/07/26 - [Release](https://github.com/shirriff/Arduino-IRremote/releases/tag/BETA) 44 | ### Changes 45 | - Updated README 46 | - Updated Contributors 47 | - Fixed #110 Mess 48 | - Created Gitter Room 49 | - Added Gitter Badge 50 | - Standardised Code Base 51 | - Clean Debug Output 52 | - Optimized Send Loops 53 | - Modularized Design 54 | - Optimized and Updated Examples 55 | - Improved Documentation 56 | - Fixed and Improved many coding errors 57 | - Fixed Aiwa RC-T501 Decoding 58 | - Fixed Interrupt on ATmega8 59 | - Switched to Stable Release of @PlatformIO 60 | 61 | ### Additions 62 | - Added Aiwa RC-T501 Protocol 63 | - Added Denon Protocol 64 | - Added Pronto Support 65 | - Added Library Properties 66 | - Added Template For New Protocols 67 | - Added this changelog 68 | - Added Teensy LC Support 69 | - Added ATtiny84 Support 70 | - Added ATtiny85 Support 71 | - Added isIdle method 72 | 73 | ### Deletions 74 | - Removed (Fixed) #110 75 | - Broke Teensy 3 / 3.1 Support 76 | 77 | ### Not Working 78 | - Teensy 3 / 3.1 Support is in Development 79 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/irRecv.cpp: -------------------------------------------------------------------------------- 1 | #include "IRremote.h" 2 | #include "IRremoteInt.h" 3 | 4 | #ifdef IR_TIMER_USE_ESP32 5 | hw_timer_t *timer; 6 | void IRTimer(); // defined in IRremote.cpp 7 | #endif 8 | 9 | //+============================================================================= 10 | // Decodes the received IR message 11 | // Returns 0 if no data ready, 1 if data ready. 12 | // Results of decoding are stored in results 13 | // 14 | int IRrecv::decode (decode_results *results) 15 | { 16 | results->rawbuf = irparams.rawbuf; 17 | results->rawlen = irparams.rawlen; 18 | 19 | results->overflow = irparams.overflow; 20 | 21 | if (irparams.rcvstate != STATE_STOP) return false ; 22 | 23 | #if DECODE_NEC 24 | DBG_PRINTLN("Attempting NEC decode"); 25 | if (decodeNEC(results)) return true ; 26 | #endif 27 | 28 | #if DECODE_SONY 29 | DBG_PRINTLN("Attempting Sony decode"); 30 | if (decodeSony(results)) return true ; 31 | #endif 32 | 33 | #if DECODE_SANYO 34 | DBG_PRINTLN("Attempting Sanyo decode"); 35 | if (decodeSanyo(results)) return true ; 36 | #endif 37 | 38 | #if DECODE_MITSUBISHI 39 | DBG_PRINTLN("Attempting Mitsubishi decode"); 40 | if (decodeMitsubishi(results)) return true ; 41 | #endif 42 | 43 | #if DECODE_RC5 44 | DBG_PRINTLN("Attempting RC5 decode"); 45 | if (decodeRC5(results)) return true ; 46 | #endif 47 | 48 | #if DECODE_RC6 49 | DBG_PRINTLN("Attempting RC6 decode"); 50 | if (decodeRC6(results)) return true ; 51 | #endif 52 | 53 | #if DECODE_PANASONIC 54 | DBG_PRINTLN("Attempting Panasonic decode"); 55 | if (decodePanasonic(results)) return true ; 56 | #endif 57 | 58 | #if DECODE_LG 59 | DBG_PRINTLN("Attempting LG decode"); 60 | if (decodeLG(results)) return true ; 61 | #endif 62 | 63 | #if DECODE_JVC 64 | DBG_PRINTLN("Attempting JVC decode"); 65 | if (decodeJVC(results)) return true ; 66 | #endif 67 | 68 | #if DECODE_SAMSUNG 69 | DBG_PRINTLN("Attempting SAMSUNG decode"); 70 | if (decodeSAMSUNG(results)) return true ; 71 | #endif 72 | 73 | #if DECODE_WHYNTER 74 | DBG_PRINTLN("Attempting Whynter decode"); 75 | if (decodeWhynter(results)) return true ; 76 | #endif 77 | 78 | #if DECODE_AIWA_RC_T501 79 | DBG_PRINTLN("Attempting Aiwa RC-T501 decode"); 80 | if (decodeAiwaRCT501(results)) return true ; 81 | #endif 82 | 83 | #if DECODE_DENON 84 | DBG_PRINTLN("Attempting Denon decode"); 85 | if (decodeDenon(results)) return true ; 86 | #endif 87 | 88 | #if DECODE_LEGO_PF 89 | DBG_PRINTLN("Attempting Lego Power Functions"); 90 | if (decodeLegoPowerFunctions(results)) return true ; 91 | #endif 92 | 93 | // decodeHash returns a hash on any input. 94 | // Thus, it needs to be last in the list. 95 | // If you add any decodes, add them before this. 96 | if (decodeHash(results)) return true ; 97 | 98 | // Throw away and start over 99 | resume(); 100 | return false; 101 | } 102 | 103 | //+============================================================================= 104 | IRrecv::IRrecv (int recvpin) 105 | { 106 | irparams.recvpin = recvpin; 107 | irparams.blinkflag = 0; 108 | } 109 | 110 | IRrecv::IRrecv (int recvpin, int blinkpin) 111 | { 112 | irparams.recvpin = recvpin; 113 | irparams.blinkpin = blinkpin; 114 | pinMode(blinkpin, OUTPUT); 115 | irparams.blinkflag = 0; 116 | } 117 | 118 | 119 | 120 | //+============================================================================= 121 | // initialization 122 | // 123 | void IRrecv::enableIRIn ( ) 124 | { 125 | // Interrupt Service Routine - Fires every 50uS 126 | #ifdef ESP32 127 | // ESP32 has a proper API to setup timers, no weird chip macros needed 128 | // simply call the readable API versions :) 129 | // 3 timers, choose #1, 80 divider nanosecond precision, 1 to count up 130 | timer = timerBegin(1, 80, 1); 131 | timerAttachInterrupt(timer, &IRTimer, 1); 132 | // every 50ns, autoreload = true 133 | timerAlarmWrite(timer, 50, true); 134 | timerAlarmEnable(timer); 135 | #else 136 | cli(); 137 | // Setup pulse clock timer interrupt 138 | // Prescale /8 (16M/8 = 0.5 microseconds per tick) 139 | // Therefore, the timer interval can range from 0.5 to 128 microseconds 140 | // Depending on the reset value (255 to 0) 141 | TIMER_CONFIG_NORMAL(); 142 | 143 | // Timer2 Overflow Interrupt Enable 144 | TIMER_ENABLE_INTR; 145 | 146 | TIMER_RESET; 147 | 148 | sei(); // enable interrupts 149 | #endif 150 | 151 | // Initialize state machine variables 152 | irparams.rcvstate = STATE_IDLE; 153 | irparams.rawlen = 0; 154 | 155 | // Set pin modes 156 | pinMode(irparams.recvpin, INPUT); 157 | } 158 | 159 | //+============================================================================= 160 | // Enable/disable blinking of pin 13 on IR processing 161 | // 162 | void IRrecv::blink13 (int blinkflag) 163 | { 164 | irparams.blinkflag = blinkflag; 165 | if (blinkflag) pinMode(BLINKLED, OUTPUT) ; 166 | } 167 | 168 | //+============================================================================= 169 | // Return if receiving new IR signals 170 | // 171 | bool IRrecv::isIdle ( ) 172 | { 173 | return (irparams.rcvstate == STATE_IDLE || irparams.rcvstate == STATE_STOP) ? true : false; 174 | } 175 | //+============================================================================= 176 | // Restart the ISR state machine 177 | // 178 | void IRrecv::resume ( ) 179 | { 180 | irparams.rcvstate = STATE_IDLE; 181 | irparams.rawlen = 0; 182 | } 183 | 184 | //+============================================================================= 185 | // hashdecode - decode an arbitrary IR code. 186 | // Instead of decoding using a standard encoding scheme 187 | // (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value. 188 | // 189 | // The algorithm: look at the sequence of MARK signals, and see if each one 190 | // is shorter (0), the same length (1), or longer (2) than the previous. 191 | // Do the same with the SPACE signals. Hash the resulting sequence of 0's, 192 | // 1's, and 2's to a 32-bit value. This will give a unique value for each 193 | // different code (probably), for most code systems. 194 | // 195 | // http://arcfn.com/2010/01/using-arbitrary-remotes-with-arduino.html 196 | // 197 | // Compare two tick values, returning 0 if newval is shorter, 198 | // 1 if newval is equal, and 2 if newval is longer 199 | // Use a tolerance of 20% 200 | // 201 | int IRrecv::compare (unsigned int oldval, unsigned int newval) 202 | { 203 | if (newval < oldval * .8) return 0 ; 204 | else if (oldval < newval * .8) return 2 ; 205 | else return 1 ; 206 | } 207 | 208 | //+============================================================================= 209 | // Use FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param 210 | // Converts the raw code values into a 32-bit hash code. 211 | // Hopefully this code is unique for each button. 212 | // This isn't a "real" decoding, just an arbitrary value. 213 | // 214 | #define FNV_PRIME_32 16777619 215 | #define FNV_BASIS_32 2166136261 216 | 217 | long IRrecv::decodeHash (decode_results *results) 218 | { 219 | long hash = FNV_BASIS_32; 220 | 221 | // Require at least 6 samples to prevent triggering on noise 222 | if (results->rawlen < 6) return false ; 223 | 224 | for (int i = 1; (i + 2) < results->rawlen; i++) { 225 | int value = compare(results->rawbuf[i], results->rawbuf[i+2]); 226 | // Add value into the hash 227 | hash = (hash * FNV_PRIME_32) ^ value; 228 | } 229 | 230 | results->value = hash; 231 | results->bits = 32; 232 | results->decode_type = UNKNOWN; 233 | 234 | return true; 235 | } 236 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/ir_NEC.cpp: -------------------------------------------------------------------------------- 1 | #include "IRremote.h" 2 | #include "IRremoteInt.h" 3 | 4 | //============================================================================== 5 | // N N EEEEE CCCC 6 | // NN N E C 7 | // N N N EEE C 8 | // N NN E C 9 | // N N EEEEE CCCC 10 | //============================================================================== 11 | 12 | #define NEC_BITS 32 13 | #define NEC_HDR_MARK 9000 14 | #define NEC_HDR_SPACE 4500 15 | #define NEC_BIT_MARK 560 16 | #define NEC_ONE_SPACE 1690 17 | #define NEC_ZERO_SPACE 560 18 | #define NEC_RPT_SPACE 2250 19 | 20 | //+============================================================================= 21 | #if SEND_NEC 22 | void IRsend::sendNEC (unsigned long data, int nbits) 23 | { 24 | // Set IR carrier frequency 25 | enableIROut(38); 26 | 27 | // Header 28 | mark(NEC_HDR_MARK); 29 | space(NEC_HDR_SPACE); 30 | 31 | // Data 32 | for (unsigned long mask = 1UL << (nbits - 1); mask; mask >>= 1) { 33 | if (data & mask) { 34 | mark(NEC_BIT_MARK); 35 | space(NEC_ONE_SPACE); 36 | } else { 37 | mark(NEC_BIT_MARK); 38 | space(NEC_ZERO_SPACE); 39 | } 40 | } 41 | 42 | // Footer 43 | mark(NEC_BIT_MARK); 44 | space(0); // Always end with the LED off 45 | } 46 | #endif 47 | 48 | //+============================================================================= 49 | // NECs have a repeat only 4 items long 50 | // 51 | #if DECODE_NEC 52 | bool IRrecv::decodeNEC (decode_results *results) 53 | { 54 | long data = 0; // We decode in to here; Start with nothing 55 | int offset = 1; // Index in to results; Skip first entry!? 56 | 57 | // Check header "mark" 58 | if (!MATCH_MARK(results->rawbuf[offset], NEC_HDR_MARK)) return false ; 59 | offset++; 60 | 61 | // Check for repeat 62 | if ( (irparams.rawlen == 4) 63 | && MATCH_SPACE(results->rawbuf[offset ], NEC_RPT_SPACE) 64 | && MATCH_MARK (results->rawbuf[offset+1], NEC_BIT_MARK ) 65 | ) { 66 | results->bits = 0; 67 | results->value = REPEAT; 68 | results->decode_type = NEC; 69 | return true; 70 | } 71 | 72 | // Check we have enough data 73 | if (irparams.rawlen < (2 * NEC_BITS) + 4) return false ; 74 | 75 | // Check header "space" 76 | if (!MATCH_SPACE(results->rawbuf[offset], NEC_HDR_SPACE)) return false ; 77 | offset++; 78 | 79 | // Build the data 80 | for (int i = 0; i < NEC_BITS; i++) { 81 | // Check data "mark" 82 | if (!MATCH_MARK(results->rawbuf[offset], NEC_BIT_MARK)) return false ; 83 | offset++; 84 | // Suppend this bit 85 | if (MATCH_SPACE(results->rawbuf[offset], NEC_ONE_SPACE )) data = (data << 1) | 1 ; 86 | else if (MATCH_SPACE(results->rawbuf[offset], NEC_ZERO_SPACE)) data = (data << 1) | 0 ; 87 | else return false ; 88 | offset++; 89 | } 90 | 91 | // Success 92 | results->bits = NEC_BITS; 93 | results->value = data; 94 | results->decode_type = NEC; 95 | 96 | return true; 97 | } 98 | #endif 99 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For IRremote 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | decode_results KEYWORD1 10 | IRrecv KEYWORD1 11 | IRsend KEYWORD1 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | blink13 KEYWORD2 18 | decode KEYWORD2 19 | enableIRIn KEYWORD2 20 | resume KEYWORD2 21 | enableIROut KEYWORD2 22 | sendNEC KEYWORD2 23 | sendSony KEYWORD2 24 | sendSanyo KEYWORD2 25 | sendMitsubishi KEYWORD2 26 | sendRaw KEYWORD2 27 | sendRC5 KEYWORD2 28 | sendRC6 KEYWORD2 29 | sendDISH KEYWORD2 30 | sendSharp KEYWORD2 31 | sendSharpRaw KEYWORD2 32 | sendPanasonic KEYWORD2 33 | sendJVC KEYWORD2 34 | sendLG KEYWORD2 35 | 36 | ####################################### 37 | # Constants (LITERAL1) 38 | ####################################### 39 | 40 | NEC LITERAL1 41 | SONY LITERAL1 42 | SANYO LITERAL1 43 | MITSUBISHI LITERAL1 44 | RC5 LITERAL1 45 | RC6 LITERAL1 46 | DISH LITERAL1 47 | SHARP LITERAL1 48 | PANASONIC LITERAL1 49 | JVC LITERAL1 50 | LG LITERAL1 51 | AIWA_RC_T501 LITERAL1 52 | UNKNOWN LITERAL1 53 | REPEAT LITERAL1 54 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "IRremote", 3 | "keywords": "infrared, ir, remote", 4 | "description": "Send and receive infrared signals with multiple protocols", 5 | "repository": 6 | { 7 | "type": "git", 8 | "url": "https://github.com/z3t0/Arduino-IRremote.git" 9 | }, 10 | "version": "2.3.3", 11 | "frameworks": "arduino", 12 | "platforms": "atmelavr", 13 | "authors" : 14 | [ 15 | { 16 | "name":"Rafi Khan", 17 | "email":"zetoslab@gmail.com" 18 | }, 19 | { 20 | "name":"Ken Shirriff", 21 | "email":"ken.shirriff@gmail.com" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /lib/IRremote_ID4/library.properties: -------------------------------------------------------------------------------- 1 | name=IRremote 2 | version=2.2.3 3 | author=shirriff 4 | maintainer=shirriff 5 | sentence=Send and receive infrared signals with multiple protocols 6 | paragraph=Send and receive infrared signals with multiple protocols 7 | category=Signal Input/Output 8 | url=https://github.com/shirriff/Arduino-IRremote.git 9 | architectures=* 10 | -------------------------------------------------------------------------------- /lib/LED/LED.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace LED { 8 | 9 | const uint8_t NUM_STRIPS = 8; /* Don't try to change this; OctoWS2811 always assumes 8 */ 10 | 11 | enum Pattern pattern = patternTest; 12 | 13 | CRGB rgbarray[NUM_STRIPS * MAX_LEDS_PER_STRIP]; 14 | 15 | bool fPowerOn = true; 16 | bool fOpenPixelClientConnected = false; 17 | CRGB rgbSolidColor; 18 | uint32_t tmFrameStart; 19 | unsigned int cFrames; 20 | CResizeableOctoWS2811Controller controller; 21 | uint16_t cLEDsPerStrip; 22 | 23 | void setup() { 24 | 25 | tmFrameStart = millis(); 26 | cFrames = 0; 27 | 28 | FastLED.setBrightness(0); 29 | FastLED.addLeds(&controller, rgbarray, MAX_LEDS_PER_STRIP); 30 | cLEDsPerStrip = MAX_LEDS_PER_STRIP; 31 | 32 | load_persistant_data(); 33 | } 34 | 35 | void load_persistant_data() { 36 | 37 | FastLED.setMaxPowerInMilliWatts(Persist::data.max_power); 38 | FastLED.setBrightness(Persist::data.brightness); 39 | FastLED.setCorrection(Persist::data.color_correction); 40 | FastLED.setTemperature(Persist::data.color_temperature); 41 | pattern = (enum Pattern) Persist::data.pattern; 42 | rgbSolidColor = Persist::data.rgbSolidColor; 43 | dbgprintf("Color order is %c\n", Persist::data.first_color); 44 | controller.ChangeColorOrder(Persist::data.first_color); 45 | 46 | } 47 | 48 | void loop() { 49 | 50 | if (!fPowerOn) 51 | { 52 | FastLED.showColor(CRGB::Black);; 53 | return; 54 | } 55 | 56 | if (fOpenPixelClientConnected) 57 | { 58 | // let the protocol drive the LEDs 59 | return; 60 | } 61 | 62 | if (pattern == patternSolid) 63 | { 64 | FastLED.showColor(rgbSolidColor); 65 | return; 66 | } 67 | 68 | // This is the test pattern: 69 | 70 | static uint8_t hue = 0; 71 | 72 | for(int i = 0; i < NUM_STRIPS; i++) { 73 | for(int j = 0; j < cLEDsPerStrip; j++) { 74 | rgbarray[(i*cLEDsPerStrip) + j] = CHSV((32*i) + hue+j,192,255); 75 | } 76 | } 77 | 78 | // Set the first n leds on each strip to show which strip it is 79 | for(int i = 0; i < NUM_STRIPS; i++) { 80 | for(int j = 0; j <= i; j++) { 81 | rgbarray[(i*cLEDsPerStrip) + j] = CRGB(0x65,0x43,0x21); 82 | } 83 | } 84 | 85 | hue++; 86 | 87 | // instead of calling show(), we call delay() which guarantees to call show() 88 | // but also gives FastLED a chance to do some temporal dithering. 89 | FastLED.delay(1); 90 | CalculateFrameRate(); 91 | 92 | } 93 | 94 | void CalculateFrameRate() 95 | { 96 | // frame rate calc 97 | cFrames++; 98 | if (millis() > (tmFrameStart + 1000)) 99 | { 100 | char rgchBuf[CB_DISPLAY_LINE]; 101 | sprintf(rgchBuf,"Frame rate: %u\n", cFrames); 102 | Display::status(2,rgchBuf); 103 | cFrames = 0; 104 | tmFrameStart = millis(); 105 | } 106 | } 107 | 108 | void setSolidColor(CRGB rgb) { 109 | 110 | pattern = patternSolid; 111 | rgbSolidColor = rgb; 112 | 113 | Persist::data.pattern = (uint8_t) pattern; 114 | Persist::data.rgbSolidColor = rgb; 115 | 116 | } 117 | 118 | uint8_t brighter() { 119 | uint16_t b = FastLED.getBrightness(); 120 | 121 | if (b <= 255) 122 | { 123 | if (b > 128) b += 32; 124 | else if (b > 64) b += 16; 125 | else if (b > 32) b += 8; 126 | else if (b > 16) b += 4; 127 | else if (b > 8) b += 2; 128 | else b++; 129 | } 130 | if (b > 255) b = 255; 131 | 132 | FastLED.setBrightness(b); 133 | Persist::data.brightness = b; 134 | return b; 135 | } 136 | 137 | uint8_t dimmer() { 138 | uint8_t b = FastLED.getBrightness(); 139 | if (b > 1) 140 | { 141 | if (b <= 8) b--; 142 | else if (b <= 16) b -= 2; 143 | else if (b <= 32) b -= 4; 144 | else if (b <= 64) b -= 8; 145 | else if (b <= 128) b -= 16; 146 | else b -= 32; 147 | } 148 | 149 | FastLED.setBrightness(b); 150 | Persist::data.brightness = b; 151 | return b; 152 | } 153 | 154 | void testPattern() { 155 | 156 | pattern = patternTest; 157 | Persist::data.pattern = (uint8_t) pattern; 158 | 159 | } 160 | 161 | bool togglePower() { 162 | 163 | fPowerOn = !fPowerOn; 164 | return fPowerOn; 165 | 166 | } 167 | 168 | void openPixelClientConnection(bool f) { 169 | 170 | fOpenPixelClientConnected = f; 171 | 172 | } 173 | 174 | CRGB* getRGBAddress(uint8_t iStrip, uint32_t nLEDs) { 175 | 176 | if (nLEDs != cLEDsPerStrip) 177 | { 178 | dbgprintf("OpenPixelControl has data for %d pixels but we only support %d\n", nLEDs, cLEDsPerStrip); 179 | controller.ChangeSize( nLEDs ); 180 | cLEDsPerStrip = nLEDs; 181 | } 182 | return rgbarray + (iStrip * cLEDsPerStrip); 183 | 184 | } 185 | 186 | 187 | } 188 | -------------------------------------------------------------------------------- /lib/LED/LED.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Code for driving 8 LED strips in parallel using FastLED's 4 | // OctoWS2811 support 5 | // 6 | // Best documentation: https://github.com/FastLED/FastLED/wiki/Parallel-Output 7 | 8 | #include 9 | #include 10 | #define USE_OCTOWS2811 11 | #include 12 | #define FASTLED_INTERNAL 13 | #include 14 | 15 | namespace LED { 16 | 17 | enum Pattern { patternSolid = 0, patternTest }; // more patterns can be added here 18 | 19 | void setup(); 20 | void load_persistant_data(); 21 | void loop(); 22 | 23 | void setSolidColor(CRGB rgb); 24 | uint8_t brighter(); 25 | uint8_t dimmer(); 26 | void testPattern(); 27 | bool togglePower(); 28 | void openPixelClientConnection(bool f); 29 | CRGB* getRGBAddress(uint8_t iStrip, uint32_t nLEDs); 30 | void CalculateFrameRate(); 31 | 32 | } -------------------------------------------------------------------------------- /lib/OpenPixelControl/OpenPixelControl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | // implements http://openpixelcontrol.org/ 8 | 9 | namespace OpenPixelControl { 10 | 11 | enum Status { ready, // Listening, ready for a client to connect 12 | connected // A client has connected 13 | }; 14 | 15 | Status status; 16 | EthernetClient client; 17 | EthernetServer server(OPEN_PIXEL_PORT); 18 | 19 | // 20 | // OPC sends each channel separately. However FastLED.show() 21 | // updates *every* LED strand. In an 8 strand environment that is 8 times 22 | // too slow. 23 | // 24 | // Therefore, we don't call .show() until the highest channel seen 25 | // so far has been received. The first frame will run slowly but after that 26 | // it will speed up and only call .show() after the final channel data 27 | // has arrived. 28 | // 29 | uint8_t ixHighestChannelSeen = 0; // 0: we don't know how many channels the client is sending 30 | bool bNeedToShow = false; // true if we are going to refresh the display 31 | 32 | void setup() { 33 | 34 | server.begin(); 35 | status = ready; 36 | 37 | } 38 | 39 | // ixHeader is the index we are at in the current OPC message header 40 | // for example, ixHeader == 0 means we have not seen any bytes yet 41 | // Since the message header is 4 bytes, ixHeader == 4 means we have read the header 42 | // and are now ready to read the body 43 | 44 | uint32_t ixHeader = 0; 45 | uint8_t rgHeader[4]; 46 | 47 | // ixRGB is the index we are at in the CRGB array 48 | uint32_t ixRGB = 0; 49 | 50 | // when the message has been read, it will be parsed into these three variables: 51 | uint8_t channel = 0; 52 | uint8_t command = 0; 53 | uint16_t cbMessage = 0; 54 | 55 | // True if the channel, command, or cbMessage makes it impossible to 56 | // parse this message -- we're just going to swallow it. 57 | bool bThrowAwayMessage = false; 58 | 59 | void loop() { 60 | 61 | if (status == ready) 62 | { 63 | 64 | // listen for connections 65 | client = server.available(); 66 | if (client) { 67 | 68 | dbgprintf("Client connected\n"); 69 | Display::status(3, "OpenPixel Connected"); 70 | LED::openPixelClientConnection(true); 71 | status = connected; 72 | ixHighestChannelSeen = 0; 73 | ixHeader = 0; 74 | ixRGB = 0; 75 | memset( (void*) rgHeader, 0, sizeof(rgHeader)); 76 | } 77 | } 78 | 79 | if (status == connected) 80 | { 81 | if (!client.connected()) 82 | { 83 | // client has disconnected! 84 | client.stop(); 85 | dbgprintf("client disconnected\n"); 86 | Display::status(3, ""); 87 | LED::openPixelClientConnection(false); 88 | status = ready; 89 | return; 90 | } 91 | 92 | // client is still connected -- read bytes! 93 | read_available(); 94 | 95 | } 96 | 97 | } 98 | 99 | 100 | void read_available() { 101 | 102 | // how many bytes are even available to read? 103 | size_t cbAvail = client.available(); 104 | if (cbAvail == 0) 105 | return; 106 | 107 | if (ixHeader < 4) 108 | { 109 | // still need to read the header 110 | 111 | // read the MIN of 112 | // -- the number of bytes in the header remaining, i.e. (4 - ixHeader) 113 | // -- the number of bytes we actually have (cbAvail) 114 | 115 | ixHeader += client.read(rgHeader + ixHeader, min(4 - ixHeader, cbAvail)); 116 | 117 | if (ixHeader < 4) 118 | // go home and wait for the rest of the header 119 | return; 120 | 121 | if (ixHeader > 4) 122 | dbgprintf("Alert! Read past end of header -- this should never happen\n"); 123 | 124 | if (ixHeader == 4) 125 | { 126 | channel = rgHeader[0]; 127 | command = rgHeader[1]; 128 | cbMessage = rgHeader[2] << 8 | rgHeader[3]; 129 | ixRGB = 0; // ready to start reading RGB values 130 | 131 | // 132 | // Anything wrong with the message? 133 | // 134 | bThrowAwayMessage = false; 135 | 136 | char rgchError[CB_DISPLAY_LINE]; 137 | 138 | if (command != 0) 139 | { 140 | dbgprintf("OpenPixelControl - command %d not supported\n", command); 141 | sprintf(rgchError, "OPC BAD CMD %d", command); 142 | Display::status(3, rgchError); 143 | bThrowAwayMessage = true; 144 | } 145 | else if (channel < 1 || channel > 8) 146 | { 147 | dbgprintf("OpenPixelControl - channel %d not supported\n", channel); 148 | sprintf(rgchError, "OPC BAD CHAN %d", channel); 149 | Display::status(3, rgchError); 150 | channel = 1; 151 | bThrowAwayMessage = true; 152 | } 153 | else if (cbMessage > (3 * MAX_LEDS_PER_STRIP)) 154 | { 155 | dbgprintf("OpenPixelControl - too many pixels per strip (%d)\n", cbMessage / 3); 156 | Display::status(3, "OPC TOO MANY PIXELS"); 157 | bThrowAwayMessage = true; 158 | } 159 | 160 | if (channel >= ixHighestChannelSeen) 161 | { 162 | bNeedToShow = true; 163 | ixHighestChannelSeen = channel; 164 | } 165 | 166 | } 167 | } 168 | 169 | // Now ixHeader is either < 4 -- still need to read more -- in which case, we can come back later, 170 | // or == 4, -- header is here -- in which case we are processing it. 171 | 172 | if (ixHeader < 4) 173 | return; 174 | 175 | if (ixHeader != 4) 176 | { 177 | dbgprintf("Alert! impossible header value\n"); 178 | } 179 | 180 | 181 | if (cbMessage == 0) 182 | { 183 | // we have finished eating the message 184 | ixHeader = 0; 185 | ixRGB = 0; 186 | memset( (void*) rgHeader, 0, sizeof(rgHeader)); 187 | return; 188 | } 189 | 190 | cbAvail = client.available(); 191 | if (cbAvail == 0) 192 | return; 193 | 194 | // Read the MIN of 195 | // 196 | // -- the number of bytes available 197 | // -- the number of bytes that remain to be read (cbMessage - ixRGB) 198 | 199 | uint8_t *pstrip = (uint8_t*) LED::getRGBAddress(channel-1, cbMessage / 3); 200 | size_t cbToRead = min(cbAvail, cbMessage - ixRGB); 201 | 202 | if (bThrowAwayMessage) 203 | { 204 | while (cbToRead) 205 | { 206 | (void) client.read(); 207 | cbToRead--; 208 | ixRGB++; 209 | } 210 | 211 | if (ixRGB >= cbMessage) 212 | { 213 | ixHeader = ixRGB = 0; 214 | } 215 | return; 216 | } 217 | 218 | uint32_t cbRead = client.read(pstrip + ixRGB, cbToRead); 219 | ixRGB += cbRead; 220 | 221 | if (ixRGB >= cbMessage) 222 | { 223 | // done! 224 | if (bNeedToShow) { 225 | FastLED.show(); 226 | LED::CalculateFrameRate(); 227 | bNeedToShow = false; 228 | } 229 | ixHeader = ixRGB = 0; 230 | } 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /lib/OpenPixelControl/OpenPixelControl.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | // implements a simple version of Open Pixel Control protocol 6 | // See "doc/OpenPixelControl.html" for the spec 7 | // 8 | // Note: 9 | // 10 | // OpenPixelControl is not the greatest protocol, but 11 | // we will try to support it well enough for L.E.D. Lab 12 | // (in FadeCandy mode). 13 | // 14 | 15 | 16 | namespace OpenPixelControl { 17 | 18 | void setup(); 19 | void loop(); 20 | void read_available(); 21 | 22 | } -------------------------------------------------------------------------------- /lib/Persist/Persist.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace Persist { 6 | 7 | persistence_t data; 8 | 9 | void setup() { 10 | 11 | // set some default values 12 | 13 | memset(&data, 0, sizeof(data)); 14 | data.cb = sizeof(data); 15 | data.rgbSolidColor = CRGB::Black; 16 | data.pattern = (uint8_t) 1; // LED::patternTest 17 | data.brightness = BRIGHTNESS; 18 | data.max_power = 1000000; // mw 19 | data.first_color = 'r'; 20 | data.color_correction = LEDColorCorrection::TypicalLEDStrip; 21 | data.color_temperature = ColorTemperature::UncorrectedTemperature; 22 | data.gamma_correction = false; 23 | data.static_ip = false; 24 | data.ip_addr[0] = 192; 25 | data.ip_addr[1] = 168; 26 | data.ip_addr[2] = 1; 27 | data.ip_addr[3] = 128; 28 | 29 | dbgprintf("Initializing Persisted Data\n"); 30 | 31 | byte bSig[2]; 32 | bSig[0] = EEPROM.read(0); 33 | bSig[1] = EEPROM.read(1); 34 | 35 | dbgprintf("Signature read - %d %d\n", bSig[0], bSig[1] ); 36 | if (bSig[0] == 'b' && bSig[1] == 'C') 37 | { 38 | // read EEPROM now - start with cb! 39 | uint16_t cbOnDisk = 0; 40 | uint8_t* pb = (uint8_t*) &cbOnDisk; 41 | pb[0] = EEPROM.read(2); 42 | pb[1] = EEPROM.read(3); 43 | 44 | dbgprintf("Structure on disk is %d bytes\n", cbOnDisk); 45 | 46 | // Don't read more than sizeof(data) or cbOnDisk 47 | uint8_t* pbData = (uint8_t*) &data; 48 | uint16_t cbToRead = min(cbOnDisk, sizeof(data)) - 2; // -2 because we're not reading cb again 49 | dbgprintf("\n"); 50 | dbgprintf("\n"); 51 | for (uint16_t i = 0; i < cbToRead; i++) 52 | { 53 | pbData[i + 2] = EEPROM.read( i + 4 ); // skip over signature and cb 54 | dbgprintf("%x ", pbData[i+2]); 55 | } 56 | dbgprintf("\n"); 57 | dbgprintf("\n"); 58 | 59 | } 60 | else 61 | { 62 | dbgprintf("Signature not found - not reading from EEPROM\n"); 63 | } 64 | 65 | dbgprintf("cb: %d color: %x,%x,%x pattern: %d brightness: %d\n" 66 | " max_power: %d first_color: %c color correction: %x\n" 67 | " color temperature: %x gamma correction: %d\n" 68 | " static ip: %d ip addr: %d.%d.%d.%d\n", 69 | data.cb, 70 | data.rgbSolidColor.r, 71 | data.rgbSolidColor.g, 72 | data.rgbSolidColor.b, 73 | data.pattern, 74 | data.brightness, 75 | data.max_power, 76 | data.first_color, 77 | data.color_correction, 78 | data.color_temperature, 79 | data.gamma_correction, 80 | data.static_ip, 81 | data.ip_addr[0], 82 | data.ip_addr[1], 83 | data.ip_addr[2], 84 | data.ip_addr[3] 85 | ); 86 | 87 | } 88 | 89 | void write() { 90 | 91 | dbgprintf("Persist::Write with %d bytes\n", data.cb); 92 | 93 | for (uint16_t i = 0; i < data.cb; i++) 94 | { 95 | uint8_t* pb = (uint8_t*) &data; 96 | EEPROM.write(i + 2, pb[i]); 97 | } 98 | // if we haven't crashed yet, write the signature marks 99 | EEPROM.write(0, 'b'); 100 | EEPROM.write(1, 'C'); 101 | 102 | dbgprintf("Persist::Write done\n"); 103 | } 104 | 105 | 106 | 107 | } -------------------------------------------------------------------------------- /lib/Persist/Persist.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Code for persisting configuration data to the Teensy EEPROM 4 | // 5 | // When we store things in EEPROM we store two bytes "bC" in the first 6 | // two bytes. If we ever read anything else there, we assume that 7 | // EEPROM is not initialized. 8 | // 9 | // Then we store a persistence_t structure, byte-for-byte. The 10 | // first uint16_t of the structure contains the size of the structure 11 | // as stored, in bytes. 12 | // 13 | 14 | #include 15 | #include 16 | #define FASTLED_INTERNAL 17 | #include 18 | 19 | 20 | namespace Persist { 21 | 22 | struct persistence_t { 23 | 24 | uint16_t cb; // Must always be sizeof(persistence_t) - for versioning 25 | 26 | CRGB rgbSolidColor; // current color to display 27 | uint8_t pattern; // whether we are in solid color mode (0) or test pattern (1) -- maps to enum Pattern in LED.cpp 28 | uint8_t brightness; // global brightness for fastled 29 | 30 | uint32_t max_power; // in milliwatts 31 | char first_color; // 'r' or 'g' will work 32 | uint32_t color_correction; 33 | uint32_t color_temperature; 34 | bool gamma_correction; // UNIMPLEMENTED 35 | 36 | bool static_ip; // false (default) = use DHCP. true = IP address in following field 37 | byte ip_addr[4]; // IP address for static IP 38 | 39 | }; 40 | 41 | extern persistence_t data; 42 | 43 | void setup(); 44 | void write(); 45 | 46 | } -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /lib/Remote/Remote.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace Remote { 7 | 8 | IRrecv irrecv(pinIRReceiver); 9 | decode_results results; 10 | unsigned long lastResult; // only valid if loop() returns true 11 | 12 | void setup() { 13 | irrecv.enableIRIn(); // Start the receiver 14 | // irrecv.blink13(true); /* conflicts with eth */ 15 | // Serial.println("Enabled IRin"); 16 | } 17 | 18 | bool loop() { 19 | 20 | if (irrecv.decode(&results)) { 21 | lastResult = results.value; 22 | irrecv.resume(); // Receive the next value 23 | return true; 24 | } 25 | else 26 | { 27 | return false; 28 | } 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /lib/Remote/Remote.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Code for responding to an IR remote control. 4 | // Uses IRRemote library (2.3.3) which works well with Teensy 3.2. 5 | // There are a lot of very cheap, 44-key IR remote controls (under $2 on aliexpress) 6 | // which have color, brightness, speed, power buttons that are perfect for a 7 | // project where you can just use a single branch controller. 8 | 9 | #include 10 | #include 11 | 12 | namespace Remote { 13 | 14 | void setup(); 15 | bool loop(); 16 | 17 | extern unsigned long lastResult; // only valid if loop() returns true 18 | 19 | } -------------------------------------------------------------------------------- /lib/ResizeableOctoWS2811Controller/ResizeableOctoWS2811Controller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // This is a version of the parallel, OctoWS2811Controller from FastLED 9 | // that I modified to be resizable. This means that we can allocate an array 10 | // of the full 550 pixels per strip (4400 total), but, at runtime, if 11 | // the OpenPixelController client sends us fewer pixels, we can show() them 12 | // really fast without spending time sending data for extra pixels. 13 | // 14 | // I am particularly keen to implement this feature because it means that 15 | // on shorter strips, we can still take advantage of FastLED's temporal dithering 16 | // for better colors at lower brightnesses. 17 | 18 | class CResizeableOctoWS2811Controller : public CPixelLEDController 19 | { 20 | OctoWS2811 *pocto; 21 | uint8_t *drawbuffer, *framebuffer; 22 | int config = WS2811_RGB | WS2811_800kHz; 23 | 24 | void _init(int nLeds) 25 | { 26 | if (pocto == NULL) 27 | { 28 | 29 | drawbuffer = (uint8_t *)malloc(nLeds * 8 * 3); 30 | framebuffer = (uint8_t *)malloc(nLeds * 8 * 3); 31 | 32 | // byte ordering is handled in show by the pixel controller 33 | 34 | pocto = new OctoWS2811(nLeds, framebuffer, drawbuffer, config); 35 | pocto->begin(); 36 | } 37 | } 38 | 39 | public: 40 | CResizeableOctoWS2811Controller() { pocto = NULL; } 41 | virtual int size() { return CLEDController::size() * 8; } 42 | 43 | virtual void init() 44 | { /* do nothing yet */ 45 | } 46 | 47 | typedef union { 48 | uint8_t bytes[8]; 49 | uint32_t raw[2]; 50 | } Lines; 51 | 52 | virtual void showPixels(PixelController &pixels) 53 | { 54 | _init(pixels.size()); 55 | 56 | uint8_t *pData = drawbuffer; 57 | 58 | // 59 | // The only difference between RGB and GRB color mode 60 | // is whether we call loadAndScale1 first or loadAndScale0 first. 61 | // 62 | // For performance reasons, do not "optimize" this code by moving the if 63 | // statement into the loop! 64 | // 65 | if (config & WS2811_GRB) 66 | { 67 | while (pixels.has(1)) 68 | { 69 | Lines b; 70 | 71 | for (int i = 0; i < 8; i++) 72 | { 73 | b.bytes[i] = pixels.loadAndScale1(i); 74 | } 75 | transpose8x1_MSB(b.bytes, pData); 76 | pData += 8; 77 | for (int i = 0; i < 8; i++) 78 | { 79 | b.bytes[i] = pixels.loadAndScale0(i); 80 | } 81 | transpose8x1_MSB(b.bytes, pData); 82 | pData += 8; 83 | for (int i = 0; i < 8; i++) 84 | { 85 | b.bytes[i] = pixels.loadAndScale2(i); 86 | } 87 | transpose8x1_MSB(b.bytes, pData); 88 | pData += 8; 89 | pixels.stepDithering(); 90 | pixels.advanceData(); 91 | } 92 | } 93 | else 94 | { 95 | while (pixels.has(1)) 96 | { 97 | Lines b; 98 | 99 | for (int i = 0; i < 8; i++) 100 | { 101 | b.bytes[i] = pixels.loadAndScale0(i); 102 | } 103 | transpose8x1_MSB(b.bytes, pData); 104 | pData += 8; 105 | for (int i = 0; i < 8; i++) 106 | { 107 | b.bytes[i] = pixels.loadAndScale1(i); 108 | } 109 | transpose8x1_MSB(b.bytes, pData); 110 | pData += 8; 111 | for (int i = 0; i < 8; i++) 112 | { 113 | b.bytes[i] = pixels.loadAndScale2(i); 114 | } 115 | transpose8x1_MSB(b.bytes, pData); 116 | pData += 8; 117 | pixels.stepDithering(); 118 | pixels.advanceData(); 119 | } 120 | } 121 | 122 | pocto->show(); 123 | 124 | } 125 | 126 | // change the actual size of strips, at runtime! 127 | void ChangeSize(uint16_t nPixels) 128 | { 129 | if (!pocto) 130 | return; 131 | 132 | while (pocto->busy()) 133 | ; 134 | 135 | m_nLeds = nPixels; 136 | delete pocto; 137 | pocto = new OctoWS2811(nPixels, framebuffer, drawbuffer, config); 138 | pocto->begin(); 139 | 140 | dbgprintf("Now supporting %d pixels per strip\n", nPixels); 141 | } 142 | 143 | // change the RGB/GRB order of the strips, at runtime! 144 | void ChangeColorOrder(char first_color) { 145 | 146 | config = WS2811_800kHz; 147 | if (first_color == 'r') 148 | config |= WS2811_RGB; 149 | else if (first_color == 'g') 150 | config |= WS2811_GRB; 151 | 152 | } 153 | }; 154 | -------------------------------------------------------------------------------- /lib/TcpServer/MacAddress.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace MacAddress { 6 | 7 | uint8_t mac[6]; 8 | 9 | // http://forum.pjrc.com/threads/91-teensy-3-MAC-address 10 | void readpart(uint8_t word, uint8_t *mac, uint8_t offset) { 11 | 12 | cli(); 13 | 14 | FTFL_FCCOB0 = 0x41; // Selects the READONCE command 15 | FTFL_FCCOB1 = word; // read the given word of read once area 16 | 17 | // launch command and wait until complete 18 | FTFL_FSTAT = FTFL_FSTAT_CCIF; 19 | while(!(FTFL_FSTAT & FTFL_FSTAT_CCIF)); 20 | 21 | *(mac+offset) = FTFL_FCCOB5; // collect only the top three bytes, 22 | *(mac+offset+1) = FTFL_FCCOB6; // in the right orientation (big endian). 23 | *(mac+offset+2) = FTFL_FCCOB7; // Skip FTFL_FCCOB4 as it's always 0. 24 | 25 | sei(); 26 | } 27 | 28 | void read() { 29 | 30 | readpart(0xe,mac,0); 31 | readpart(0xf,mac,3); 32 | 33 | char rgch[22]; 34 | sprintf(rgch, "MAC %02X:%02X:%02X:%02X:%02X:%02X", 35 | mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 36 | Display::status(1, rgch); 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /lib/TcpServer/MacAddress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace MacAddress { 6 | 7 | extern uint8_t mac[6]; 8 | void read(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /lib/TcpServer/TcpServer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | namespace TcpServer { 14 | 15 | enum Status { uninitialized, noHardware, noCable, noDHCP, ready }; 16 | Status status = uninitialized; 17 | 18 | const char* rgchRetry = "Press AUTO to connect"; 19 | 20 | void setup() { 21 | 22 | MacAddress::read(); 23 | Ethernet.init(pinEthernetCS); 24 | 25 | // Wait up to 5 seconds for linkStatus to return LinkON , because 26 | // sometimes when the hardware is first 27 | // powering up it still returns LinkOFF even if there is a cable. 28 | 29 | Display::status(0, "Obtaining IP Address"); 30 | uint32_t mTimeout = millis() + 5000; 31 | while (millis() < mTimeout && Ethernet.linkStatus() == LinkOFF) 32 | { 33 | delay(10); 34 | } 35 | 36 | if (Ethernet.linkStatus() == LinkOFF) 37 | { 38 | dbgprintf("Ethernet link status OFF\n"); 39 | status = noCable; 40 | Display::status(0, "Cable Disconnected"); 41 | Display::status(3, rgchRetry); 42 | return; 43 | } 44 | 45 | if (Persist::data.static_ip) 46 | { 47 | dbgprintf("Connecting using static IP address\n"); 48 | Ethernet.begin(MacAddress::mac, Persist::data.ip_addr); 49 | 50 | // Check for Ethernet hardware present 51 | if (Ethernet.hardwareStatus() == EthernetNoHardware) 52 | { 53 | dbgprintf("No Ethernet Hardware\n"); 54 | status = noHardware; 55 | Display::status(0, "No ethernet port"); 56 | return; 57 | } 58 | 59 | } 60 | else 61 | { 62 | dbgprintf("DHCP beginning\n"); 63 | if (0 == Ethernet.begin(MacAddress::mac)) 64 | { 65 | 66 | // Check for Ethernet hardware present 67 | if (Ethernet.hardwareStatus() == EthernetNoHardware) 68 | { 69 | dbgprintf("No Ethernet Hardware\n"); 70 | status = noHardware; 71 | Display::status(0, "No ethernet port"); 72 | return; 73 | } 74 | 75 | dbgprintf("No DHCP Server\n"); 76 | status = noDHCP; 77 | Display::status(0, "No DHCP Server"); 78 | Display::status(3, rgchRetry); 79 | return; 80 | } 81 | } 82 | 83 | char rgch[22]; 84 | sprintf(rgch, "IP %d.%d.%d.%d", Ethernet.localIP()[0], Ethernet.localIP()[1], Ethernet.localIP()[2], Ethernet.localIP()[3]); 85 | Display::status(0, rgch); 86 | 87 | dbgprintf("DHCP IP address %d.%d.%d.%d\n", Ethernet.localIP()[0], Ethernet.localIP()[1], Ethernet.localIP()[2], Ethernet.localIP()[3] ); 88 | dbgprintf("DHCP Net Mask %d.%d.%d.%d\n", Ethernet.subnetMask()[0], Ethernet.subnetMask()[1], Ethernet.subnetMask()[2], Ethernet.subnetMask()[3] ); 89 | dbgprintf("DHCP Gateway %d.%d.%d.%d\n", Ethernet.gatewayIP()[0], Ethernet.gatewayIP()[1], Ethernet.gatewayIP()[2], Ethernet.gatewayIP()[3] ); 90 | 91 | OpenPixelControl::setup(); 92 | WebServer::setup(); 93 | status = ready; 94 | 95 | } 96 | 97 | 98 | void loop() { 99 | 100 | if (status != ready) 101 | return; 102 | 103 | OpenPixelControl::loop(); 104 | WebServer::loop(); 105 | 106 | Ethernet.maintain(); 107 | 108 | } 109 | 110 | bool initialized() { 111 | return (status == ready); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /lib/TcpServer/TcpServer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Code for listening, as a service, on a TCP port 4 | // and responding appropriately. 5 | 6 | #include 7 | 8 | namespace TcpServer { 9 | 10 | void setup(); 11 | void loop(); 12 | 13 | bool initialized(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /lib/Util/Util.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | // better debugging. Inspired from https://gist.github.com/asheeshr/9004783 with some modifications 7 | 8 | namespace Util { 9 | 10 | void setup(void) { 11 | #ifdef DEBUG 12 | uint32_t tmEnd = millis() + 5000; 13 | Serial.begin(250000); 14 | while (!Serial && millis() < tmEnd); 15 | #endif 16 | } 17 | 18 | uint32_t FreeMem() { 19 | uint32_t stackTop; 20 | uint32_t heapTop; 21 | 22 | // current position of the stack. 23 | stackTop = (uint32_t) &stackTop; 24 | 25 | // current position of heap. 26 | void* hTop = malloc(1); 27 | heapTop = (uint32_t) hTop; 28 | free(hTop); 29 | 30 | // The difference is (approximately) the free, available ram. 31 | return stackTop - heapTop; 32 | } 33 | } 34 | 35 | 36 | 37 | void dbgprintf(char const* pszFmt UNUSED_IN_RELEASE, ... ) { 38 | 39 | #ifdef DEBUG 40 | char const* pszTmp; 41 | 42 | va_list argv; 43 | va_start(argv, pszFmt); 44 | 45 | pszTmp = pszFmt; 46 | while (*pszTmp) 47 | { 48 | if (*pszTmp == '%') 49 | { 50 | pszTmp++; 51 | switch (*pszTmp) 52 | { 53 | case 'd': 54 | Serial.print(va_arg(argv, int)); 55 | break; 56 | 57 | case 'x': 58 | case 'X': 59 | Serial.print(va_arg(argv, int), HEX); 60 | break; 61 | 62 | case 'l': 63 | Serial.print(va_arg(argv, long)); 64 | break; 65 | 66 | case 'u': 67 | Serial.print(va_arg(argv, unsigned long)); 68 | break; 69 | 70 | case 'f': 71 | Serial.print(va_arg(argv, double)); 72 | break; 73 | 74 | case 'F': 75 | Serial.print(va_arg(argv, double), 8); 76 | break; 77 | 78 | case 'c': 79 | Serial.print((char) va_arg(argv, int)); 80 | break; 81 | 82 | case 's': 83 | Serial.print(va_arg(argv, char*)); 84 | break; 85 | 86 | case '%': 87 | Serial.print('%'); 88 | break; 89 | 90 | default: 91 | break; 92 | } 93 | } 94 | else if (*pszTmp == '\n') 95 | { 96 | Serial.println(); 97 | } 98 | else 99 | { 100 | Serial.print(*pszTmp); 101 | } 102 | 103 | pszTmp++; 104 | } 105 | #endif 106 | } 107 | -------------------------------------------------------------------------------- /lib/Util/Util.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef RELEASE 4 | #define UNUSED_IN_RELEASE __attribute__((unused)) 5 | #else 6 | #define UNUSED_IN_RELEASE 7 | #endif 8 | 9 | namespace Util 10 | { 11 | void setup(void); 12 | uint32_t FreeMem(); 13 | } 14 | 15 | void dbgprintf(char const *str, ...); 16 | -------------------------------------------------------------------------------- /lib/WebServer/WebServer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | char *strsep(char **stringp, const char *delim); 9 | 10 | #define BUFFER_SIZE 128 11 | 12 | namespace WebServer { 13 | 14 | enum Status { ready, // Listening, ready for a client to connect 15 | connected // A client has connected 16 | }; 17 | 18 | Status status; 19 | EthernetClient client; 20 | EthernetServer server(80); 21 | 22 | char rgchRequest[BUFFER_SIZE + 1]; 23 | uint16_t ixRequest = 0; 24 | 25 | void setup() 26 | { 27 | 28 | server.begin(); 29 | status = ready; 30 | 31 | } 32 | 33 | void loop() { 34 | 35 | if (status == ready) 36 | { 37 | 38 | client = server.available(); 39 | if (client) 40 | { 41 | dbgprintf("Web client connected\n"); 42 | ixRequest = 0; 43 | status = connected; 44 | } 45 | } 46 | 47 | if (status == connected) 48 | { 49 | if (!client.connected()) 50 | { 51 | dbgprintf("Web client disconnected\n"); 52 | status = ready; 53 | return; 54 | } 55 | 56 | // client is still connected -- read the bytes! 57 | read_available(); 58 | } 59 | } 60 | 61 | void read_available() { 62 | 63 | // Here's the plan: read one line at a time - up to BUFFER_SIZE bytes, then discard 64 | // When you see \n, process it 65 | // if it starts with GET, record this as the "GET" command 66 | // if it starts with \n again, that's the end of the HTTP header - process it 67 | // otherwise discard and start over 68 | 69 | while (client.available()) 70 | { 71 | char c = client.read(); 72 | 73 | if (c == '\n') 74 | { 75 | rgchRequest[ixRequest] = '\0'; 76 | if (!strncmp(rgchRequest, "GET ", 4)) 77 | { 78 | // GET command has a space in it followed by something like HTTP/1.1 which we can 79 | // throw away 80 | if (char *pchSpace = strchr(rgchRequest+4, ' ')) 81 | *pchSpace = '\0'; 82 | process_get(rgchRequest + 4); 83 | } 84 | if (ixRequest == 0) 85 | { 86 | output_html(); 87 | 88 | delay(1); 89 | client.stop(); 90 | } 91 | ixRequest = 0; 92 | } 93 | else 94 | { 95 | if (ixRequest == BUFFER_SIZE - 1) 96 | rgchRequest[ixRequest] = '\0'; 97 | else if (c != '\r') 98 | { 99 | rgchRequest[ixRequest] = c; 100 | ixRequest++; 101 | } 102 | } 103 | } 104 | } 105 | 106 | void process_get(char* szGet) 107 | { 108 | dbgprintf("GET: [%s]\n", szGet); 109 | 110 | if (!strcmp("/", szGet)) 111 | return; 112 | 113 | char *pszTok = NULL; 114 | while (NULL != (pszTok = strsep(&szGet,"/?&"))) 115 | { 116 | if (*pszTok) 117 | { 118 | if (!strcmp(pszTok, "r")) 119 | { 120 | LED::setSolidColor(CRGB::Red); 121 | return; 122 | } 123 | else if (!strcmp(pszTok, "g")) 124 | { 125 | LED::setSolidColor(CRGB::Green); 126 | return; 127 | } 128 | else if (!strcmp(pszTok, "b")) 129 | { 130 | LED::setSolidColor(CRGB::Blue); 131 | return; 132 | } 133 | else if (!strcmp(pszTok, "w")) 134 | { 135 | LED::setSolidColor(CRGB::White); 136 | return; 137 | } 138 | else if (!strncmp(pszTok, "w=", 2)) 139 | Persist::data.max_power = atoi(pszTok + 2); 140 | else if (!strncmp(pszTok, "o=", 2)) 141 | Persist::data.first_color = pszTok[2]; 142 | else if (!strncmp(pszTok, "c=", 2)) 143 | Persist::data.color_correction = strtol(pszTok + 2, NULL, 16); 144 | else if (!strncmp(pszTok, "t=", 2)) 145 | Persist::data.color_temperature = strtol(pszTok + 2, NULL, 16); 146 | else if (!strncmp(pszTok, "b=", 2)) { 147 | Persist::data.brightness = min(255, atoi(pszTok + 2)); 148 | LEDS.setBrightness(Persist::data.brightness); 149 | Persist::data.gamma_correction = false; // because g= will be missing if gamma correction is unchecked 150 | Persist::data.static_ip = false; // because s= will be missing if static ip is unchecked 151 | } 152 | else if (!strncmp(pszTok, "g=", 2)) 153 | Persist::data.gamma_correction = (pszTok[2] == '1'); 154 | else if (!strncmp(pszTok, "s=", 2)) 155 | Persist::data.static_ip = (pszTok[2] == '1'); 156 | 157 | else if (!strncmp(pszTok, "i0=", 3)) 158 | Persist::data.ip_addr[0] = (uint8_t) atoi(pszTok + 3); 159 | else if (!strncmp(pszTok, "i1=", 3)) 160 | Persist::data.ip_addr[1] = (uint8_t) atoi(pszTok + 3); 161 | else if (!strncmp(pszTok, "i2=", 3)) 162 | Persist::data.ip_addr[2] = (uint8_t) atoi(pszTok + 3); 163 | else if (!strncmp(pszTok, "i3=", 3)) 164 | Persist::data.ip_addr[3] = (uint8_t) atoi(pszTok + 3); 165 | 166 | 167 | 168 | else 169 | dbgprintf("unidentified token: {%s}\n", pszTok); 170 | } 171 | } 172 | 173 | Persist::write(); 174 | LED::load_persistant_data(); 175 | 176 | } 177 | 178 | void output_html() 179 | { 180 | client.println( 181 | "HTTP/1.1 200 OK\r\n" 182 | "Content-Type: text/html\r\n" 183 | "Connection: close\r\n" 184 | "\r\n" 185 | "" 186 | "" 187 | "

Branch Controller

" 188 | "

built " __DATE__ " " __TIME__ "

" 189 | "
" 190 | "
" 191 | "Maximum Power: " 192 | " milliwatts" 197 | "
" 198 | "RGB/GRB Order: " 199 | "" 211 | "
" 212 | "Color Correction: " 213 | " (hex RGB)" 218 | "
" 219 | "Color Temperature: " 220 | " (hex RGB)" 225 | "
" 226 | "Brightness: " 227 | " (0-255)" 232 | "
" 233 | "" 234 | "
" 235 | " " 240 | "...
" 257 | 258 | "" 259 | "
" 260 | "Test colors: " 261 | "Red " 262 | "Green " 263 | "Blue " 264 | "White " 265 | "
" 266 | ""); 267 | } 268 | } 269 | 270 | -------------------------------------------------------------------------------- /lib/WebServer/WebServer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | // 6 | // implements a web server used for 7 | // advanced configuration options 8 | // 9 | 10 | 11 | namespace WebServer { 12 | 13 | void setup(); 14 | void loop(); 15 | void read_available(); 16 | void process_get(char* szGet); 17 | void output_html(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; BranchController can be built in release or debug mode. 4 | ; Choose one to build in the VS Code GUI by editing [platformio]default_envs. 5 | ; Release mode is highly optimized. Debug mode is not. 6 | ; Release mode will not write debugging information to the serial port; 7 | ; it will be assumed you don't have one. 8 | ; Throughout the code, use #ifdef DEBUG or #ifdef RELEASE if you need 9 | ; to distinguish. 10 | ; 11 | ; 12 | ; Build options: build flags, source filter, extra scripting 13 | ; Upload options: custom port, speed and extra flags 14 | ; Library options: dependencies, extra library storages 15 | ; 16 | ; Please visit documentation for the other options and examples 17 | ; http://docs.platformio.org/page/projectconf.html 18 | 19 | [platformio] 20 | default_envs = debug 21 | 22 | [env] 23 | build_flags = -I$PROJECT_DIR/include 24 | platform = teensy 25 | framework = arduino 26 | board = teensy31 27 | 28 | [env:debug] 29 | build_type = debug 30 | build_flags = -DDEBUG ${env.build_flags} 31 | 32 | [env:release] 33 | build_type = release 34 | build_flags = -DRELEASE ${env.build_flags} 35 | 36 | -------------------------------------------------------------------------------- /src/BranchController.cpp: -------------------------------------------------------------------------------- 1 | // BranchController.cpp 2 | // 3 | // Main entry point - provides Arduino's setup() and loop() functions which 4 | // tie together all the main functionality of the different modules. 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void RouteIRCode(unsigned int code); 17 | 18 | void setup() { 19 | 20 | dbgprintf("Begin\n"); 21 | 22 | Heartbeat::setup(); 23 | Util::setup(); 24 | Persist::setup(); 25 | Display::setup(); 26 | TcpServer::setup(); 27 | LED::setup(); 28 | Remote::setup(); 29 | 30 | dbgprintf("BranchController Setup Complete\n"); 31 | 32 | } 33 | 34 | 35 | 36 | void loop() { 37 | 38 | static unsigned int lastIrCode = 0; 39 | 40 | Heartbeat::loop(); 41 | TcpServer::loop(); 42 | LED::loop(); 43 | if (Remote::loop()) 44 | { 45 | if (Remote::lastResult == 0xFFFFFFFF) 46 | { 47 | // repeat command! -- if it's a repeatable command 48 | // like brightness up/down. 49 | if (lastIrCode == 0xFF3AC5 || 50 | lastIrCode == 0xFFBA45) 51 | { 52 | RouteIRCode(lastIrCode); 53 | } 54 | } 55 | else 56 | { 57 | lastIrCode = Remote::lastResult; 58 | RouteIRCode(lastIrCode); 59 | } 60 | } 61 | 62 | EVERY_N_SECONDS(30) 63 | { 64 | dbgprintf("Free memory: %u\n", Util::FreeMem() ); 65 | } 66 | } 67 | 68 | void RouteIRCode(unsigned int code) 69 | { 70 | // IR codes: https://gist.github.com/Derpidoo/e3042055e0f5c3708f9b98b75fe4d59e 71 | // or just try hitting a button to see what you get :) 72 | Display::status(3, ""); 73 | char rgchBuf[CB_DISPLAY_LINE]; 74 | 75 | switch(code) 76 | { 77 | case 0xFF02FD: // POWER 78 | if (LED::togglePower()) 79 | { 80 | // switched on 81 | Display::on(); 82 | } 83 | else 84 | { 85 | // switched off 86 | Display::off(); 87 | Persist::write(); 88 | } 89 | break; 90 | 91 | case 0xFFF00F: // AUTO - reinitialize network plz 92 | if (!TcpServer::initialized()) 93 | { 94 | Display::status(3, ""); 95 | TcpServer::setup(); 96 | } 97 | break; 98 | 99 | case 0xFF3AC5: // Brightness up 100 | 101 | sprintf(rgchBuf, 102 | "Brightness: %d", 103 | LED::brighter()); 104 | Display::status(3, rgchBuf); 105 | break; 106 | 107 | case 0xFFBA45: // Brightness down 108 | 109 | sprintf(rgchBuf, 110 | "Brightness: %d", 111 | LED::dimmer()); 112 | Display::status(3, rgchBuf); 113 | break; 114 | 115 | case 0xFF30CF: // DIY1 116 | LED::testPattern(); 117 | break; 118 | 119 | 120 | // 121 | // Here are all the colors: 122 | // 123 | 124 | case 0xFF1AE5: // RED 125 | LED::setSolidColor(CRGB::Red); 126 | break; 127 | 128 | case 0xFF2AD5: // RED ROW 2 129 | LED::setSolidColor(CHSV(16, 255, 255)); 130 | break; 131 | 132 | case 0xFF0AF5: // RED ROW 3 133 | LED::setSolidColor(CHSV(32, 255, 255)); 134 | break; 135 | 136 | case 0xFF38C7: // RED ROW 4 137 | LED::setSolidColor(CHSV(48, 255, 255)); 138 | break; 139 | 140 | case 0xFF18E7: // RED ROW 5 141 | LED::setSolidColor(CHSV(64, 255, 255)); 142 | break; 143 | 144 | case 0xFF9A65: // GREEN 145 | LED::setSolidColor(CRGB::Green); 146 | break; 147 | 148 | case 0xFFAA55: // GREEN ROW 2 149 | LED::setSolidColor(CHSV(108, 255, 255)); 150 | break; 151 | 152 | case 0xFF8A75: // GREEN ROW 3 153 | LED::setSolidColor(CHSV(121, 255, 255)); 154 | break; 155 | 156 | case 0xFFB847: // GREEN ROW 4 157 | LED::setSolidColor(CHSV(134, 255, 255)); 158 | break; 159 | 160 | case 0xFF9867: // GREEN ROW 5 161 | LED::setSolidColor(CHSV(147, 255, 255)); 162 | break; 163 | 164 | case 0xFFA25D: // BLUE 165 | LED::setSolidColor(CRGB::Blue); 166 | break; 167 | 168 | case 0xFF926D: // BLUE ROW 2 169 | LED::setSolidColor(CHSV(179, 255, 255)); 170 | break; 171 | 172 | case 0xFFB24D: // BLUE ROW 3 173 | LED::setSolidColor(CHSV(198, 255, 255)); 174 | break; 175 | 176 | case 0xFF7887: // BLUE ROW 4 177 | LED::setSolidColor(CHSV(217,255,255)); 178 | break; 179 | 180 | case 0xFF58A7: // BLUE ROW 5 181 | LED::setSolidColor(CHSV(236, 255, 255)); 182 | break; 183 | 184 | case 0xFF22DD: // WHITE 185 | LED::setSolidColor(CRGB::White); 186 | break; 187 | 188 | case 0xFF12ED: // WHITE ROW 2 189 | LED::setSolidColor(CRGB(192, 192, 192)); 190 | break; 191 | 192 | case 0xFF32CD: // WHITE ROW 3 193 | LED::setSolidColor(CRGB(128, 128, 128)); 194 | break; 195 | 196 | case 0xFFF807: // WHITE ROW 4 197 | LED::setSolidColor(CRGB(64, 64, 64)); 198 | break; 199 | 200 | case 0xFFD827: // WHITE ROW 5 201 | LED::setSolidColor(CRGB(32, 32, 32)); 202 | break; 203 | 204 | default: 205 | sprintf(rgchBuf, "IR %X ??", code); 206 | Display::status(3, rgchBuf); 207 | 208 | } 209 | } 210 | --------------------------------------------------------------------------------