Compare commits

...

5 Commits

Author SHA1 Message Date
Mark van Renswoude 5f89b3efd2 First version of submodule implementation
Based on ATTiny2313 / ATTiny4313
2018-11-18 11:16:33 +01:00
Mark van Renswoude 3a8b22fc4a Merge tag '2.1' into develop
release 2.1 2.1
2018-04-29 11:06:33 +02:00
Mark van Renswoude a236588ebb Merge branch 'release/2.1'
# Conflicts:
#	src/assets/version.h
#	src/main.cpp
#	web/dist/bundle.js
2018-04-29 11:04:48 +02:00
Mark van Renswoude d0b62d38b0 Added automatic retry to frontend
Better support for iOS language detection?
2018-03-19 07:45:54 +01:00
Mark van Renswoude fb00c0baa2 Merge branch 'release/2.0' 2018-02-17 23:14:55 +01:00
51 changed files with 9264 additions and 2297 deletions

4
.gitignore vendored
View File

@ -3,4 +3,6 @@
bin
*.sublime-workspace
node_modules
src/secret.h
src/secret.h
/kicad/Stairs.kicad_pcb-bak
/kicad/Stairs.bak

View File

@ -1,3 +1,16 @@
<?php
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Host this file somewhere on PHP enabled non-secure HTTP webhost
* and modify the config.h to proxy Maps API requests. Saves a ton
* of memory on the ESP8266.
*
* If you care about your API key being sent across plain HTTP,
* host this or a similar proxy on your LAN, perhaps on a Raspberry Pi.
*/
echo file_get_contents('https://maps.googleapis.com/maps/api/timezone/json?' . $_SERVER['QUERY_STRING']);
?>

387
kicad/Stairs-cache.lib Normal file
View File

@ -0,0 +1,387 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# AMS1117-5.0_AMS1117-5.0
#
DEF AMS1117-5.0_AMS1117-5.0 U 0 40 Y Y 1 L N
F0 "U" -400 220 50 H V L BNN
F1 "AMS1117-5.0_AMS1117-5.0" -401 -321 50 H V L BNN
F2 "SOT229P700X180-4N" 0 0 50 H I L BNN
F3 "Sot223/Pkg 1-Amp 5-Volt Low Drop Out Voltage Regulatator" 0 0 50 H I L BNN
F4 "Unavailable" 0 0 50 H I L BNN
F5 "Advanced Monolithic Systems" 0 0 50 H I L BNN
F6 "None" 0 0 50 H I L BNN
F7 "None" 0 0 50 H I L BNN
F8 "AMS1117-5.0" 0 0 50 H I L BNN
DRAW
S -400 200 400 -200 0 1 0 f
X ADJ/GND 1 600 -100 200 L 40 40 0 0 W
X VOUT 2 600 100 200 L 40 40 0 0 O
X VIN 3 -600 100 200 R 40 40 0 0 I
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_01x02
#
DEF Connector_Generic_Conn_01x02 J 0 40 Y N 1 F N
F0 "J" 0 100 50 H V C CNN
F1 "Connector_Generic_Conn_01x02" 0 -200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 50 50 -150 1 1 10 f
X Pin_1 1 -200 0 150 R 50 50 1 1 P
X Pin_2 2 -200 -100 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_01x04
#
DEF Connector_Generic_Conn_01x04 J 0 40 Y N 1 F N
F0 "J" 0 200 50 H V C CNN
F1 "Connector_Generic_Conn_01x04" 0 -300 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 50 -250 1 1 10 f
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 -200 0 150 R 50 50 1 1 P
X Pin_3 3 -200 -100 150 R 50 50 1 1 P
X Pin_4 4 -200 -200 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_01x06
#
DEF Connector_Generic_Conn_01x06 J 0 40 Y N 1 F N
F0 "J" 0 300 50 H V C CNN
F1 "Connector_Generic_Conn_01x06" 0 -400 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S -50 -295 0 -305 1 1 6 N
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 205 0 195 1 1 6 N
S -50 250 50 -350 1 1 10 f
X Pin_1 1 -200 200 150 R 50 50 1 1 P
X Pin_2 2 -200 100 150 R 50 50 1 1 P
X Pin_3 3 -200 0 150 R 50 50 1 1 P
X Pin_4 4 -200 -100 150 R 50 50 1 1 P
X Pin_5 5 -200 -200 150 R 50 50 1 1 P
X Pin_6 6 -200 -300 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_02x03_Counter_Clockwise
#
DEF Connector_Generic_Conn_02x03_Counter_Clockwise J 0 40 Y N 1 F N
F0 "J" 50 200 50 H V C CNN
F1 "Connector_Generic_Conn_02x03_Counter_Clockwise" 50 -200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_2x??_*
$ENDFPLIST
DRAW
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 150 150 -150 1 1 10 f
S 150 -95 100 -105 1 1 6 N
S 150 5 100 -5 1 1 6 N
S 150 105 100 95 1 1 6 N
X Pin_1 1 -200 100 150 R 50 50 1 1 P
X Pin_2 2 -200 0 150 R 50 50 1 1 P
X Pin_3 3 -200 -100 150 R 50 50 1 1 P
X Pin_4 4 300 -100 150 L 50 50 1 1 P
X Pin_5 5 300 0 150 L 50 50 1 1 P
X Pin_6 6 300 100 150 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_C
#
DEF Device_C C 0 10 N Y 1 F N
F0 "C" 25 100 50 H V L CNN
F1 "Device_C" 25 -100 50 H V L CNN
F2 "" 38 -150 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
C_*
$ENDFPLIST
DRAW
P 2 0 1 20 -80 -30 80 -30 N
P 2 0 1 20 -80 30 80 30 N
X ~ 1 0 150 110 D 50 50 1 1 P
X ~ 2 0 -150 110 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_Crystal_Small
#
DEF Device_Crystal_Small Y 0 40 N N 1 F N
F0 "Y" 0 100 50 H V C CNN
F1 "Device_Crystal_Small" 0 -100 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Crystal*
$ENDFPLIST
DRAW
S -30 -60 30 60 0 1 0 N
P 2 0 1 15 -50 -30 -50 30 N
P 2 0 1 15 50 -30 50 30 N
X 1 1 -100 0 50 R 50 50 1 1 P
X 2 2 100 0 50 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_R
#
DEF Device_R R 0 0 N Y 1 F N
F0 "R" 80 0 50 V V C CNN
F1 "Device_R" 0 0 50 V V C CNN
F2 "" -70 0 50 V I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
R_*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# MAX485_MAX485
#
DEF MAX485_MAX485 U 0 40 Y Y 1 L N
F0 "U" -401 301 50 H V L BNN
F1 "MAX485_MAX485" -401 -301 50 H V L BNN
F2 "" 0 0 50 H I C CNN
F3 "Maxim Integrated" 0 0 50 H I L BNN
F4 "None" 0 0 50 H I L BNN
F5 "Unavailable" 0 0 50 H I L BNN
F6 "None" 0 0 50 H I L BNN
F7 "MAX485" 0 0 50 H I L BNN
$FPLIST
DIL08
SO08
$ENDFPLIST
DRAW
S -400 300 400 -200 0 1 0 f
X RO 1 -600 200 200 R 40 40 0 0 B
X RE 2 -600 100 200 R 40 40 0 0 B I
X DE 3 -600 0 200 R 40 40 0 0 B
X DI 4 -600 -100 200 R 40 40 0 0 B
X GND 5 600 -100 200 L 40 40 0 0 W
X A 6 600 0 200 L 40 40 0 0 B
X B 7 600 100 200 L 40 40 0 0 B
X VCC 8 600 200 200 L 40 40 0 0 W
ENDDRAW
ENDDEF
#
# MCU_Microchip_ATtiny_ATtiny2313A-SU
#
DEF MCU_Microchip_ATtiny_ATtiny2313A-SU U 0 20 Y Y 1 F N
F0 "U" -500 1050 50 H V L BNN
F1 "MCU_Microchip_ATtiny_ATtiny2313A-SU" 100 -1050 50 H V L TNN
F2 "Package_SO:SOIC-20W_7.5x12.8mm_P1.27mm" 0 0 50 H I C CIN
F3 "" 0 0 50 H I C CNN
ALIAS ATtiny2313-20SU ATtiny2313A-SU ATtiny4313-SU
$FPLIST
SOIC*7.5x12.8mm*P1.27mm*
$ENDFPLIST
DRAW
S -500 -1000 500 1000 0 1 10 f
X PA2/~RESET 1 -600 800 100 R 50 50 1 1 T
X GND 10 0 -1100 100 U 50 50 1 1 W
X PD6 11 600 -700 100 L 50 50 1 1 T
X PB0 12 600 800 100 L 50 50 1 1 T
X PB1 13 600 700 100 L 50 50 1 1 T
X PB2 14 600 600 100 L 50 50 1 1 T
X PB3 15 600 500 100 L 50 50 1 1 T
X PB4 16 600 400 100 L 50 50 1 1 T
X PB5 17 600 300 100 L 50 50 1 1 T
X PB6 18 600 200 100 L 50 50 1 1 T
X PB7 19 600 100 100 L 50 50 1 1 T
X PD0 2 600 -100 100 L 50 50 1 1 T
X VCC 20 0 1100 100 D 50 50 1 1 W
X PD1 3 600 -200 100 L 50 50 1 1 T
X PA1/XTAL2 4 -600 400 100 R 50 50 1 1 T
X PA0/XTAL1 5 -600 600 100 R 50 50 1 1 T
X PD2 6 600 -300 100 L 50 50 1 1 T
X PD3 7 600 -400 100 L 50 50 1 1 T
X PD4 8 600 -500 100 L 50 50 1 1 T
X PD5 9 600 -600 100 L 50 50 1 1 T
ENDDRAW
ENDDEF
#
# PCA9685-TSSOP_PCA9685-TSSOP
#
DEF PCA9685-TSSOP_PCA9685-TSSOP U 0 40 Y Y 1 F N
F0 "U" 0 -100 50 H V C CNN
F1 "PCA9685-TSSOP_PCA9685-TSSOP" 0 100 50 H V C CNN
F2 "MODULE" 0 0 50 H I C CNN
F3 "DOCUMENTATION" 0 0 50 H I C CNN
DRAW
S -450 -850 450 850 1 0 0 f
X A0 1 -750 650 300 R 50 50 1 1 I
X LED4 10 -750 -250 300 R 50 50 1 1 O
X LED5 11 -750 -350 300 R 50 50 1 1 O
X LED6 12 -750 -450 300 R 50 50 1 1 O
X LED7 13 -750 -550 300 R 50 50 1 1 O
X GND 14 -750 -650 300 R 50 50 1 1 I
X LED8 15 750 -650 300 L 50 50 1 1 O
X LED9 16 750 -550 300 L 50 50 1 1 O
X LED10 17 750 -450 300 L 50 50 1 1 O
X LED11 18 750 -350 300 L 50 50 1 1 O
X LED12 19 750 -250 300 L 50 50 1 1 O
X A1 2 -750 550 300 R 50 50 1 1 I
X LED13 20 750 -150 300 L 50 50 1 1 O
X LED14 21 750 -50 300 L 50 50 1 1 O
X LED15 22 750 50 300 L 50 50 1 1 O
X OE 23 750 150 300 L 50 50 1 1 I
X A5 24 750 250 300 L 50 50 1 1 I
X EXTCLK 25 750 350 300 L 50 50 1 1 I
X SCL 26 750 450 300 L 50 50 1 1 I
X SDA 27 750 550 300 L 50 50 1 1 B
X VCC 28 750 650 300 L 50 50 1 1 I
X A2 3 -750 450 300 R 50 50 1 1 I
X A3 4 -750 350 300 R 50 50 1 1 I
X A4 5 -750 250 300 R 50 50 1 1 I
X LED0 6 -750 150 300 R 50 50 1 1 O
X LED1 7 -750 50 300 R 50 50 1 1 O
X LED2 8 -750 -50 300 R 50 50 1 1 O
X LED3 9 -750 -150 300 R 50 50 1 1 O
ENDDRAW
ENDDEF
#
# Switch_SW_Push
#
DEF Switch_SW_Push SW 0 40 N N 1 F N
F0 "SW" 50 100 50 H V L CNN
F1 "Switch_SW_Push" 0 -60 50 H V C CNN
F2 "" 0 200 50 H I C CNN
F3 "" 0 200 50 H I C CNN
DRAW
C -80 0 20 0 1 0 N
C 80 0 20 0 1 0 N
P 2 0 1 0 0 50 0 120 N
P 2 0 1 0 100 50 -100 50 N
X 1 1 -200 0 100 R 50 50 0 1 P
X 2 2 200 0 100 L 50 50 0 1 P
ENDDRAW
ENDDEF
#
# Transistor_FET_IRLB8721PBF
#
DEF Transistor_FET_IRLB8721PBF Q 0 0 Y N 1 F N
F0 "Q" 250 75 50 H V L CNN
F1 "Transistor_FET_IRLB8721PBF" 250 0 50 H V L CNN
F2 "Package_TO_SOT_THT:TO-220-3_Vertical" 250 -75 50 H I L CIN
F3 "" 0 0 50 H I L CNN
ALIAS IRF3205 IRF540N IRF740 IRLB8721PBF IRLZ34N IRLZ44N
$FPLIST
TO?220*
$ENDFPLIST
DRAW
C 65 0 111 0 1 10 N
C 100 -70 11 0 1 0 F
C 100 70 11 0 1 0 F
P 2 0 1 0 10 0 -100 0 N
P 2 0 1 0 30 -70 100 -70 N
P 2 0 1 10 30 -50 30 -90 N
P 2 0 1 0 30 0 100 0 N
P 2 0 1 10 30 20 30 -20 N
P 2 0 1 0 30 70 100 70 N
P 2 0 1 10 30 90 30 50 N
P 2 0 1 0 100 -70 100 -100 N
P 2 0 1 0 100 -70 100 0 N
P 2 0 1 0 100 100 100 70 N
P 3 0 1 10 10 75 10 -75 10 -75 N
P 4 0 1 0 40 0 80 15 80 -15 40 0 F
P 4 0 1 0 100 -70 130 -70 130 70 100 70 N
P 4 0 1 0 110 20 115 15 145 15 150 10 N
P 4 0 1 0 130 15 115 -10 145 -10 130 15 N
X G 1 -200 0 100 R 50 50 1 1 I
X D 2 100 200 100 D 50 50 1 1 P
X S 3 100 -200 100 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# power_+12V
#
DEF power_+12V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+12V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +12V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_+5V
#
DEF power_+5V #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+5V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +5V 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_GND
#
DEF power_GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -250 50 H I C CNN
F1 "power_GND" 0 -150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_PWR_FLAG
#
DEF power_PWR_FLAG #FLG 0 0 N N 1 F P
F0 "#FLG" 0 75 50 H I C CNN
F1 "power_PWR_FLAG" 0 150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 50 -40 75 0 100 40 75 0 50 N
X pwr 1 0 0 0 U 50 50 0 0 w
ENDDRAW
ENDDEF
#
#End Library

2350
kicad/Stairs.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

581
kicad/Stairs.net Normal file
View File

@ -0,0 +1,581 @@
(export (version D)
(design
(source P:\Electronics\Stairs\kicad\Stairs.sch)
(date "11-11-2018 20:15:56")
(tool "Eeschema (5.0.1)-3")
(sheet (number 1) (name /) (tstamps /)
(title_block
(title "Stairs submodule")
(company "Mark van Renswoude")
(rev 1)
(date 2018-09-02)
(source Stairs.sch)
(comment (number 1) (value ""))
(comment (number 2) (value ""))
(comment (number 3) (value ""))
(comment (number 4) (value "")))))
(components
(comp (ref PCA9685)
(value PCA9685-TSSOP)
(footprint Housings_SSOP:TSSOP-28_4.4x9.7mm_Pitch0.65mm)
(datasheet DOCUMENTATION)
(libsource (lib PCA9685-TSSOP) (part PCA9685-TSSOP) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AD5C2))
(comp (ref U2)
(value MAX485)
(footprint Housings_SOIC:SO-8_5.3x6.2mm_Pitch1.27mm)
(datasheet "Maxim Integrated")
(fields
(field (name Field4) None)
(field (name Field5) Unavailable)
(field (name Field6) None)
(field (name Field7) MAX485))
(libsource (lib MAX485) (part MAX485) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AD72A))
(comp (ref P6)
(value PWR_IN)
(footprint Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x02) (description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AD8CA))
(comp (ref P5)
(value PWR_OUT)
(footprint Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x02) (description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8ADA74))
(comp (ref P3)
(value SENSOR)
(footprint Terminal_Blocks:TerminalBlock_bornier-6_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x06) (description "Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AE6A5))
(comp (ref P1)
(value DATA_IN)
(footprint Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x02) (description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AE987))
(comp (ref P2)
(value DATA_OUT)
(footprint Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x02) (description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AE9DD))
(comp (ref AMS1117)
(value AMS1117-5)
(footprint AMS1117-5.0:SOT229P700X180-4N)
(datasheet AMS1117-5.0)
(fields
(field (name Field4) None)
(field (name Field5) Unavailable)
(field (name Field6) "Sot223/Pkg 1-Amp 3.3-Volt Low Drop Out Voltage Regulatator")
(field (name Field7) "Advanced Monolithic Systems")
(field (name Field8) None))
(libsource (lib AMS1117-5.0) (part AMS1117-5.0) (description ""))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AFB24))
(comp (ref C3)
(value 10µF)
(footprint Capacitors_Tantalum_SMD:CP_Tantalum_Case-D_EIA-7343-31_Hand)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8B090B))
(comp (ref C4)
(value 100nF)
(footprint Capacitors_SMD:C_1206_HandSoldering)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8B1267))
(comp (ref U1)
(value ATTINY2313A-SU)
(footprint Housings_SOIC:SOIC-20W_7.5x12.8mm_Pitch1.27mm)
(libsource (lib MCU_Microchip_ATtiny) (part ATtiny2313A-SU) (description "20MHz, 2kB Flash, 128B SRAM, 128B EEPROM, SOIC-20"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8AD3B8))
(comp (ref C2)
(value 33pF)
(footprint Capacitors_SMD:C_1206_HandSoldering)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8B93C9))
(comp (ref C1)
(value 33pF)
(footprint Capacitors_SMD:C_1206_HandSoldering)
(libsource (lib Device) (part C) (description "Unpolarized capacitor"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8B9824))
(comp (ref XTAL1)
(value "8 Mhz")
(footprint Crystals:Crystal_HC49-U_Vertical)
(libsource (lib Device) (part Crystal_Small) (description "Two pin crystal, small symbol"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8B9A62))
(comp (ref R1)
(value 10K)
(footprint Resistors_SMD:R_0603_HandSoldering)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5B8C2380))
(comp (ref P7)
(value SSD1306)
(footprint Pin_Headers:Pin_Header_Straight_1x04_Pitch2.54mm)
(libsource (lib Connector_Generic) (part Conn_01x04) (description "Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8C32B0))
(comp (ref Q1)
(value IRLB8721PBF)
(footprint TO_SOT_Packages_THT:TO-220-3_Horizontal)
(libsource (lib Transistor_FET) (part IRLB8721PBF) (description "62A Id, 30V Vds, N-Channel MOSFET, TO-220"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8C8EA8))
(comp (ref R2)
(value 150)
(footprint Resistors_SMD:R_0603_HandSoldering)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5B8CAD1E))
(comp (ref R3)
(value 150)
(footprint Resistors_SMD:R_0603_HandSoldering)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5B8CAE68))
(comp (ref Q2)
(value IRLB8721PBF)
(footprint TO_SOT_Packages_THT:TO-220-3_Horizontal)
(libsource (lib Transistor_FET) (part IRLB8721PBF) (description "62A Id, 30V Vds, N-Channel MOSFET, TO-220"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8CB00E))
(comp (ref P4)
(value LED)
(footprint Terminal_Blocks:TerminalBlock_bornier-4_P5.08mm)
(libsource (lib Connector_Generic) (part Conn_01x04) (description "Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5B8CBF27))
(comp (ref R4)
(value 10K)
(footprint Resistors_SMD:R_0603_HandSoldering)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5B8C6BF9))
(comp (ref R5)
(value 10K)
(footprint Resistors_SMD:R_0603_HandSoldering)
(libsource (lib Device) (part R) (description Resistor))
(sheetpath (names /) (tstamps /))
(tstamp 5B925FBE))
(comp (ref J1)
(value PROG)
(footprint Pin_Headers:Pin_Header_Straight_2x03_Pitch2.54mm)
(datasheet ~)
(libsource (lib Connector_Generic) (part Conn_02x03_Counter_Clockwise) (description "Generic connector, double row, 02x03, counter clockwise pin numbering scheme (similar to DIP packge numbering), script generated (kicad-library-utils/schlib/autogen/connector/)"))
(sheetpath (names /) (tstamps /))
(tstamp 5BEBD38C))
(comp (ref SW1)
(value Button)
(footprint SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_:SW4-SMD-5.2X5.2X1.5MM)
(libsource (lib Switch) (part SW_Push) (description "Push button switch, generic, two pins"))
(sheetpath (names /) (tstamps /))
(tstamp 5BF329CF)))
(libparts
(libpart (lib AMS1117-5.0) (part AMS1117-5.0)
(fields
(field (name Reference) U)
(field (name Value) AMS1117-5.0)
(field (name Footprint) SOT229P700X180-4N)
(field (name Datasheet) "Sot223/Pkg 1-Amp 5-Volt Low Drop Out Voltage Regulatator")
(field (name Field4) Unavailable)
(field (name Field5) "Advanced Monolithic Systems")
(field (name Field6) None)
(field (name Field7) None)
(field (name Field8) AMS1117-5.0))
(pins
(pin (num 1) (name ADJ/GND) (type power_in))
(pin (num 2) (name VOUT) (type output))
(pin (num 3) (name VIN) (type input))))
(libpart (lib Connector_Generic) (part Conn_01x02)
(description "Generic connector, single row, 01x02, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_1x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_01x02))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))))
(libpart (lib Connector_Generic) (part Conn_01x04)
(description "Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_1x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_01x04))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))))
(libpart (lib Connector_Generic) (part Conn_01x06)
(description "Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_1x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_01x06))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))
(pin (num 5) (name Pin_5) (type passive))
(pin (num 6) (name Pin_6) (type passive))))
(libpart (lib Connector_Generic) (part Conn_02x03_Counter_Clockwise)
(description "Generic connector, double row, 02x03, counter clockwise pin numbering scheme (similar to DIP packge numbering), script generated (kicad-library-utils/schlib/autogen/connector/)")
(docs ~)
(footprints
(fp Connector*:*_2x??_*))
(fields
(field (name Reference) J)
(field (name Value) Conn_02x03_Counter_Clockwise))
(pins
(pin (num 1) (name Pin_1) (type passive))
(pin (num 2) (name Pin_2) (type passive))
(pin (num 3) (name Pin_3) (type passive))
(pin (num 4) (name Pin_4) (type passive))
(pin (num 5) (name Pin_5) (type passive))
(pin (num 6) (name Pin_6) (type passive))))
(libpart (lib Device) (part C)
(description "Unpolarized capacitor")
(docs ~)
(footprints
(fp C_*))
(fields
(field (name Reference) C)
(field (name Value) C))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib Device) (part Crystal_Small)
(description "Two pin crystal, small symbol")
(docs ~)
(footprints
(fp Crystal*))
(fields
(field (name Reference) Y)
(field (name Value) Crystal_Small))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))))
(libpart (lib Device) (part R)
(description Resistor)
(docs ~)
(footprints
(fp R_*))
(fields
(field (name Reference) R)
(field (name Value) R))
(pins
(pin (num 1) (name ~) (type passive))
(pin (num 2) (name ~) (type passive))))
(libpart (lib MAX485) (part MAX485)
(footprints
(fp DIL08)
(fp SO08))
(fields
(field (name Reference) U)
(field (name Value) MAX485)
(field (name Datasheet) "Maxim Integrated")
(field (name Field4) None)
(field (name Field5) Unavailable)
(field (name Field6) None)
(field (name Field7) MAX485))
(pins
(pin (num 1) (name RO) (type BiDi))
(pin (num 2) (name RE) (type BiDi))
(pin (num 3) (name DE) (type BiDi))
(pin (num 4) (name DI) (type BiDi))
(pin (num 5) (name GND) (type power_in))
(pin (num 6) (name A) (type BiDi))
(pin (num 7) (name B) (type BiDi))
(pin (num 8) (name VCC) (type power_in))))
(libpart (lib MCU_Microchip_ATtiny) (part ATtiny2313V-10SU)
(aliases
(alias ATtiny2313-20SU)
(alias ATtiny2313A-SU)
(alias ATtiny4313-SU))
(description "10MHz, 2kB Flash, 128B SRAM, 128B EEPROM, debugWIRE, SOIC-20")
(docs http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2543-AVR-ATtiny2313_Datasheet.pdf)
(footprints
(fp SOIC*7.5x12.8mm*P1.27mm*))
(fields
(field (name Reference) U)
(field (name Value) ATtiny2313V-10SU)
(field (name Footprint) Package_SO:SOIC-20W_7.5x12.8mm_P1.27mm))
(pins
(pin (num 1) (name PA2/~RESET) (type 3state))
(pin (num 2) (name PD0) (type 3state))
(pin (num 3) (name PD1) (type 3state))
(pin (num 4) (name PA1/XTAL2) (type 3state))
(pin (num 5) (name PA0/XTAL1) (type 3state))
(pin (num 6) (name PD2) (type 3state))
(pin (num 7) (name PD3) (type 3state))
(pin (num 8) (name PD4) (type 3state))
(pin (num 9) (name PD5) (type 3state))
(pin (num 10) (name GND) (type power_in))
(pin (num 11) (name PD6) (type 3state))
(pin (num 12) (name PB0) (type 3state))
(pin (num 13) (name PB1) (type 3state))
(pin (num 14) (name PB2) (type 3state))
(pin (num 15) (name PB3) (type 3state))
(pin (num 16) (name PB4) (type 3state))
(pin (num 17) (name PB5) (type 3state))
(pin (num 18) (name PB6) (type 3state))
(pin (num 19) (name PB7) (type 3state))
(pin (num 20) (name VCC) (type power_in))))
(libpart (lib PCA9685-TSSOP) (part PCA9685-TSSOP)
(fields
(field (name Reference) U)
(field (name Value) PCA9685-TSSOP)
(field (name Footprint) MODULE)
(field (name Datasheet) DOCUMENTATION))
(pins
(pin (num 1) (name A0) (type input))
(pin (num 2) (name A1) (type input))
(pin (num 3) (name A2) (type input))
(pin (num 4) (name A3) (type input))
(pin (num 5) (name A4) (type input))
(pin (num 6) (name LED0) (type output))
(pin (num 7) (name LED1) (type output))
(pin (num 8) (name LED2) (type output))
(pin (num 9) (name LED3) (type output))
(pin (num 10) (name LED4) (type output))
(pin (num 11) (name LED5) (type output))
(pin (num 12) (name LED6) (type output))
(pin (num 13) (name LED7) (type output))
(pin (num 14) (name GND) (type input))
(pin (num 15) (name LED8) (type output))
(pin (num 16) (name LED9) (type output))
(pin (num 17) (name LED10) (type output))
(pin (num 18) (name LED11) (type output))
(pin (num 19) (name LED12) (type output))
(pin (num 20) (name LED13) (type output))
(pin (num 21) (name LED14) (type output))
(pin (num 22) (name LED15) (type output))
(pin (num 23) (name OE) (type input))
(pin (num 24) (name A5) (type input))
(pin (num 25) (name EXTCLK) (type input))
(pin (num 26) (name SCL) (type input))
(pin (num 27) (name SDA) (type BiDi))
(pin (num 28) (name VCC) (type input))))
(libpart (lib Switch) (part SW_Push)
(description "Push button switch, generic, two pins")
(fields
(field (name Reference) SW)
(field (name Value) SW_Push))
(pins
(pin (num 1) (name 1) (type passive))
(pin (num 2) (name 2) (type passive))))
(libpart (lib Transistor_FET) (part BUZ11)
(aliases
(alias IRF3205)
(alias IRF540N)
(alias IRF740)
(alias IRLB8721PBF)
(alias IRLZ34N)
(alias IRLZ44N))
(description "30A Id, 50V Vds, N-Channel Power MOSFET, TO-220")
(docs http://www.fairchildsemi.com/ds/BU/BUZ11.pdf)
(footprints
(fp TO?220*))
(fields
(field (name Reference) Q)
(field (name Value) BUZ11)
(field (name Footprint) Package_TO_SOT_THT:TO-220-3_Vertical))
(pins
(pin (num 1) (name G) (type input))
(pin (num 2) (name D) (type passive))
(pin (num 3) (name S) (type passive)))))
(libraries
(library (logical AMS1117-5.0)
(uri P:\Electronics\Stairs\kicad/libs/AMS1117-5.0.lib))
(library (logical Connector_Generic)
(uri "C:\\Program Files\\KiCad\\share\\kicad\\library/Connector_Generic.lib"))
(library (logical Device)
(uri "C:\\Program Files\\KiCad\\share\\kicad\\library/Device.lib"))
(library (logical MAX485)
(uri P:\Electronics\Stairs\kicad/libs/MAX485.lib))
(library (logical MCU_Microchip_ATtiny)
(uri "C:\\Program Files\\KiCad\\share\\kicad\\library/MCU_Microchip_ATtiny.lib"))
(library (logical PCA9685-TSSOP)
(uri P:\Electronics\Stairs\kicad/libs/PCA9685-TSSOP.lib))
(library (logical Switch)
(uri "C:\\Program Files\\KiCad\\share\\kicad\\library/Switch.lib"))
(library (logical Transistor_FET)
(uri "C:\\Program Files\\KiCad\\share\\kicad\\library/Transistor_FET.lib")))
(nets
(net (code 1) (name "Net-(PCA9685-Pad25)")
(node (ref PCA9685) (pin 25)))
(net (code 2) (name "Net-(PCA9685-Pad15)")
(node (ref PCA9685) (pin 15)))
(net (code 3) (name "Net-(PCA9685-Pad16)")
(node (ref PCA9685) (pin 16)))
(net (code 4) (name "Net-(PCA9685-Pad17)")
(node (ref PCA9685) (pin 17)))
(net (code 5) (name "Net-(PCA9685-Pad18)")
(node (ref PCA9685) (pin 18)))
(net (code 6) (name "Net-(PCA9685-Pad19)")
(node (ref PCA9685) (pin 19)))
(net (code 7) (name "Net-(PCA9685-Pad20)")
(node (ref PCA9685) (pin 20)))
(net (code 8) (name /PD)
(node (ref R4) (pin 1))
(node (ref PCA9685) (pin 5))
(node (ref PCA9685) (pin 4))
(node (ref PCA9685) (pin 23))
(node (ref PCA9685) (pin 24))
(node (ref PCA9685) (pin 3))
(node (ref PCA9685) (pin 2))
(node (ref PCA9685) (pin 1)))
(net (code 9) (name GND)
(node (ref J1) (pin 4))
(node (ref AMS1117) (pin 1))
(node (ref U1) (pin 10))
(node (ref P3) (pin 5))
(node (ref SW1) (pin 2))
(node (ref C4) (pin 1))
(node (ref C3) (pin 1))
(node (ref C2) (pin 2))
(node (ref C1) (pin 2))
(node (ref Q1) (pin 3))
(node (ref P7) (pin 4))
(node (ref U2) (pin 5))
(node (ref P6) (pin 1))
(node (ref P5) (pin 2))
(node (ref P3) (pin 2))
(node (ref PCA9685) (pin 14))
(node (ref R4) (pin 2))
(node (ref Q2) (pin 3)))
(net (code 10) (name "Net-(PCA9685-Pad21)")
(node (ref PCA9685) (pin 21)))
(net (code 11) (name "Net-(P4-Pad3)")
(node (ref P4) (pin 3))
(node (ref Q1) (pin 2)))
(net (code 12) (name +12V)
(node (ref AMS1117) (pin 3))
(node (ref P6) (pin 2))
(node (ref P4) (pin 4))
(node (ref P5) (pin 1))
(node (ref P4) (pin 2)))
(net (code 13) (name "Net-(P4-Pad1)")
(node (ref Q2) (pin 2))
(node (ref P4) (pin 1)))
(net (code 14) (name "Net-(PCA9685-Pad22)")
(node (ref PCA9685) (pin 22)))
(net (code 15) (name "Net-(PCA9685-Pad13)")
(node (ref PCA9685) (pin 13)))
(net (code 16) (name "Net-(PCA9685-Pad12)")
(node (ref PCA9685) (pin 12)))
(net (code 17) (name "Net-(PCA9685-Pad11)")
(node (ref PCA9685) (pin 11)))
(net (code 18) (name "Net-(PCA9685-Pad10)")
(node (ref PCA9685) (pin 10)))
(net (code 19) (name "Net-(PCA9685-Pad9)")
(node (ref PCA9685) (pin 9)))
(net (code 20) (name "Net-(PCA9685-Pad8)")
(node (ref PCA9685) (pin 8)))
(net (code 21) (name "Net-(PCA9685-Pad7)")
(node (ref R3) (pin 1))
(node (ref PCA9685) (pin 7)))
(net (code 22) (name "Net-(PCA9685-Pad6)")
(node (ref R2) (pin 1))
(node (ref PCA9685) (pin 6)))
(net (code 23) (name "Net-(Q2-Pad1)")
(node (ref Q2) (pin 1))
(node (ref R3) (pin 2)))
(net (code 24) (name +5V)
(node (ref P3) (pin 3))
(node (ref PCA9685) (pin 28))
(node (ref U2) (pin 8))
(node (ref P3) (pin 6))
(node (ref J1) (pin 6))
(node (ref P7) (pin 3))
(node (ref R5) (pin 2))
(node (ref R1) (pin 1))
(node (ref U1) (pin 20))
(node (ref AMS1117) (pin 2))
(node (ref C4) (pin 2))
(node (ref C3) (pin 2)))
(net (code 25) (name RST)
(node (ref J1) (pin 3))
(node (ref U1) (pin 1))
(node (ref R5) (pin 1)))
(net (code 26) (name MOSI)
(node (ref PCA9685) (pin 27))
(node (ref U1) (pin 17))
(node (ref R1) (pin 2))
(node (ref P7) (pin 1))
(node (ref J1) (pin 5)))
(net (code 27) (name SCK)
(node (ref P7) (pin 2))
(node (ref J1) (pin 2))
(node (ref U1) (pin 19))
(node (ref PCA9685) (pin 26)))
(net (code 28) (name MISO)
(node (ref U1) (pin 18))
(node (ref J1) (pin 1)))
(net (code 29) (name "Net-(Q1-Pad1)")
(node (ref R2) (pin 2))
(node (ref Q1) (pin 1)))
(net (code 30) (name "Net-(SW1-Pad1)")
(node (ref SW1) (pin 1))
(node (ref U1) (pin 12)))
(net (code 31) (name "Net-(P3-Pad1)")
(node (ref U1) (pin 7))
(node (ref P3) (pin 1)))
(net (code 32) (name "Net-(U1-Pad15)")
(node (ref U1) (pin 15)))
(net (code 33) (name "Net-(U1-Pad9)")
(node (ref U1) (pin 9)))
(net (code 34) (name "Net-(U1-Pad8)")
(node (ref U1) (pin 8)))
(net (code 35) (name "Net-(U1-Pad16)")
(node (ref U1) (pin 16)))
(net (code 36) (name "Net-(U1-Pad14)")
(node (ref U1) (pin 14)))
(net (code 37) (name "Net-(U1-Pad13)")
(node (ref U1) (pin 13)))
(net (code 38) (name "Net-(P3-Pad4)")
(node (ref P3) (pin 4))
(node (ref U1) (pin 6)))
(net (code 39) (name "Net-(P1-Pad1)")
(node (ref U2) (pin 7))
(node (ref P2) (pin 2))
(node (ref P1) (pin 1)))
(net (code 40) (name "Net-(U1-Pad11)")
(node (ref U1) (pin 11))
(node (ref U2) (pin 3))
(node (ref U2) (pin 2)))
(net (code 41) (name "Net-(U1-Pad2)")
(node (ref U2) (pin 1))
(node (ref U1) (pin 2)))
(net (code 42) (name "Net-(U1-Pad3)")
(node (ref U1) (pin 3))
(node (ref U2) (pin 4)))
(net (code 43) (name "Net-(C1-Pad1)")
(node (ref U1) (pin 4))
(node (ref XTAL1) (pin 2))
(node (ref C1) (pin 1)))
(net (code 44) (name "Net-(C2-Pad1)")
(node (ref XTAL1) (pin 1))
(node (ref U1) (pin 5))
(node (ref C2) (pin 1)))
(net (code 45) (name "Net-(P1-Pad2)")
(node (ref P2) (pin 1))
(node (ref U2) (pin 6))
(node (ref P1) (pin 2)))))

30
kicad/Stairs.pro Normal file
View File

@ -0,0 +1,30 @@
update=2-9-2018 10:38:10
version=1
last_client=kicad
[pcbnew]
version=1
LastNetListRead=
UseCmpFile=1
PadDrill=0.600000000000
PadDrillOvalY=0.600000000000
PadSizeH=1.500000000000
PadSizeV=1.500000000000
PcbTextSizeV=1.500000000000
PcbTextSizeH=1.500000000000
PcbTextThickness=0.300000000000
ModuleTextSizeV=1.000000000000
ModuleTextSizeH=1.000000000000
ModuleTextSizeThickness=0.150000000000
SolderMaskClearance=0.000000000000
SolderMaskMinWidth=0.000000000000
DrawSegmentWidth=0.200000000000
BoardOutlineThickness=0.100000000000
ModuleOutlineThickness=0.150000000000
[cvpcb]
version=1
NetIExt=net
[general]
version=1
[eeschema]
version=1
LibDir=

992
kicad/Stairs.sch Normal file
View File

@ -0,0 +1,992 @@
EESchema Schematic File Version 4
LIBS:Stairs-cache
EELAYER 26 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 1 1
Title "Stairs submodule"
Date "2018-09-02"
Rev "1"
Comp "Mark van Renswoude"
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L PCA9685-TSSOP:PCA9685-TSSOP PCA9685
U 1 1 5B8AD5C2
P 7950 2600
F 0 "PCA9685" H 7950 3615 50 0000 C CNN
F 1 "PCA9685-TSSOP" H 7950 3524 50 0000 C CNN
F 2 "Housings_SSOP:TSSOP-28_4.4x9.7mm_Pitch0.65mm" H 7950 2600 50 0001 C CNN
F 3 "DOCUMENTATION" H 7950 2600 50 0001 C CNN
1 7950 2600
1 0 0 -1
$EndComp
$Comp
L MAX485:MAX485 U2
U 1 1 5B8AD72A
P 6050 5050
F 0 "U2" H 6050 5517 50 0000 C CNN
F 1 "MAX485" H 6050 5426 50 0000 C CNN
F 2 "Housings_SOIC:SO-8_5.3x6.2mm_Pitch1.27mm" H 6050 5050 60 0001 C CNN
F 3 "Maxim Integrated" H 6050 5050 50 0001 L BNN
F 4 "None" H 6050 5050 50 0001 L BNN "Field4"
F 5 "Unavailable" H 6050 5050 50 0001 L BNN "Field5"
F 6 "None" H 6050 5050 50 0001 L BNN "Field6"
F 7 "MAX485" H 6050 5050 50 0001 L BNN "Field7"
F 8 "" H 6050 5050 50 0001 L BNN "Field8"
1 6050 5050
1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x02 P6
U 1 1 5B8AD8CA
P 4650 6700
F 0 "P6" H 4728 6741 50 0000 L CNN
F 1 "PWR_IN" H 4728 6650 50 0000 L CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm" H 4650 6700 50 0001 C CNN
F 3 "" H 4650 6700 50 0001 C CNN
1 4650 6700
1 0 0 1
$EndComp
$Comp
L Connector_Generic:Conn_01x02 P5
U 1 1 5B8ADA74
P 3400 6600
F 0 "P5" H 3700 6550 50 0000 C CNN
F 1 "PWR_OUT" H 3750 6650 50 0000 C CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm" H 3400 6600 50 0001 C CNN
F 3 "" H 3400 6600 50 0001 C CNN
1 3400 6600
-1 0 0 -1
$EndComp
$Comp
L Connector_Generic:Conn_01x06 P3
U 1 1 5B8AE6A5
P 5700 6050
F 0 "P3" H 5778 6091 50 0000 L CNN
F 1 "SENSOR" H 5778 6000 50 0000 L CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-6_P5.08mm" H 5700 6050 50 0001 C CNN
F 3 "" H 5700 6050 50 0001 C CNN
1 5700 6050
1 0 0 1
$EndComp
$Comp
L Connector_Generic:Conn_01x02 P1
U 1 1 5B8AE987
P 7250 4650
F 0 "P1" H 7328 4691 50 0000 L CNN
F 1 "DATA_IN" H 7328 4600 50 0000 L CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm" H 7250 4650 50 0001 C CNN
F 3 "" H 7250 4650 50 0001 C CNN
1 7250 4650
0 1 -1 0
$EndComp
$Comp
L Connector_Generic:Conn_01x02 P2
U 1 1 5B8AE9DD
P 7250 5350
F 0 "P2" H 7550 5300 50 0000 C CNN
F 1 "DATA_OUT" H 7600 5400 50 0000 C CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-2_P5.08mm" H 7250 5350 50 0001 C CNN
F 3 "" H 7250 5350 50 0001 C CNN
1 7250 5350
0 1 1 0
$EndComp
$Comp
L AMS1117-5.0:AMS1117-5.0 AMS1117
U 1 1 5B8AFB24
P 2450 2150
F 0 "AMS1117" H 2450 2517 50 0000 C CNN
F 1 "AMS1117-5" H 2450 2426 50 0000 C CNN
F 2 "AMS1117-5.0:SOT229P700X180-4N" H 2450 2150 50 0001 L BNN
F 3 "AMS1117-5.0" H 2450 2150 50 0001 L BNN
F 4 "None" H 2450 2150 50 0001 L BNN "Field4"
F 5 "Unavailable" H 2450 2150 50 0001 L BNN "Field5"
F 6 "Sot223/Pkg 1-Amp 3.3-Volt Low Drop Out Voltage Regulatator" H 2450 2150 50 0001 L BNN "Field6"
F 7 "Advanced Monolithic Systems" H 2450 2150 50 0001 L BNN "Field7"
F 8 "None" H 2450 2150 50 0001 L BNN "Field8"
1 2450 2150
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR05
U 1 1 5B8AFFEE
P 3200 2400
F 0 "#PWR05" H 3200 2150 50 0001 C CNN
F 1 "GND" H 3205 2227 50 0000 C CNN
F 2 "" H 3200 2400 50 0001 C CNN
F 3 "" H 3200 2400 50 0001 C CNN
1 3200 2400
1 0 0 -1
$EndComp
$Comp
L power:+12V #PWR02
U 1 1 5B8B02AC
P 1700 1900
F 0 "#PWR02" H 1700 1750 50 0001 C CNN
F 1 "+12V" H 1715 2073 50 0000 C CNN
F 2 "" H 1700 1900 50 0001 C CNN
F 3 "" H 1700 1900 50 0001 C CNN
1 1700 1900
1 0 0 -1
$EndComp
Wire Wire Line
1700 1900 1700 2050
Wire Wire Line
1700 2050 1850 2050
Wire Wire Line
3050 2050 3200 2050
Wire Wire Line
3200 2050 3200 1900
Wire Wire Line
3050 2250 3200 2250
Wire Wire Line
3200 2250 3200 2400
$Comp
L Device:C C3
U 1 1 5B8B090B
P 4450 3500
F 0 "C3" H 4565 3546 50 0000 L CNN
F 1 "10µF" H 4565 3455 50 0000 L CNN
F 2 "Capacitors_Tantalum_SMD:CP_Tantalum_Case-D_EIA-7343-31_Hand" H 4488 3350 50 0001 C CNN
F 3 "" H 4450 3500 50 0001 C CNN
1 4450 3500
1 0 0 -1
$EndComp
$Comp
L Device:C C4
U 1 1 5B8B1267
P 4950 3500
F 0 "C4" H 5065 3546 50 0000 L CNN
F 1 "100nF" H 5065 3455 50 0000 L CNN
F 2 "Capacitors_SMD:C_1206_HandSoldering" H 4988 3350 50 0001 C CNN
F 3 "" H 4950 3500 50 0001 C CNN
1 4950 3500
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR011
U 1 1 5B8B1C8E
P 4000 5850
F 0 "#PWR011" H 4000 5600 50 0001 C CNN
F 1 "GND" H 4005 5677 50 0000 C CNN
F 2 "" H 4000 5850 50 0001 C CNN
F 3 "" H 4000 5850 50 0001 C CNN
1 4000 5850
1 0 0 -1
$EndComp
Wire Wire Line
4000 5750 4000 5850
$Comp
L power:GND #PWR013
U 1 1 5B8B3466
P 6750 5150
F 0 "#PWR013" H 6750 4900 50 0001 C CNN
F 1 "GND" H 6755 4977 50 0000 C CNN
F 2 "" H 6750 5150 50 0001 C CNN
F 3 "" H 6750 5150 50 0001 C CNN
1 6750 5150
1 0 0 -1
$EndComp
Wire Wire Line
6650 4850 6750 4850
Wire Wire Line
6650 5150 6750 5150
$Comp
L power:GND #PWR010
U 1 1 5B8B3A20
P 7050 3250
F 0 "#PWR010" H 7050 3000 50 0001 C CNN
F 1 "GND" H 7055 3077 50 0000 C CNN
F 2 "" H 7050 3250 50 0001 C CNN
F 3 "" H 7050 3250 50 0001 C CNN
1 7050 3250
1 0 0 -1
$EndComp
Wire Wire Line
7050 3250 7200 3250
Wire Wire Line
8850 1950 8700 1950
$Comp
L power:+5V #PWR03
U 1 1 5B8B883E
P 3200 1900
F 0 "#PWR03" H 3200 1750 50 0001 C CNN
F 1 "+5V" H 3215 2073 50 0000 C CNN
F 2 "" H 3200 1900 50 0001 C CNN
F 3 "" H 3200 1900 50 0001 C CNN
1 3200 1900
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR06
U 1 1 5B8B8A0A
P 4000 3500
F 0 "#PWR06" H 4000 3350 50 0001 C CNN
F 1 "+5V" H 4015 3673 50 0000 C CNN
F 2 "" H 4000 3500 50 0001 C CNN
F 3 "" H 4000 3500 50 0001 C CNN
1 4000 3500
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR012
U 1 1 5B8B8BF6
P 6750 4850
F 0 "#PWR012" H 6750 4700 50 0001 C CNN
F 1 "+5V" H 6765 5023 50 0000 C CNN
F 2 "" H 6750 4850 50 0001 C CNN
F 3 "" H 6750 4850 50 0001 C CNN
1 6750 4850
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR07
U 1 1 5B8B8E5A
P 8850 1950
F 0 "#PWR07" H 8850 1800 50 0001 C CNN
F 1 "+5V" H 8865 2123 50 0000 C CNN
F 2 "" H 8850 1950 50 0001 C CNN
F 3 "" H 8850 1950 50 0001 C CNN
1 8850 1950
1 0 0 -1
$EndComp
$Comp
L MCU_Microchip_ATtiny:ATtiny2313A-SU U1
U 1 1 5B8AD3B8
P 4000 4750
F 0 "U1" H 4000 6400 50 0000 C CNN
F 1 "ATTINY2313A-SU" H 4000 6300 50 0000 C CNN
F 2 "Housings_SOIC:SOIC-20W_7.5x12.8mm_Pitch1.27mm" H 4000 4750 50 0001 C CIN
F 3 "" H 4000 4750 50 0001 C CNN
1 4000 4750
1 0 0 -1
$EndComp
$Comp
L Device:C C2
U 1 1 5B8B93C9
P 2350 4000
F 0 "C2" H 2465 4046 50 0000 L CNN
F 1 "33pF" H 2465 3955 50 0000 L CNN
F 2 "Capacitors_SMD:C_1206_HandSoldering" H 2388 3850 50 0001 C CNN
F 3 "" H 2350 4000 50 0001 C CNN
1 2350 4000
0 1 1 0
$EndComp
$Comp
L Device:C C1
U 1 1 5B8B9824
P 2350 4500
F 0 "C1" H 2465 4546 50 0000 L CNN
F 1 "33pF" H 2465 4455 50 0000 L CNN
F 2 "Capacitors_SMD:C_1206_HandSoldering" H 2388 4350 50 0001 C CNN
F 3 "" H 2350 4500 50 0001 C CNN
1 2350 4500
0 1 1 0
$EndComp
$Comp
L Device:Crystal_Small XTAL1
U 1 1 5B8B9A62
P 2600 4250
F 0 "XTAL1" V 2554 4338 50 0000 L CNN
F 1 "8 Mhz" V 2645 4338 50 0000 L CNN
F 2 "Crystals:Crystal_HC49-U_Vertical" H 2600 4250 50 0001 C CNN
F 3 "" H 2600 4250 50 0001 C CNN
1 2600 4250
0 1 1 0
$EndComp
Wire Wire Line
3400 4350 2600 4350
Wire Wire Line
2600 4000 2500 4000
Wire Wire Line
2600 4350 2600 4500
Wire Wire Line
2600 4500 2500 4500
Wire Wire Line
3400 4150 2600 4150
Wire Wire Line
2600 4150 2600 4000
$Comp
L power:GND #PWR09
U 1 1 5B8B9DAC
P 2100 4500
F 0 "#PWR09" H 2100 4250 50 0001 C CNN
F 1 "GND" H 2105 4327 50 0000 C CNN
F 2 "" H 2100 4500 50 0001 C CNN
F 3 "" H 2100 4500 50 0001 C CNN
1 2100 4500
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR08
U 1 1 5B8B9E4D
P 2100 4000
F 0 "#PWR08" H 2100 3750 50 0001 C CNN
F 1 "GND" H 2105 3827 50 0000 C CNN
F 2 "" H 2100 4000 50 0001 C CNN
F 3 "" H 2100 4000 50 0001 C CNN
1 2100 4000
1 0 0 -1
$EndComp
Wire Wire Line
2200 4000 2100 4000
Wire Wire Line
2200 4500 2100 4500
Wire Wire Line
6650 5050 7250 5050
Wire Wire Line
7250 5000 7250 5050
Wire Wire Line
6650 4950 7050 4950
Wire Wire Line
7250 4950 7250 4850
Wire Wire Line
7150 4850 7150 5000
Wire Wire Line
7150 5000 7250 5000
Connection ~ 7250 5050
Wire Wire Line
7150 5150 7050 5150
Wire Wire Line
7050 5150 7050 4950
Connection ~ 7050 4950
Wire Wire Line
5450 4950 5300 4950
Wire Wire Line
5300 4950 5300 5050
Wire Wire Line
5300 5050 5450 5050
$Comp
L Device:R R1
U 1 1 5B8C2380
P 4900 4150
F 0 "R1" H 4970 4196 50 0000 L CNN
F 1 "10K" H 4970 4105 50 0000 L CNN
F 2 "Resistors_SMD:R_0603_HandSoldering" V 4830 4150 50 0001 C CNN
F 3 "" H 4900 4150 50 0001 C CNN
1 4900 4150
1 0 0 -1
$EndComp
$Comp
L power:+5V #PWR014
U 1 1 5B8C2462
P 4900 3950
F 0 "#PWR014" H 4900 3800 50 0001 C CNN
F 1 "+5V" H 4915 4123 50 0000 C CNN
F 2 "" H 4900 3950 50 0001 C CNN
F 3 "" H 4900 3950 50 0001 C CNN
1 4900 3950
1 0 0 -1
$EndComp
Wire Wire Line
4900 3950 4900 4000
Wire Wire Line
4600 4450 4900 4450
Wire Wire Line
4900 4450 4900 4300
$Comp
L Connector_Generic:Conn_01x04 P7
U 1 1 5B8C32B0
P 9800 2150
F 0 "P7" H 9877 2191 50 0000 L CNN
F 1 "SSD1306" H 9877 2100 50 0000 L CNN
F 2 "Pin_Headers:Pin_Header_Straight_1x04_Pitch2.54mm" H 9800 2150 50 0001 C CNN
F 3 "" H 9800 2150 50 0001 C CNN
1 9800 2150
1 0 0 -1
$EndComp
Text Notes 10350 2400 0 60 ~ 0
1 = SDA\n2 = SCL\n3 = VCC\n4 = GND
$Comp
L power:+5V #PWR016
U 1 1 5B8C452D
P 9350 2250
F 0 "#PWR016" H 9350 2100 50 0001 C CNN
F 1 "+5V" H 9365 2423 50 0000 C CNN
F 2 "" H 9350 2250 50 0001 C CNN
F 3 "" H 9350 2250 50 0001 C CNN
1 9350 2250
-1 0 0 1
$EndComp
$Comp
L power:GND #PWR018
U 1 1 5B8C457C
P 9500 2350
F 0 "#PWR018" H 9500 2100 50 0001 C CNN
F 1 "GND" H 9505 2177 50 0000 C CNN
F 2 "" H 9500 2350 50 0001 C CNN
F 3 "" H 9500 2350 50 0001 C CNN
1 9500 2350
1 0 0 -1
$EndComp
Wire Wire Line
9600 2350 9500 2350
Wire Wire Line
9600 2250 9350 2250
Wire Wire Line
8700 2050 8950 2050
Wire Wire Line
8700 2150 9150 2150
Connection ~ 9150 2150
Connection ~ 8950 2050
Connection ~ 4900 4450
Wire Wire Line
5150 5150 5450 5150
$Comp
L Transistor_FET:IRLB8721PBF Q1
U 1 1 5B8C8EA8
P 6050 2250
F 0 "Q1" V 6378 2250 50 0000 C CNN
F 1 "IRLB8721PBF" V 6287 2250 50 0000 C CNN
F 2 "TO_SOT_Packages_THT:TO-220-3_Horizontal" H 6300 2175 50 0001 L CIN
F 3 "" H 6050 2250 50 0001 L CNN
1 6050 2250
0 -1 -1 0
$EndComp
Wire Wire Line
5450 4850 4600 4850
Wire Wire Line
4600 4950 5150 4950
Wire Wire Line
5150 4950 5150 5150
Wire Wire Line
4600 4650 4700 4650
Wire Wire Line
5450 4650 5450 3950
Wire Wire Line
5450 3950 9150 3950
Wire Wire Line
9150 3950 9150 2150
Wire Wire Line
8950 2050 8950 3750
Wire Wire Line
8950 3750 5250 3750
Wire Wire Line
5250 3750 5250 4450
$Comp
L Device:R R2
U 1 1 5B8CAD1E
P 6700 2450
F 0 "R2" V 6493 2450 50 0000 C CNN
F 1 "150" V 6584 2450 50 0000 C CNN
F 2 "Resistors_SMD:R_0603_HandSoldering" V 6630 2450 50 0001 C CNN
F 3 "" H 6700 2450 50 0001 C CNN
1 6700 2450
0 1 1 0
$EndComp
$Comp
L Device:R R3
U 1 1 5B8CAE68
P 6700 2550
F 0 "R3" V 6900 2550 50 0000 C CNN
F 1 "150" V 6800 2550 50 0000 C CNN
F 2 "Resistors_SMD:R_0603_HandSoldering" V 6630 2550 50 0001 C CNN
F 3 "" H 6700 2550 50 0001 C CNN
1 6700 2550
0 1 1 0
$EndComp
$Comp
L Transistor_FET:IRLB8721PBF Q2
U 1 1 5B8CB00E
P 6050 2750
F 0 "Q2" V 6286 2750 50 0000 C CNN
F 1 "IRLB8721PBF" V 6377 2750 50 0000 C CNN
F 2 "TO_SOT_Packages_THT:TO-220-3_Horizontal" H 6300 2675 50 0001 L CIN
F 3 "" H 6050 2750 50 0001 L CNN
1 6050 2750
0 -1 1 0
$EndComp
$Comp
L power:GND #PWR015
U 1 1 5B8CB569
P 6300 2150
F 0 "#PWR015" H 6300 1900 50 0001 C CNN
F 1 "GND" H 6305 1977 50 0000 C CNN
F 2 "" H 6300 2150 50 0001 C CNN
F 3 "" H 6300 2150 50 0001 C CNN
1 6300 2150
0 -1 -1 0
$EndComp
$Comp
L power:GND #PWR020
U 1 1 5B8CB5C8
P 6300 2850
F 0 "#PWR020" H 6300 2600 50 0001 C CNN
F 1 "GND" H 6305 2677 50 0000 C CNN
F 2 "" H 6300 2850 50 0001 C CNN
F 3 "" H 6300 2850 50 0001 C CNN
1 6300 2850
0 -1 -1 0
$EndComp
$Comp
L Connector_Generic:Conn_01x04 P4
U 1 1 5B8CBF27
P 5050 2550
F 0 "P4" H 5128 2591 50 0000 L CNN
F 1 "LED" H 5128 2500 50 0000 L CNN
F 2 "Terminal_Blocks:TerminalBlock_bornier-4_P5.08mm" H 5050 2550 50 0001 C CNN
F 3 "" H 5050 2550 50 0001 C CNN
1 5050 2550
-1 0 0 1
$EndComp
Text Notes 4000 2700 0 60 ~ 0
1 = LED1 +12V\n2 = LED1 GND\n3 = LED2 +12V\n4 = LED2 GND
Wire Wire Line
6250 2150 6300 2150
Wire Wire Line
6250 2850 6300 2850
$Comp
L power:+12V #PWR017
U 1 1 5B8CDFC1
P 5400 2350
F 0 "#PWR017" H 5400 2200 50 0001 C CNN
F 1 "+12V" H 5415 2523 50 0000 C CNN
F 2 "" H 5400 2350 50 0001 C CNN
F 3 "" H 5400 2350 50 0001 C CNN
1 5400 2350
0 1 1 0
$EndComp
$Comp
L power:+12V #PWR019
U 1 1 5B8CE24A
P 5400 2550
F 0 "#PWR019" H 5400 2400 50 0001 C CNN
F 1 "+12V" H 5415 2723 50 0000 C CNN
F 2 "" H 5400 2550 50 0001 C CNN
F 3 "" H 5400 2550 50 0001 C CNN
1 5400 2550
0 1 1 0
$EndComp
Wire Wire Line
5250 2350 5400 2350
Wire Wire Line
5250 2550 5400 2550
Wire Wire Line
5250 2450 5750 2450
Wire Wire Line
5750 2450 5750 2150
Wire Wire Line
5750 2150 5850 2150
Wire Wire Line
5250 2650 5750 2650
Wire Wire Line
5750 2650 5750 2850
Wire Wire Line
5750 2850 5850 2850
Wire Wire Line
6550 2550 6050 2550
Wire Wire Line
6850 2450 7200 2450
Wire Wire Line
7200 2550 6850 2550
Wire Wire Line
4000 3650 4450 3650
Connection ~ 4450 3650
Wire Wire Line
4000 3650 4000 3500
$Comp
L power:GND #PWR022
U 1 1 5B8D17BD
P 4700 3250
F 0 "#PWR022" H 4700 3000 50 0001 C CNN
F 1 "GND" H 4705 3077 50 0000 C CNN
F 2 "" H 4700 3250 50 0001 C CNN
F 3 "" H 4700 3250 50 0001 C CNN
1 4700 3250
-1 0 0 1
$EndComp
Wire Wire Line
4450 3350 4450 3250
Wire Wire Line
4450 3250 4700 3250
Wire Wire Line
4950 3250 4950 3350
Connection ~ 4700 3250
NoConn ~ 7200 2650
NoConn ~ 7200 2750
NoConn ~ 7200 2850
NoConn ~ 7200 2950
NoConn ~ 7200 3050
NoConn ~ 7200 3150
NoConn ~ 8700 2550
NoConn ~ 8700 2650
NoConn ~ 8700 2750
NoConn ~ 8700 2850
NoConn ~ 8700 2950
NoConn ~ 8700 3050
NoConn ~ 8700 3150
NoConn ~ 8700 3250
NoConn ~ 8700 2250
Wire Wire Line
7050 4950 7250 4950
Wire Wire Line
9150 2150 9600 2150
Wire Wire Line
8950 2050 9600 2050
Wire Wire Line
4900 4450 5250 4450
Wire Wire Line
4450 3650 4950 3650
Wire Wire Line
4700 3250 4950 3250
Wire Wire Line
7200 2350 7100 2350
Wire Wire Line
7100 2350 7100 2250
Wire Wire Line
7200 1950 7100 1950
Connection ~ 7100 1950
Wire Wire Line
7100 1950 7100 1850
Wire Wire Line
7200 2050 7100 2050
Connection ~ 7100 2050
Wire Wire Line
7100 2050 7100 1950
Wire Wire Line
7200 2150 7100 2150
Connection ~ 7100 2150
Wire Wire Line
7100 2150 7100 2050
Wire Wire Line
7200 2250 7100 2250
Connection ~ 7100 2250
Wire Wire Line
7100 2250 7100 2150
$Comp
L Device:R R4
U 1 1 5B8C6BF9
P 7100 1700
F 0 "R4" V 6893 1700 50 0000 C CNN
F 1 "10K" V 6984 1700 50 0000 C CNN
F 2 "Resistors_SMD:R_0603_HandSoldering" V 7030 1700 50 0001 C CNN
F 3 "" H 7100 1700 50 0001 C CNN
1 7100 1700
-1 0 0 1
$EndComp
$Comp
L power:GND #PWR021
U 1 1 5B8C6F7E
P 7100 1500
F 0 "#PWR021" H 7100 1250 50 0001 C CNN
F 1 "GND" H 7105 1327 50 0000 C CNN
F 2 "" H 7100 1500 50 0001 C CNN
F 3 "" H 7100 1500 50 0001 C CNN
1 7100 1500
-1 0 0 1
$EndComp
Wire Wire Line
7100 1500 7100 1550
Wire Wire Line
7000 1950 7100 1950
Text Label 7000 1950 2 50 ~ 0
PD
Wire Wire Line
8800 2350 8750 2350
Text Label 8800 2350 0 50 ~ 0
PD
Wire Wire Line
8700 2450 8750 2450
Wire Wire Line
8750 2450 8750 2350
Connection ~ 8750 2350
Wire Wire Line
8750 2350 8700 2350
Text Notes 5150 6750 0 60 ~ 0
1 = +12V\n2 = GND
Wire Wire Line
4450 6700 4000 6700
$Comp
L power:GND #PWR024
U 1 1 5B8E6FA0
P 4000 6850
F 0 "#PWR024" H 4000 6600 50 0001 C CNN
F 1 "GND" H 4005 6677 50 0000 C CNN
F 2 "" H 4000 6850 50 0001 C CNN
F 3 "" H 4000 6850 50 0001 C CNN
1 4000 6850
1 0 0 -1
$EndComp
$Comp
L power:+12V #PWR023
U 1 1 5B8E7817
P 4000 6500
F 0 "#PWR023" H 4000 6350 50 0001 C CNN
F 1 "+12V" H 4015 6673 50 0000 C CNN
F 2 "" H 4000 6500 50 0001 C CNN
F 3 "" H 4000 6500 50 0001 C CNN
1 4000 6500
1 0 0 -1
$EndComp
Wire Wire Line
4000 6500 4000 6600
Connection ~ 4000 6600
Wire Wire Line
4000 6600 4450 6600
Wire Wire Line
4000 6850 4000 6700
Connection ~ 4000 6700
$Comp
L power:+12V #PWR0101
U 1 1 5B8ED6A9
P 1200 1900
F 0 "#PWR0101" H 1200 1750 50 0001 C CNN
F 1 "+12V" H 1215 2073 50 0000 C CNN
F 2 "" H 1200 1900 50 0001 C CNN
F 3 "" H 1200 1900 50 0001 C CNN
1 1200 1900
1 0 0 -1
$EndComp
$Comp
L power:PWR_FLAG #FLG0101
U 1 1 5B8ED6E0
P 1200 1900
F 0 "#FLG0101" H 1200 1975 50 0001 C CNN
F 1 "PWR_FLAG" H 1200 2073 50 0000 C CNN
F 2 "" H 1200 1900 50 0001 C CNN
F 3 "" H 1200 1900 50 0001 C CNN
1 1200 1900
-1 0 0 1
$EndComp
NoConn ~ 4600 4050
NoConn ~ 4600 4150
NoConn ~ 4600 4250
NoConn ~ 4600 4350
NoConn ~ 4600 5250
NoConn ~ 4600 5350
$Comp
L Device:R R5
U 1 1 5B925FBE
P 3250 3800
F 0 "R5" V 3043 3800 50 0000 C CNN
F 1 "10K" V 3134 3800 50 0000 C CNN
F 2 "Resistors_SMD:R_0603_HandSoldering" V 3180 3800 50 0001 C CNN
F 3 "" H 3250 3800 50 0001 C CNN
1 3250 3800
-1 0 0 1
$EndComp
$Comp
L power:+5V #PWR0102
U 1 1 5B92641E
P 3250 3550
F 0 "#PWR0102" H 3250 3400 50 0001 C CNN
F 1 "+5V" H 3265 3723 50 0000 C CNN
F 2 "" H 3250 3550 50 0001 C CNN
F 3 "" H 3250 3550 50 0001 C CNN
1 3250 3550
1 0 0 -1
$EndComp
Wire Wire Line
3250 3550 3250 3650
Wire Wire Line
3250 3950 3400 3950
$Comp
L power:GND #PWR0103
U 1 1 5B92CB1E
P 1200 2500
F 0 "#PWR0103" H 1200 2250 50 0001 C CNN
F 1 "GND" H 1205 2327 50 0000 C CNN
F 2 "" H 1200 2500 50 0001 C CNN
F 3 "" H 1200 2500 50 0001 C CNN
1 1200 2500
1 0 0 -1
$EndComp
$Comp
L power:PWR_FLAG #FLG0102
U 1 1 5B92CB57
P 1200 2500
F 0 "#FLG0102" H 1200 2575 50 0001 C CNN
F 1 "PWR_FLAG" H 1200 2673 50 0000 C CNN
F 2 "" H 1200 2500 50 0001 C CNN
F 3 "" H 1200 2500 50 0001 C CNN
1 1200 2500
1 0 0 -1
$EndComp
Connection ~ 2600 4150
Connection ~ 2600 4350
Connection ~ 4000 3650
Text Notes 6100 6300 0 60 ~ 0
1 = Sensor 1 +5V\n2 = Sensor 1 GND\n3 = Sensor 1 DATA\n4 = Sensor 2 +5V\n5 = Sensor 2 GND\n6 = Sensor 2 DATA\n
$Comp
L power:+5V #PWR0104
U 1 1 5B93F20D
P 5350 5750
F 0 "#PWR0104" H 5350 5600 50 0001 C CNN
F 1 "+5V" H 5350 6050 50 0000 C CNN
F 2 "" H 5350 5750 50 0001 C CNN
F 3 "" H 5350 5750 50 0001 C CNN
1 5350 5750
0 -1 -1 0
$EndComp
$Comp
L power:+5V #PWR0105
U 1 1 5B93F49C
P 5350 6050
F 0 "#PWR0105" H 5350 5900 50 0001 C CNN
F 1 "+5V" H 5350 6350 50 0000 C CNN
F 2 "" H 5350 6050 50 0001 C CNN
F 3 "" H 5350 6050 50 0001 C CNN
1 5350 6050
0 -1 -1 0
$EndComp
$Comp
L power:GND #PWR0106
U 1 1 5B93F503
P 5350 5850
F 0 "#PWR0106" H 5350 5600 50 0001 C CNN
F 1 "GND" H 5355 5677 50 0000 C CNN
F 2 "" H 5350 5850 50 0001 C CNN
F 3 "" H 5350 5850 50 0001 C CNN
1 5350 5850
0 1 1 0
$EndComp
$Comp
L power:GND #PWR0107
U 1 1 5B93F5DD
P 5350 6150
F 0 "#PWR0107" H 5350 5900 50 0001 C CNN
F 1 "GND" H 5355 5977 50 0000 C CNN
F 2 "" H 5350 6150 50 0001 C CNN
F 3 "" H 5350 6150 50 0001 C CNN
1 5350 6150
0 1 1 0
$EndComp
Wire Wire Line
5350 5750 5500 5750
Wire Wire Line
5350 5850 5500 5850
Wire Wire Line
5350 6050 5500 6050
Wire Wire Line
5350 6150 5500 6150
Wire Wire Line
4600 5050 4850 5050
Wire Wire Line
4850 5050 4850 5950
Wire Wire Line
4850 5950 5500 5950
Wire Wire Line
4600 5150 4750 5150
Wire Wire Line
4750 5150 4750 6250
Wire Wire Line
4750 6250 5500 6250
Text Notes 7450 5050 0 60 ~ 0
1 = RS485 A\n2 = RS485 B
Connection ~ 4000 5850
Wire Wire Line
7250 5050 7250 5150
Wire Wire Line
3600 6600 4000 6600
Wire Wire Line
3600 6700 4000 6700
Wire Wire Line
6050 2450 6550 2450
$Comp
L Connector_Generic:Conn_02x03_Counter_Clockwise J1
U 1 1 5BEBD38C
P 9850 5900
F 0 "J1" H 9900 6217 50 0000 C CNN
F 1 "PROG" H 9900 6126 50 0000 C CNN
F 2 "Pin_Headers:Pin_Header_Straight_2x03_Pitch2.54mm" H 9850 5900 50 0001 C CNN
F 3 "~" H 9850 5900 50 0001 C CNN
1 9850 5900
1 0 0 -1
$EndComp
Text GLabel 9650 5800 0 50 Input ~ 0
MISO
Text GLabel 9650 5900 0 50 Input ~ 0
SCK
Text GLabel 9650 6000 0 50 Input ~ 0
RST
Text GLabel 10150 5900 2 50 Input ~ 0
MOSI
$Comp
L power:+5V #PWR0108
U 1 1 5BEBE75C
P 10250 5800
F 0 "#PWR0108" H 10250 5650 50 0001 C CNN
F 1 "+5V" H 10265 5973 50 0000 C CNN
F 2 "" H 10250 5800 50 0001 C CNN
F 3 "" H 10250 5800 50 0001 C CNN
1 10250 5800
1 0 0 -1
$EndComp
$Comp
L power:GND #PWR0109
U 1 1 5BEBE86F
P 10250 6000
F 0 "#PWR0109" H 10250 5750 50 0001 C CNN
F 1 "GND" H 10255 5827 50 0000 C CNN
F 2 "" H 10250 6000 50 0001 C CNN
F 3 "" H 10250 6000 50 0001 C CNN
1 10250 6000
1 0 0 -1
$EndComp
Wire Wire Line
10150 5800 10250 5800
Wire Wire Line
10150 6000 10250 6000
Text GLabel 3100 3950 0 50 Input ~ 0
RST
Wire Wire Line
3100 3950 3250 3950
Connection ~ 3250 3950
Text GLabel 4600 4550 2 50 Input ~ 0
MISO
Text GLabel 4850 4750 2 50 Input ~ 0
SCK
Text GLabel 5050 4550 2 50 Input ~ 0
MOSI
Wire Wire Line
4700 4650 4700 4750
Wire Wire Line
4700 4750 4850 4750
Connection ~ 4700 4650
Wire Wire Line
4700 4650 5450 4650
Wire Wire Line
4900 4450 4900 4550
Wire Wire Line
4900 4550 5050 4550
Wire Wire Line
5300 5050 5300 5450
Wire Wire Line
5300 5450 4600 5450
Connection ~ 5300 5050
$Comp
L Switch:SW_Push SW1
U 1 1 5BF329CF
P 5700 3500
F 0 "SW1" H 5700 3785 50 0000 C CNN
F 1 "Button" H 5700 3694 50 0000 C CNN
F 2 "SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_:SW4-SMD-5.2X5.2X1.5MM" H 5700 3700 50 0001 C CNN
F 3 "" H 5700 3700 50 0001 C CNN
1 5700 3500
1 0 0 -1
$EndComp
Wire Wire Line
4600 3950 4800 3950
Wire Wire Line
4800 3950 4800 3700
Wire Wire Line
4800 3700 5500 3700
Wire Wire Line
5500 3700 5500 3500
$Comp
L power:GND #PWR01
U 1 1 5BF4430D
P 5900 3500
F 0 "#PWR01" H 5900 3250 50 0001 C CNN
F 1 "GND" H 5905 3327 50 0000 C CNN
F 2 "" H 5900 3500 50 0001 C CNN
F 3 "" H 5900 3500 50 0001 C CNN
1 5900 3500
1 0 0 -1
$EndComp
$EndSCHEMATC

5
kicad/fp-lib-table Normal file
View File

@ -0,0 +1,5 @@
(fp_lib_table
(lib (name AMS1117-5.0)(type Legacy)(uri ${KIPRJMOD}/libs/AMS1117-5.0.mod)(options "")(descr ""))
(lib (name MAX485)(type Legacy)(uri ${KIPRJMOD}/libs/MAX485.mod)(options "")(descr ""))
(lib (name SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_)(type Legacy)(uri ${KIPRJMOD}/libs/SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_.mod)(options "")(descr ""))
)

View File

@ -0,0 +1,29 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#(c) SnapEDA 2016 (snapeda.com)
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
#
# AMS1117-5.0
#
DEF AMS1117-5.0 U 0 40 Y Y 1 L N
F0 "U" -400 220 50 H V L BNN
F1 "AMS1117-5.0" -401 -321 50 H V L BNN
F2 "SOT229P700X180-4N" 0 0 50 H I L BNN
F3 "Sot223/Pkg 1-Amp 5-Volt Low Drop Out Voltage Regulatator" 0 0 50 H I L BNN
F4 "Unavailable" 0 0 50 H I L BNN
F5 "Advanced Monolithic Systems" 0 0 50 H I L BNN
F6 "None" 0 0 50 H I L BNN
F7 "None" 0 0 50 H I L BNN
F8 "AMS1117-5.0" 0 0 50 H I L BNN
DRAW
P 2 0 0 10 -400 200 400 200 N
P 2 0 0 10 400 200 400 -200 N
P 2 0 0 10 400 -200 -400 -200 N
P 2 0 0 10 -400 -200 -400 200 N
X VIN 3 -600 100 200 R 40 40 0 0 I
X VOUT 2 600 100 200 L 40 40 0 0 O
X ADJ/GND 1 600 -100 200 L 40 40 0 0 W
ENDDRAW
ENDDEF
#
# End Library

View File

@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

View File

@ -0,0 +1,24 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# AMS1117-5.0
#
DEF AMS1117-5.0 U 0 40 Y Y 1 L N
F0 "U" -400 220 50 H V L BNN
F1 "AMS1117-5.0" -401 -321 50 H V L BNN
F2 "SOT229P700X180-4N" 0 0 50 H I L BNN
F3 "Sot223/Pkg 1-Amp 5-Volt Low Drop Out Voltage Regulatator" 0 0 50 H I L BNN
F4 "Unavailable" 0 0 50 H I L BNN
F5 "Advanced Monolithic Systems" 0 0 50 H I L BNN
F6 "None" 0 0 50 H I L BNN
F7 "None" 0 0 50 H I L BNN
F8 "AMS1117-5.0" 0 0 50 H I L BNN
DRAW
S -400 200 400 -200 0 1 0 f
X ADJ/GND 1 600 -100 200 L 40 40 0 0 W
X VOUT 2 600 100 200 L 40 40 0 0 O
X VIN 3 -600 100 200 R 40 40 0 0 I
ENDDRAW
ENDDEF
#
#End Library

View File

@ -0,0 +1,73 @@
PCBNEW-LibModule-V1
# encoding utf-8
Units mm
$INDEX
SOT229P700X180-4N
$EndINDEX
$MODULE SOT229P700X180-4N
Po 0 0 0 15 00000000 00000000 ~~
Li SOT229P700X180-4N
Cd
Sc 00000000
At SMD
Op 0 0 0
.SolderMask 0
.SolderPaste 0
T0 -1.15242 -5.14581 1.00211 1.00211 0 0.05 N V 21 "SOT229P700X180-4N"
T1 -0.516467 5.54073 1.00285 1.00285 0 0.05 N V 21 "VAL**"
DS -3.36 1.86 -3.36 -1.86 0.127 24
DS -3.36 -1.86 3.36 -1.86 0.127 24
DS 3.36 -1.86 3.36 1.86 0.127 24
DS 3.36 1.86 -3.36 1.86 0.127 24
DS -3.36 1.86 -3.36 -1.86 0.127 21
DS 3.36 1.86 3.36 -1.86 0.127 21
DS -3.36 1.86 -3.1 1.86 0.127 21
DS 3.11 1.86 3.36 1.86 0.127 21
DS 3.36 -1.86 1.87 -1.86 0.127 21
DS -1.76 -1.86 -3.36 -1.86 0.127 21
DC -2.29 4.373 -2.19 4.373 0.2 21
DS -3.61 -2.11 -3.61 2.11 0.05 26
DS -3.61 2.11 -3.01 2.11 0.05 26
DS -3.01 2.11 -3.01 4.25 0.05 26
DS -3.01 4.25 3.01 4.25 0.05 26
DS 3.01 4.25 3.01 2.11 0.05 26
DS 3.01 2.11 3.61 2.11 0.05 26
DS 3.61 2.11 3.61 -2.11 0.05 26
DS 3.61 -2.11 1.87 -2.11 0.05 26
DS 1.87 -2.11 1.87 -4.25 0.05 26
DS 1.87 -4.25 -1.87 -4.25 0.05 26
DS -1.87 -4.25 -1.87 -2.11 0.05 26
DS -1.87 -2.11 -3.61 -2.11 0.05 26
$PAD
Sh "1" R 0.93 1.31 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -2.29 3.345
$EndPAD
$PAD
Sh "2" R 0.93 1.31 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 0 3.345
$EndPAD
$PAD
Sh "3" R 0.93 1.31 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 2.29 3.345
$EndPAD
$PAD
Sh "4" R 3.24 1.31 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 0 -3.345
$EndPAD
$EndMODULE SOT229P700X180-4N

3
kicad/libs/MAX485.bck Normal file
View File

@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

3
kicad/libs/MAX485.dcm Normal file
View File

@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

32
kicad/libs/MAX485.lib Normal file
View File

@ -0,0 +1,32 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# MAX485
#
DEF MAX485 U 0 40 Y Y 1 L N
F0 "U" -401 301 50 H V L BNN
F1 "MAX485" -401 -301 50 H V L BNN
F2 "" 0 0 50 H I C CNN
F3 "Maxim Integrated" 0 0 50 H I L BNN
F4 "None" 0 0 50 H I L BNN
F5 "Unavailable" 0 0 50 H I L BNN
F6 "None" 0 0 50 H I L BNN
F7 "MAX485" 0 0 50 H I L BNN
$FPLIST
DIL08
SO08
$ENDFPLIST
DRAW
S -400 300 400 -200 0 1 0 f
X RO 1 -600 200 200 R 40 40 0 0 B
X RE 2 -600 100 200 R 40 40 0 0 B I
X DE 3 -600 0 200 R 40 40 0 0 B
X DI 4 -600 -100 200 R 40 40 0 0 B
X GND 5 600 -100 200 L 40 40 0 0 W
X A 6 600 0 200 L 40 40 0 0 B
X B 7 600 100 200 L 40 40 0 0 B
X VCC 8 600 200 200 L 40 40 0 0 W
ENDDRAW
ENDDEF
#
#End Library

214
kicad/libs/MAX485.mod Normal file
View File

@ -0,0 +1,214 @@
PCBNEW-LibModule-V1
# encoding utf-8
Units mm
$INDEX
DIL08
SO08
$EndINDEX
$MODULE DIL08
Po 0 0 0 15 00000000 00000000 ~~
Li DIL08
Cd <b>Dual In Line</b>
Sc 00000000
At STD
Op 0 0 0
.SolderMask 0
.SolderPaste 0
T0 -6.35758 1.27152 1.00119 1.00119 900 0.05 N V 21 "DIL08"
T1 5.00698e-06 -2.00279e-06 1.00244 1.00244 0 0.05 N V 21 "VAL**"
DS 5.08 -5.08 -5.08 -5.08 0.1524 21
DS -5.08 5.08 5.08 5.08 0.1524 21
DS 5.08 -5.08 5.08 -2.54 0.1524 21
DS -5.08 -5.08 -5.08 -2.54 0.1524 21
DS -5.08 5.08 -5.08 2.54 0.1524 21
DA -5.08 0 -5.08 -1.016 1800 0.1524 21
DS -5.08 -2.54 5.08 -2.54 0.1524 21
DS -5.08 -2.54 -5.08 -1.016 0.2032 21
DS 5.08 -2.54 5.08 2.54 0.1524 21
DS -5.08 2.54 5.08 2.54 0.1524 21
DS -5.08 2.54 -5.08 1.016 0.1524 21
DS 5.08 2.54 5.08 5.08 0.1524 21
$PAD
Sh "1" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po -3.81 3.81
$EndPAD
$PAD
Sh "2" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po -1.27 3.81
$EndPAD
$PAD
Sh "3" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po 1.27 3.81
$EndPAD
$PAD
Sh "4" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po 3.81 3.81
$EndPAD
$PAD
Sh "5" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po 3.81 -3.81
$EndPAD
$PAD
Sh "6" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po 1.27 -3.81
$EndPAD
$PAD
Sh "7" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po -1.27 -3.81
$EndPAD
$PAD
Sh "8" C 1.6002 1.6002 0 0 0
Dr 0.8128 0 0
At STD N 00C0FFFF
.SolderMask 0
Ne 0 ""
Po -3.81 -3.81
$EndPAD
$EndMODULE DIL08
$MODULE SO08
Po 0 0 0 15 00000000 00000000 ~~
Li SO08
Cd <b>Small Outline Package</b> Fits JEDEC packages (narrow SOIC-8)
Sc 00000000
At SMD
Op 0 0 0
.SolderMask 0
.SolderPaste 0
T0 -0.45744 -0.203305 0.320166 0.320166 0 0.05 N V 21 "SO08"
T1 -0.254561 0.432759 0.32071 0.32071 0 0.05 N V 21 "VAL**"
DS -2.362 1.803 2.362 1.803 0.1524 24
DS 2.362 -1.803 -2.362 -1.803 0.1524 24
DC -1.8034 0.9906 -1.6598 0.9906 0.2032 21
DP 0 0 0 0 4 0 24
Dl -2.08797 1.8542
Dl -1.7272 1.8542
Dl -1.7272 2.87731
Dl -2.08797 2.87731
DP 0 0 0 0 4 0 24
Dl -0.813844 1.8542
Dl -0.4572 1.8542
Dl -0.4572 2.87389
Dl -0.813844 2.87389
DP 0 0 0 0 4 0 24
Dl 0.458097 1.8542
Dl 0.8128 1.8542
Dl 0.8128 2.87584
Dl 0.458097 2.87584
DP 0 0 0 0 4 0 24
Dl 1.72892 1.8542
Dl 2.0828 1.8542
Dl 2.0828 2.87306
Dl 1.72892 2.87306
DP 0 0 0 0 4 0 24
Dl -2.08675 -2.8702
Dl -1.7272 -2.8702
Dl -1.7272 -1.85772
Dl -2.08675 -1.85772
DP 0 0 0 0 4 0 24
Dl -0.813701 -2.8702
Dl -0.4572 -2.8702
Dl -0.4572 -1.85626
Dl -0.813701 -1.85626
DP 0 0 0 0 4 0 24
Dl 0.458322 -2.8702
Dl 0.8128 -2.8702
Dl 0.8128 -1.85875
Dl 0.458322 -1.85875
DP 0 0 0 0 4 0 24
Dl 1.73057 -2.8702
Dl 2.0828 -2.8702
Dl 2.0828 -1.85782
Dl 1.73057 -1.85782
$PAD
Sh "1" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -1.905 2.6162
$EndPAD
$PAD
Sh "2" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -0.635 2.6162
$EndPAD
$PAD
Sh "3" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 0.635 2.6162
$EndPAD
$PAD
Sh "4" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 1.905 2.6162
$EndPAD
$PAD
Sh "5" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 1.905 -2.6162
$EndPAD
$PAD
Sh "6" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 0.635 -2.6162
$EndPAD
$PAD
Sh "7" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -0.635 -2.6162
$EndPAD
$PAD
Sh "8" R 0.6096 2.2098 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -1.905 -2.6162
$EndPAD
$EndMODULE SO08

View File

@ -0,0 +1,43 @@
EESchema-LIBRARY Version 2.2 Date: 04/05/2014-04:12:59
#
# PCA9685-TSSOP
#
DEF PCA9685-TSSOP U 0 40 Y Y 1 0 N
F0 "U" 0 -100 50 H V C C
F1 "PCA9685-TSSOP" 0 100 50 H V C C
F2 "MODULE" 0 0 50 H I C C
F3 "DOCUMENTATION" 0 0 50 H I C C
DRAW
S -450 -850 450 850 1 0 0 N
X A0 1 -750 650 300 R 50 50 1 1 I
X A1 2 -750 550 300 R 50 50 1 1 I
X A2 3 -750 450 300 R 50 50 1 1 I
X A3 4 -750 350 300 R 50 50 1 1 I
X A4 5 -750 250 300 R 50 50 1 1 I
X LED0 6 -750 150 300 R 50 50 1 1 O
X LED1 7 -750 50 300 R 50 50 1 1 O
X LED2 8 -750 -50 300 R 50 50 1 1 O
X LED3 9 -750 -150 300 R 50 50 1 1 O
X LED4 10 -750 -250 300 R 50 50 1 1 O
X LED5 11 -750 -350 300 R 50 50 1 1 O
X LED6 12 -750 -450 300 R 50 50 1 1 O
X LED7 13 -750 -550 300 R 50 50 1 1 O
X GND 14 -750 -650 300 R 50 50 1 1 I
X LED8 15 750 -650 300 L 50 50 1 1 O
X LED9 16 750 -550 300 L 50 50 1 1 O
X LED10 17 750 -450 300 L 50 50 1 1 O
X LED11 18 750 -350 300 L 50 50 1 1 O
X LED12 19 750 -250 300 L 50 50 1 1 O
X LED13 20 750 -150 300 L 50 50 1 1 O
X LED14 21 750 -50 300 L 50 50 1 1 O
X LED15 22 750 50 300 L 50 50 1 1 O
X OE 23 750 150 300 L 50 50 1 1 I
X A5 24 750 250 300 L 50 50 1 1 I
X EXTCLK 25 750 350 300 L 50 50 1 1 I
X SCL 26 750 450 300 L 50 50 1 1 I
X SDA 27 750 550 300 L 50 50 1 1 B
X VCC 28 750 650 300 L 50 50 1 1 I
ENDDRAW
ENDDEF
#
#End Library

View File

@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

View File

@ -0,0 +1,44 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# PCA9685-TSSOP
#
DEF PCA9685-TSSOP U 0 40 Y Y 1 F N
F0 "U" 0 -100 50 H V C CNN
F1 "PCA9685-TSSOP" 0 100 50 H V C CNN
F2 "MODULE" 0 0 50 H I C CNN
F3 "DOCUMENTATION" 0 0 50 H I C CNN
DRAW
S -450 -850 450 850 1 0 0 f
X A0 1 -750 650 300 R 50 50 1 1 I
X LED4 10 -750 -250 300 R 50 50 1 1 O
X LED5 11 -750 -350 300 R 50 50 1 1 O
X LED6 12 -750 -450 300 R 50 50 1 1 O
X LED7 13 -750 -550 300 R 50 50 1 1 O
X GND 14 -750 -650 300 R 50 50 1 1 I
X LED8 15 750 -650 300 L 50 50 1 1 O
X LED9 16 750 -550 300 L 50 50 1 1 O
X LED10 17 750 -450 300 L 50 50 1 1 O
X LED11 18 750 -350 300 L 50 50 1 1 O
X LED12 19 750 -250 300 L 50 50 1 1 O
X A1 2 -750 550 300 R 50 50 1 1 I
X LED13 20 750 -150 300 L 50 50 1 1 O
X LED14 21 750 -50 300 L 50 50 1 1 O
X LED15 22 750 50 300 L 50 50 1 1 O
X OE 23 750 150 300 L 50 50 1 1 I
X A5 24 750 250 300 L 50 50 1 1 I
X EXTCLK 25 750 350 300 L 50 50 1 1 I
X SCL 26 750 450 300 L 50 50 1 1 I
X SDA 27 750 550 300 L 50 50 1 1 B
X VCC 28 750 650 300 L 50 50 1 1 I
X A2 3 -750 450 300 R 50 50 1 1 I
X A3 4 -750 350 300 R 50 50 1 1 I
X A4 5 -750 250 300 R 50 50 1 1 I
X LED0 6 -750 150 300 R 50 50 1 1 O
X LED1 7 -750 50 300 R 50 50 1 1 O
X LED2 8 -750 -50 300 R 50 50 1 1 O
X LED3 9 -750 -150 300 R 50 50 1 1 O
ENDDRAW
ENDDEF
#
#End Library

View File

@ -0,0 +1,47 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#(c) SnapEDA 2016 (snapeda.com)
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
#
# SMD-BUTTON(4P-5.2X5.2X1.5MM-SKQGAKE010)
#
DEF SMD-BUTTON(4P-5.2X5.2X1.5MM-SKQGAKE010) SW 0 40 Y Y 1 L N
F0 "SW" -201 201 50 H V L BNN
F1 "SMD-BUTTON(4P-5.2X5.2X1.5MM-SKQGAKE010)" -200 -250 50 H V L BNN
F2 "SW4-SMD-5.2X5.2X1.5MM" 0 0 50 H I L BNN
F3 "None" 0 0 50 H I L BNN
F4 "SKQGAKE010" 0 0 50 H I L BNN
F5 "None" 0 0 50 H I L BNN
F6 "Unavailable" 0 0 50 H I L BNN
F7 "ALPS" 0 0 50 H I L BNN
F8 "Switch Tactile N.O. SPST Button Gull Wing 0.05A 12VDC 3.43N SMD T/R" 0 0 50 H I L BNN
DRAW
P 2 0 0 10 -200 200 200 200 N
P 2 0 0 10 200 200 200 100 N
P 2 0 0 10 200 100 200 -100 N
P 2 0 0 10 200 -100 200 -200 N
P 2 0 0 10 200 -200 -200 -200 N
P 2 0 0 10 -200 -200 -200 -100 N
P 2 0 0 10 -200 -100 -200 100 N
P 2 0 0 10 -200 100 -200 200 N
P 2 0 0 6 -200 100 0 100 N
P 2 0 0 6 0 100 200 100 N
P 2 0 0 6 0 100 0 50 N
P 2 0 0 6 0 50 -50 -30 N
P 2 0 0 6 0 -50 0 -100 N
P 2 0 0 6 0 -100 200 -100 N
P 2 0 0 6 0 -100 -200 -100 N
P 2 0 0 6 -250 100 -200 100 N
P 2 0 0 6 -250 -100 -200 -100 N
P 2 0 0 6 250 -100 200 -100 N
P 2 0 0 6 250 100 200 100 N
C -50 -30 6 0 0 0 N
C 0 -50 6 0 0 0 N
X A0 1 -350 100 100 R 40 40 0 0 B
X A1 2 350 100 100 L 40 40 0 0 B
X B0 3 -350 -100 100 R 40 40 0 0 B
X B1 4 350 -100 100 L 40 40 0 0 B
ENDDRAW
ENDDEF
#
# End Library

View File

@ -0,0 +1,67 @@
PCBNEW-LibModule-V1
# encoding utf-8
Units mm
$INDEX
SW4-SMD-5.2X5.2X1.5MM
$EndINDEX
$MODULE SW4-SMD-5.2X5.2X1.5MM
Po 0 0 0 15 00000000 00000000 ~~
Li SW4-SMD-5.2X5.2X1.5MM
Cd
Sc 00000000
At SMD
Op 0 0 0
.SolderMask 0
.SolderPaste 0
T0 -0.523383 -3.25313 0.701862 0.701862 0 0.05 N V 21 "SW4-SMD-5.2X5.2X1.5MM"
T1 -0.112861 -0.218191 0.501589 0.501589 0 0.05 N V 21 "VAL**"
DS 2.6 1.46863 1.46863 2.6 0.127 24
DS 1.5 2.6 -1.1 2.6 0.127 21
DS -1.1 2.6 -1.45982 2.6 0.127 21
DS -1.45982 2.6 -2.6 1.45982 0.127 24
DS -2.6 -1.39584 -1.39584 -2.6 0.127 24
DS -1.4 -2.6 1.5 -2.6 0.127 21
DS 1.43381 -2.6 2.6 -1.43381 0.127 24
DP 0 0 0 0 4 0 26
Dl -2.50464 -2.6
Dl 2.6 -2.6
Dl 2.6 2.60484
Dl -2.50464 2.60484
DS -1.4 -2.6 -2.4 -1.6 0.127 21
DS 1.5 -2.6 2.4 -1.7 0.127 21
DS 1.5 2.6 2.4 1.7 0.127 21
DS -1.45982 2.6 -1.5 2.6 0.127 21
DS -1.5 2.6 -2.4 1.7 0.127 21
$PAD
Sh "1" R 1 0.7 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -3 -1.85
$EndPAD
$PAD
Sh "2" R 1 0.7 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 3 -1.85
$EndPAD
$PAD
Sh "3" R 1 0.7 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po -3 1.85
$EndPAD
$PAD
Sh "4" R 1 0.7 0 0 0
At SMD N 00888000
.SolderMask 0
.SolderPaste 0
Ne 0 ""
Po 3 1.85
$EndPAD
$EndMODULE SW4-SMD-5.2X5.2X1.5MM

6
kicad/sym-lib-table Normal file
View File

@ -0,0 +1,6 @@
(sym_lib_table
(lib (name PCA9685-TSSOP)(type Legacy)(uri ${KIPRJMOD}/libs/PCA9685-TSSOP.lib)(options "")(descr ""))
(lib (name MAX485)(type Legacy)(uri ${KIPRJMOD}/libs/MAX485.lib)(options "")(descr ""))
(lib (name AMS1117-5.0)(type Legacy)(uri ${KIPRJMOD}/libs/AMS1117-5.0.lib)(options "")(descr ""))
(lib (name SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_)(type Legacy)(uri ${KIPRJMOD}/libs/SMD-BUTTON_4P-5.2X5.2X1.5MM-SKQGAKE010_.lib)(options "")(descr ""))
)

1
module/build.bat Normal file
View File

@ -0,0 +1 @@
@pio run

3
module/fuses.bat Normal file
View File

@ -0,0 +1,3 @@
REM Internal 8 Mhz oscillator, no clock division
REM http://www.engbedded.com/fusecalc/
@avrdude -c usbtiny -p t2313 -e -U lfuse:w:0xe4:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

19
module/platformio.ini Normal file
View File

@ -0,0 +1,19 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
[platformio]
env_default = board
[env:board]
platform = atmelavr
board = attiny4313
board_build.f_cpu = 8000000L
upload_speed = 115200
upload_protocol = usbtiny

126
module/src/display.c Normal file
View File

@ -0,0 +1,126 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#include "display.h"
#include <stdint.h>
#include <stdbool.h>
#include <avr/pgmspace.h>
#include "lib/VeryTinySSD1306.h"
#include "lib/VeryTinyBigChars.h"
#include "lib/TinyMillis.h"
#include "global.h"
#define CharSpacing 4
#define CharOuterWidth (SSD1306_CharWidth_32px + CharSpacing)
#define SingleCharCenteredX ((SSD1306_DisplayWidth - SSD1306_CharWidth_32px) / 2)
#define WaitAnimationInterval 250
#define WaitAnimationMaxStep 3
const uint16_t WaitAnimation [] PROGMEM = {
0b0000000000000100, // Left
0b0000000010000000, // Middle
0b0001000000000000, // Right
0b0000000010000000 // Middle
};
/*
#define WaitAnimationMaxStep 7
const uint16_t WaitAnimation [] PROGMEM = {
0b0000000001000000, // Top
0b0000100000000000, // Top-right
0b0001000000000000, // Right
0b0010000000000000, // Bottom-right
0b0000000100000000, // Bottom
0b0000000000001000, // Bottom-left
0b0000000000000100, // Left
0b0000000000000010 // Top-left
};
*/
bool isWait = false;
uint16_t lastWait = 0;
uint8_t waitAnimationStep = 0;
inline void display_drawNumber(uint8_t* x, uint8_t value)
{
if (value > 9)
{
ssd1306_drawdigit_32px(*x, value / 10);
*x += CharOuterWidth;
ssd1306_drawdigit_32px(*x, value % 10);
}
else
ssd1306_drawdigit_32px(*x, value);
*x += CharOuterWidth;
}
void display_init(void)
{
ssd1306_begin_default();
ssd1306_clear();
ssd1306_on();
ssd1306_switchRenderFrame();
}
void display_drawIndex(void)
{
ssd1306_clear();
uint8_t moduleIndex = global_getModuleIndex();
if (moduleIndex == ModuleIndexUndefined)
{
ssd1306_drawminus_32px(SingleCharCenteredX);
}
else
{
uint8_t firstStep = (moduleIndex * 2) + 1;
uint8_t totalWidth = 3 * CharOuterWidth;
if (firstStep == 9)
totalWidth += CharOuterWidth;
else if (firstStep > 9)
totalWidth += 2 * CharOuterWidth;
uint8_t currentX = (SSD1306_DisplayWidth - totalWidth) / 2;
display_drawNumber(&currentX, firstStep);
ssd1306_drawminus_32px(currentX);
currentX += CharOuterWidth;
display_drawNumber(&currentX, firstStep + 1);
}
ssd1306_switchFrame();
}
void display_drawWait(void)
{
uint16_t currentTime = millis();
if (isWait && currentTime - lastWait < WaitAnimationInterval)
return;
ssd1306_clear();
ssd1306_drawchar_32px(SingleCharCenteredX, pgm_read_word(&WaitAnimation[waitAnimationStep]));
ssd1306_switchFrame();
waitAnimationStep++;
if (waitAnimationStep > WaitAnimationMaxStep)
waitAnimationStep = 0;
isWait = true;
lastWait = currentTime;
}

14
module/src/display.h Normal file
View File

@ -0,0 +1,14 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#ifndef __display
#define __display
void display_init(void);
void display_drawIndex(void);
void display_drawWait(void);
#endif

59
module/src/global.c Normal file
View File

@ -0,0 +1,59 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#include "global.h"
#include <avr/eeprom.h>
// EEPROM
// First byte is 0xAA to recognize uninitialised EEPROM
#define EEPROMHeader 0xAA
// Second byte is a version indicator
#define EEPROMCurrentVersion 1
// Version 1 fields
// index: 2
uint8_t moduleIndex = ModuleIndexUndefined;
void global_init(void)
{
uint8_t address = 0;
if (eeprom_read_byte(&address) != EEPROMHeader)
{
eeprom_write_byte(&address, EEPROMHeader); address++;
eeprom_write_byte(&address, EEPROMCurrentVersion); address++;
eeprom_write_byte(&address, moduleIndex); address++;
}
else
{
address++;
uint8_t version = eeprom_read_byte(&address); address++;
if (version >= 1)
{
moduleIndex = eeprom_read_byte(&address); address++;
}
}
}
uint8_t global_getModuleIndex(void)
{
return moduleIndex;
}
void global_setModuleIndex(uint8_t index)
{
if (index == moduleIndex)
return;
moduleIndex = index;
uint8_t address = 2;
eeprom_write_byte(&address, moduleIndex);
}

19
module/src/global.h Normal file
View File

@ -0,0 +1,19 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#ifndef __global
#define __global
#include <stdint.h>
#define ModuleIndexUndefined 0xff
void global_init(void);
uint8_t global_getModuleIndex(void);
void global_setModuleIndex(uint8_t index);
#endif

View File

@ -0,0 +1,46 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#include "TinyMillis.h"
#include <avr/io.h>
#include <util/atomic.h>
#include <avr/interrupt.h>
volatile uint16_t tickCount;
ISR(TIMER1_COMPA_vect)
{
tickCount++;
}
void millis_init(void)
{
uint32_t overflow;
overflow = ((F_CPU / 1000) / 8);
TCCR1B |= (1 << WGM12) | (1 << CS11);
OCR1AH = (overflow >> 8);
OCR1AL = overflow;
TIMSK |= (1 << OCIE1A);
}
uint16_t millis(void)
{
uint16_t value;
ATOMIC_BLOCK(ATOMIC_FORCEON)
{
value = tickCount;
}
return value;
}

View File

@ -0,0 +1,21 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Counts the elapsed milliseconds similar to Arduino's millis(void).
* Accuracy is not assumed to be important, and assumes no long-running
* checks are done so it can get away with 16 bits (65 seconds max).
*/
#ifndef __TinyMillis
#define __TinyMillis
#include <stdint.h>
// call sei(void) afterwards
void millis_init(void);
uint16_t millis(void);
#endif

262
module/src/lib/TinyRS485.c Normal file
View File

@ -0,0 +1,262 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Straight up port of Nick Gammon's non-blocking
* RS485 library to C and removing the Arduino
* framework dependency.
*
* Source:
* https://www.gammon.com.au/forum/?id=11428
* Devised and written by Nick Gammon.
* Date: 4 December 2012
* Version: 1.0
*/
#include "TinyRS485.h"
#include "TinyMillis.h"
#include <stdlib.h>
ReadCallback doRead;
AvailableCallback doAvailable;
WriteCallback doWrite;
// where we save incoming stuff
uint8_t* data;
// how much data is in the buffer
uint8_t bufferSize;
// this is true once we have valid data in buf
bool available;
// an STX (start of text) signals a packet start
bool haveSTX;
// count of errors
uint16_t errorCount;
// variables below are set when we get an STX
bool haveETX;
uint8_t inputPos;
uint8_t currentByte;
bool firstNibble;
uint16_t startTime;
// helper private functions
uint8_t crc8 (uint8_t* addr, uint8_t len)
{
uint8_t crc = 0;
while (len--)
{
uint8_t inbyte = *addr++;
for (uint8_t i = 8; i; i--)
{
uint8_t mix = (crc ^ inbyte) & 0x01;
crc >>= 1;
if (mix)
crc ^= 0x8C;
inbyte >>= 1;
}
}
return crc;
}
// send a byte complemented, repeated
// only values sent would be (in hex):
// 0F, 1E, 2D, 3C, 4B, 5A, 69, 78, 87, 96, A5, B4, C3, D2, E1, F0
void sendComplemented(uint8_t what)
{
uint8_t c;
// first nibble
c = what >> 4;
doWrite((c << 4) | (c ^ 0x0F));
// second nibble
c = what & 0x0F;
doWrite((c << 4) | (c ^ 0x0F));
}
void rs485_begin(ReadCallback readCallback,
AvailableCallback availableCallback,
WriteCallback writeCallback,
uint8_t bufferSize)
{
doRead = readCallback;
doAvailable = availableCallback;
doWrite = writeCallback;
data = (uint8_t*)malloc(bufferSize);
rs485_reset();
errorCount = 0;
}
void rs485_stop(void)
{
rs485_reset();
free(data);
data = NULL;
}
void rs485_reset(void)
{
haveSTX = false;
available = false;
inputPos = 0;
startTime = 0;
}
// send a message of "length" bytes (max 255) to other end
// put STX at start, ETX at end, and add CRC
void rs485_sendMsg(uint8_t* data, uint8_t length)
{
doWrite(STX); // STX
for (uint8_t i = 0; i < length; i++)
sendComplemented(data[i]);
doWrite(ETX); // ETX
sendComplemented(crc8(data, length));
}
bool rs485_available(void)
{
return available;
}
uint8_t* rs485_getData(void)
{
return data;
}
uint8_t rs485_getLength(void)
{
return inputPos;
}
uint16_t rs485_getErrorCount(void)
{
return errorCount;
}
uint16_t rs485_getPacketStartTime(void)
{
return startTime;
}
bool rs485_isPacketStarted(void)
{
return haveSTX;
}
// called periodically from main loop to process data and
// assemble the finished packet in 'data_'
// returns true if packet received.
// You could implement a timeout by seeing if isPacketStarted() returns
// true, and if too much time has passed since getPacketStartTime() time.
bool rs485_update(void)
{
// no data? can't go ahead (eg. begin() not called)
if (data == NULL)
return false;
// no callbacks? Can't read
if (doAvailable == NULL || doRead == NULL)
return false;
while (doAvailable() > 0)
{
uint8_t inByte = doRead();
switch (inByte)
{
case STX: // start of text
haveSTX = true;
haveETX = false;
inputPos = 0;
firstNibble = true;
startTime = millis();
break;
case ETX: // end of text (now expect the CRC check)
haveETX = true;
break;
default:
// wait until packet officially starts
if (!haveSTX)
break;
// check byte is in valid form (4 bits followed by 4 bits complemented)
if ((inByte >> 4) != ((inByte & 0x0F) ^ 0x0F))
{
rs485_reset();
errorCount++;
break; // bad character
}
// convert back
inByte >>= 4;
// high-order nibble?
if (firstNibble)
{
currentByte = inByte;
firstNibble = false;
break;
}
// low-order nibble
currentByte <<= 4;
currentByte |= inByte;
firstNibble = true;
// if we have the ETX this must be the CRC
if (haveETX)
{
if (crc8(data, inputPos) != currentByte)
{
rs485_reset();
errorCount++;
break; // bad crc
}
available = true;
return true; // show data ready
}
// keep adding if not full
if (inputPos < bufferSize)
data[inputPos++] = currentByte;
else
{
rs485_reset(); // overflow, start again
errorCount++;
}
break;
}
}
return false; // not ready yet
}

View File

@ -0,0 +1,69 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Straight up port of Nick Gammon's non-blocking
* RS485 library to C and removing the Arduino
* framework dependency.
*
* Source:
* https://www.gammon.com.au/forum/?id=11428
* Devised and written by Nick Gammon.
* Date: 4 December 2012
* Version: 1.0
*/
#ifndef __TinyRS485
#define __TinyRS485
#include <stdint.h>
#include <stdbool.h>
typedef void (*WriteCallback) (uint8_t what); // send a byte to serial port
typedef uint8_t (*AvailableCallback) (void); // return number of bytes available
typedef uint8_t (*ReadCallback) (void); // read a byte from serial port
enum {
STX = '\2', // start of text
ETX = '\3' // end of text
}; // end of enum
// allocate the requested buffer size
void rs485_begin(ReadCallback readCallback,
AvailableCallback availableCallback,
WriteCallback writeCallback,
uint8_t bufferSize);
// get rid of the buffer
void rs485_stop(void);
// handle incoming data, return true if packet ready
bool rs485_update(void);
// reset to no incoming data (eg. after a timeout)
void rs485_reset(void);
// send data
void rs485_sendMsg(uint8_t* data, uint8_t length);
// returns true if packet available
bool rs485_available(void);
// once available, returns the address of the current message
uint8_t* rs485_getData(void);
uint8_t rs485_getLength(void);
// return how many errors we have had
uint16_t rs485_getErrorCount(void);
// return when last packet started
uint16_t rs485_getPacketStartTime(void);
// return true if a packet has started to be received
bool rs485_isPacketStarted(void);
#endif

161
module/src/lib/TinyUART.c Normal file
View File

@ -0,0 +1,161 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Source:
* https://github.com/akafugu/helloworld/blob/master/attiny2313/uart.c
*/
#include "TinyUART.h"
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
volatile static uint8_t rx_buffer[BUFFER_SIZE] = "xxxxxxxxxxxxxxxx";
volatile static uint8_t tx_buffer[BUFFER_SIZE] = "xxxxxxxxxxxxxxxx";
volatile static uint8_t rx_head = 0;
volatile static uint8_t rx_tail = 0;
volatile static uint8_t tx_head = 0;
volatile static uint8_t tx_tail = 0;
void uart_init(void)
{
// set baud rate
UBRRH = (uint8_t)(MYUBBR >> 8);
UBRRL = (uint8_t)(MYUBBR);
// enable receive and transmit
UCSRB = (1 << RXEN) | (1 << TXEN) | (1 << RXCIE);
// set frame format
UCSRC = (1 << USBS) | (3 << UCSZ0); // asynchron 8n1
}
void uart_send(uint8_t c)
{
// wait for empty data register
while (!(UCSRA & (1<<UDRE)));
// set data into data register
UDR = c;
}
uint8_t uart_available(void)
{
return rx_head - rx_tail;
}
uint8_t uart_receive(void)
{
while (!(UCSRA & (1<<RXC)))
;
return UDR;
}
uint16_t uart_getc(void)
{
uint8_t c = 0;
uint8_t tmp_tail = 0;
if (rx_head == rx_tail)
return UART_NO_DATA;
tmp_tail = (rx_tail + 1) % BUFFER_SIZE;
c = rx_buffer[rx_tail];
rx_tail = tmp_tail;
return c;
}
uint8_t uart_getc_wait(void)
{
uint16_t c;
while ((c = uart_getc()) == UART_NO_DATA) {}
return c;
}
void uart_putc(uint8_t c)
{
uint8_t tmp_head = (tx_head + 1) % BUFFER_SIZE;
// wait for space in buffer
while (tmp_head == tx_tail)
;
tx_buffer[tx_head] = c;
tx_head = tmp_head;
// enable uart data interrupt (send data)
UCSRB |= (1<<UDRIE);
}
void uart_puts(const char *s)
{
while (*s)
{
uart_putc(*s);
s++;
}
}
void uart_puts_P(const char *s)
{
while (pgm_read_byte(s) != 0x00)
{
uart_putc(pgm_read_byte(s++));
}
}
/*
* ISR User Data Regiser Empty
* Send a char out of buffer via UART. If sending is complete, the
* interrupt gets disabled.
*/
ISR(USART_UDRE_vect)
{
uint8_t tmp_tail = 0;
if (tx_head != tx_tail)
{
tmp_tail = (tx_tail + 1) % BUFFER_SIZE;
UDR = tx_buffer[tx_tail];
tx_tail = tmp_tail;
}
else
{
// disable this interrupt if nothing more to send
UCSRB &= ~(1 << UDRIE);
}
}
/*
* ISR RX complete
* Receives a char from UART and stores it in ring buffer.
*/
ISR(USART_RX_vect)
{
uint8_t tmp_head = 0;
tmp_head = (rx_head + 1) % BUFFER_SIZE;
if (tmp_head == rx_tail)
{
// buffer overflow error!
}
else
{
rx_buffer[rx_head] = UDR;
rx_head = tmp_head;
}
}

86
module/src/lib/TinyUART.h Normal file
View File

@ -0,0 +1,86 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Source:
* https://github.com/akafugu/helloworld/blob/master/attiny2313/uart.c
*/
#ifndef __TinyUART
#define __TinyUART
#include <stdint.h>
#define UART_NO_DATA 0x0100
#define BAUD 38400
// 4.096MHz
// 4800: 52.3333333
// 9600: 25.6666667
// 14400: 16.7777778
// 19600: 12.06
// 28800: 7.8889
// 38400: 5.6667
#define MYUBBR ((F_CPU / (BAUD * 16L)) - 1)
#define BUFFER_SIZE 16
void uart_init(void);
/*
* uart_send
* Sends a single char to UART without ISR
*/
void uart_send(uint8_t c);
uint8_t uart_available(void);
/*
* uart_receive
* Receives a single char without ISR
*/
uint8_t uart_receive(void);
/*
* uart_getc
* Gets a single char from the receive buffer.
* return uint16_r the received char or UART_NO_DATA
*/
uint16_t uart_getc(void);
/*
* uart_getc_wait
* Blocking call to getc. Will not return until a char is received.
*/
uint8_t uart_getc_wait(void);
/*
* uart_putc
* Puts a single char. Will block until there is enough space in the
* send buffer.
*/
void uart_putc(uint8_t c);
/*
* uart_puts
* Sends a string.
*/
void uart_puts(const char *s);
/*
* uart_puts_P
* Sends a PROGMEM string.
*/
void uart_puts_P(const char *s);
#endif

View File

@ -0,0 +1,134 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#include "VeryTinyBigChars.h"
#include "VeryTinySSD1306.h"
#include <avr/pgmspace.h>
/*
* Each digit is composed of a 3x5 grid where each bit represents
* whether or not to draw that area. It is then stretched.
*
* Example:
*
* XXX
* X
* XXX
* X
* XXX
*
* The least significant bit is the top left corner, going down
* after that before wrapping to the middle column.
*/
const uint16_t ssd1306_digits_32px [] PROGMEM = {
0b0111111000111111, // 0
0b0100001111110010, // 1
0b0101111010111101, // 2
0b0111111010110101, // 3
0b0111110010000111, // 4
0b0111011010110111, // 5
0b0111011010111111, // 6
0b0111110000100001, // 7
0b0111111010111111, // 8
0b0111111010110111 // 9
};
void ssd1306_drawchar_32px(uint8_t x, uint16_t matrix)
{
uint8_t column[4];
// Vertical mode
ssd1306_setMemoryAddressingMode(0b01);
if (ssd1306_currentRenderFrame() == 1)
{
ssd1306_setPageStartAddress(4);
ssd1306_setPageAddress(4, 7);
}
else
{
ssd1306_setPageStartAddress(0);
ssd1306_setPageAddress(0, 3);
}
ssd1306_setCursor(x, 0);
ssd1306_startData();
// Three columns, each shifted 5 bits
for (uint8_t shift = 0; shift < 3; shift++)
{
uint16_t columnValue = matrix >> (shift * 5);
// It's a bit rough, but it works! First, third and fifth "row" are 6 bits, in between are 7 bits = 32 total
column[0] = 0;
column[1] = 0;
column[2] = 0;
column[3] = 0;
// 0 = 0b0111111000111111
if (columnValue & 0b1)
column[0] |= 0b00111111;
if (columnValue & 0b10) {
column[0] |= 0b11000000;
column[1] |= 0b00011111;
}
if (columnValue & 0b100) {
column[1] |= 0b11100000;
column[2] |= 0b00000111;
}
if (columnValue & 0b1000) {
column[2] |= 0b11111000;
column[3] |= 0b00000011;
}
if (columnValue & 0b10000)
column[3] |= 0b11111100;
// Each column is 6 pixels wide
for (uint8_t repeat = 0; repeat < SSD1306_CharColumnWidth_32px; repeat++)
{
ssd1306_sendData(column[0]);
ssd1306_sendData(column[1]);
ssd1306_sendData(column[2]);
ssd1306_sendData(column[3]);
}
}
ssd1306_endData();
// Default: horizontal mode
ssd1306_setMemoryAddressingMode(0b00);
ssd1306_setPageStartAddress(0);
ssd1306_setPageAddress(0, 7);
}
void ssd1306_drawdigit_32px(uint8_t x, uint8_t value)
{
if (value < 0 || value > 9)
return;
ssd1306_drawchar_32px(x, pgm_read_word(&ssd1306_digits_32px[value]));
}
void ssd1306_drawplus_32px(uint8_t x)
{
ssd1306_drawchar_32px(x, 0b0001000111000100);
}
void ssd1306_drawminus_32px(uint8_t x)
{
ssd1306_drawchar_32px(x, 0b0001000010000100);
}

View File

@ -0,0 +1,24 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#ifndef __VeryTinyBigChars
#define __VeryTinyBigChars
#include <stdint.h>
#define SSD1306_CharColumnWidth_32px 6
#define SSD1306_CharWidth_32px (3 * SSD1306_CharColumnWidth_32px)
void ssd1306_drawchar_32px(uint8_t x, uint16_t matrix);
// Draws a digit from 0 to 9, 32 pixels tall
void ssd1306_drawdigit_32px(uint8_t x, uint8_t value);
void ssd1306_drawplus_32px(uint8_t x);
void ssd1306_drawminus_32px(uint8_t x);
#endif

View File

@ -0,0 +1,153 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Minimalistic I2C library for the ATTiny2313's limited space.
* Based on David Johnson-Davies' TinyI2C:
* https://github.com/technoblogy/tiny-i2c
*/
#include "VeryTinyI2C.h"
// Constants
// Prepare register value to: Clear flags, and set USI to shift 8 bits i.e. count 16 clock edges.
const unsigned char USISR_8bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0x0<<USICNT0;
// Prepare register value to: Clear flags, and set USI to shift 1 bit i.e. count 2 clock edges.
const unsigned char USISR_1bit = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | 0xE<<USICNT0;
int32_t I2Ccount;
uint8_t i2c_transfer(uint8_t data)
{
USISR = data; // Set USISR according to data.
// Prepare clocking.
data = 0<<USISIE | 0<<USIOIE | // Interrupts disabled
1<<USIWM1 | 0<<USIWM0 | // Set USI in Two-wire mode.
1<<USICS1 | 0<<USICS0 | 1<<USICLK | // Software clock strobe as source.
1<<USITC; // Toggle Clock Port.
do {
DELAY_T2TWI;
USICR = data; // Generate positive SCL edge.
while (!(PIN_USI_CL & 1<<PIN_USI_SCL)); // Wait for SCL to go high.
DELAY_T4TWI;
USICR = data; // Generate negative SCL edge.
} while (!(USISR & 1<<USIOIF)); // Check for transfer complete.
DELAY_T2TWI;
data = USIDR; // Read out data.
USIDR = 0xFF; // Release SDA.
DDR_USI |= (1<<PIN_USI_SDA); // Enable SDA as output.
return data; // Return the data from the USIDR
}
void i2c_init(void)
{
PORT_USI |= 1<<PIN_USI_SDA; // Enable pullup on SDA.
PORT_USI_CL |= 1<<PIN_USI_SCL; // Enable pullup on SCL.
DDR_USI_CL |= 1<<PIN_USI_SCL; // Enable SCL as output.
DDR_USI |= 1<<PIN_USI_SDA; // Enable SDA as output.
USIDR = 0xFF; // Preload data register with "released level" data.
USICR = 0<<USISIE | 0<<USIOIE | // Disable Interrupts.
1<<USIWM1 | 0<<USIWM0 | // Set USI in Two-wire mode.
1<<USICS1 | 0<<USICS0 | 1<<USICLK | // Software stobe as counter clock source
0<<USITC;
USISR = 1<<USISIF | 1<<USIOIF | 1<<USIPF | 1<<USIDC | // Clear flags,
0x0<<USICNT0; // and reset counter.
}
uint8_t i2c_read(void)
{
if ((I2Ccount != 0) && (I2Ccount != -1)) I2Ccount--;
/* Read a byte */
DDR_USI &= ~1<<PIN_USI_SDA; // Enable SDA as input.
uint8_t data = i2c_transfer(USISR_8bit);
/* Prepare to generate ACK (or NACK in case of End Of Transmission) */
if (I2Ccount == 0) USIDR = 0xFF; else USIDR = 0x00;
i2c_transfer(USISR_1bit); // Generate ACK/NACK.
return data; // Read successfully completed
}
uint8_t i2c_readLast(void)
{
I2Ccount = 0;
return i2c_read();
}
bool i2c_write(uint8_t data)
{
/* Write a byte */
PORT_USI_CL &= ~(1<<PIN_USI_SCL); // Pull SCL LOW.
USIDR = data; // Setup data.
i2c_transfer(USISR_8bit); // Send 8 bits on bus.
/* Clock and verify (N)ACK from slave */
DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.
if (i2c_transfer(USISR_1bit) & 1<<TWI_NACK_BIT) return false;
return true; // Write successfully completed
}
bool i2c_start(uint8_t address, int readcount)
{
if (readcount != 0) { I2Ccount = readcount; readcount = 1; }
uint8_t addressRW = address<<1 | readcount;
/* Release SCL to ensure that (repeated) Start can be performed */
PORT_USI_CL |= 1<<PIN_USI_SCL; // Release SCL.
while (!(PIN_USI_CL & 1<<PIN_USI_SCL)); // Verify that SCL becomes high.
#ifdef TWI_FAST_MODE
DELAY_T4TWI;
#else
DELAY_T2TWI;
#endif
/* Generate Start Condition */
PORT_USI &= ~(1<<PIN_USI_SDA); // Force SDA LOW.
DELAY_T4TWI;
PORT_USI_CL &= ~(1<<PIN_USI_SCL); // Pull SCL LOW.
PORT_USI |= 1<<PIN_USI_SDA; // Release SDA.
if (!(USISR & 1<<USISIF)) return false;
/*Write address */
PORT_USI_CL &= ~(1<<PIN_USI_SCL); // Pull SCL LOW.
USIDR = addressRW; // Setup data.
i2c_transfer(USISR_8bit); // Send 8 bits on bus.
/* Clock and verify (N)ACK from slave */
DDR_USI &= ~(1<<PIN_USI_SDA); // Enable SDA as input.
if (i2c_transfer(USISR_1bit) & 1<<TWI_NACK_BIT) return false; // No ACK
return true; // Start successfully completed
}
bool i2c_restart(uint8_t address, int readcount)
{
return i2c_start(address, readcount);
}
void i2c_stop(void)
{
PORT_USI &= ~(1<<PIN_USI_SDA); // Pull SDA low.
PORT_USI_CL |= 1<<PIN_USI_SCL; // Release SCL.
while (!(PIN_USI_CL & 1<<PIN_USI_SCL)); // Wait for SCL to go high.
DELAY_T4TWI;
PORT_USI |= 1<<PIN_USI_SDA; // Release SDA.
DELAY_T2TWI;
}

View File

@ -0,0 +1,54 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Straight up port of David Johnson-Davies' TinyI2C to C
* and without the Arduino framework dependency.
* https://github.com/technoblogy/tiny-i2c
*/
#ifndef __VeryTinyI2C
#define __VeryTinyI2C
#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>
// Defines
//#define TWI_FAST_MODE
#ifdef TWI_FAST_MODE // TWI FAST mode timing limits. SCL = 100-400kHz
#define DELAY_T2TWI (_delay_us(2)) // >1.3us
#define DELAY_T4TWI (_delay_us(1)) // >0.6us
#else // TWI STANDARD mode timing limits. SCL <= 100kHz
#define DELAY_T2TWI (_delay_us(5)) // >4.7us
#define DELAY_T4TWI (_delay_us(4)) // >4.0us
#endif
#define TWI_NACK_BIT 0 // Bit position for (N)ACK bit.
// These are valid for the ATTiny2313
#define DDR_USI DDRB
#define DDR_USI_CL DDR_USI
#define PORT_USI PORTB
#define PORT_USI_CL PORT_USI
#define PIN_USI PINB
#define PIN_USI_CL PIN_USI
#define PORT_USI_SDA PB5
#define PORT_USI_SCL PB7
#define PIN_USI_SDA PINB5
#define PIN_USI_SCL PINB7
void i2c_init(void);
uint8_t i2c_read(void);
uint8_t i2c_readLast(void);
bool i2c_write(uint8_t data);
bool i2c_start(uint8_t address, int readcount);
bool i2c_restart(uint8_t address, int readcount);
void i2c_stop(void);
#endif

View File

@ -0,0 +1,517 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Port of Stephen Denne's Tiny4kOLED to C
* and without the Arduino framework dependency.
* https://github.com/technoblogy/tiny-i2c
*/
#include "VeryTinySSD1306.h"
#include <avr/pgmspace.h>
#include "VeryTinyI2C.h"
#define SSD1306_PAGES 4
#define SSD1306_COMMAND 0x00
#define SSD1306_DATA 0x40
// ----------------------------------------------------------------------------
// Some code based on "IIC_without_ACK" by http://www.14blog.com/archives/1358
const uint8_t ssd1306_init_sequence [] PROGMEM = { // Initialization Sequence
// 0xAE, // Display OFF (sleep mode)
// 0x20, 0b10, // Set Memory Addressing Mode
// 00=Horizontal Addressing Mode; 01=Vertical Addressing Mode;
// 10=Page Addressing Mode (RESET); 11=Invalid
// 0xB0, // Set Page Start Address for Page Addressing Mode, 0-7
0xC8, // Set COM Output Scan Direction
// 0x00, // ---set low column address
// 0x10, // ---set high column address
// 0x40, // --set start line address
// 0x81, 0x7F, // Set contrast control register
0xA1, // Set Segment Re-map. A0=address mapped; A1=address 127 mapped.
// 0xA6, // Set display mode. A6=Normal; A7=Inverse
0xA8, 0x1F, // Set multiplex ratio(1 to 64)
// 0xA4, // Output RAM to Display
// 0xA4=Output follows RAM content; 0xA5,Output ignores RAM content
// 0xD3, 0x00, // Set display offset. 00 = no offset
// 0xD5, 0x80, // --set display clock divide ratio/oscillator frequency
// 0xD9, 0x22, // Set pre-charge period
0xDA, 0x02, // Set com pins hardware configuration
// 0xDB, 0x20, // --set vcomh 0x20 = 0.77xVcc
0x8D, 0x14 // Set DC-DC enable
};
const DCfont *oledFont = 0;
uint8_t oledX = 0, oledY = 0;
uint8_t renderingFrame = 0xB0, drawingFrame = 0x40;
void ssd1306_send_command_start(void)
{
i2c_start(SSD1306, 0);
i2c_write(SSD1306_COMMAND);
}
void ssd1306_send_data_start(void)
{
i2c_start(SSD1306, 0);
i2c_write(SSD1306_DATA);
}
void ssd1306_send_command_byte(uint8_t byte)
{
if (i2c_write(byte) == 0)
{
i2c_stop();
ssd1306_send_command_start();
i2c_write(byte);
}
}
void ssd1306_send_data_byte(uint8_t byte)
{
if (i2c_write(byte) == 0)
{
i2c_stop();
ssd1306_send_data_start();
i2c_write(byte);
}
}
void ssd1306_send_command(uint8_t command)
{
ssd1306_send_command_start();
i2c_write(command);
i2c_stop();
}
void ssd1306_send_command2(uint8_t command1, uint8_t command2)
{
ssd1306_send_command_start();
i2c_write(command1);
i2c_write(command2);
i2c_stop();
}
void ssd1306_send_command3(uint8_t command1, uint8_t command2, uint8_t command3)
{
ssd1306_send_command_start();
i2c_write(command1);
i2c_write(command2);
i2c_write(command3);
i2c_stop();
}
void ssd1306_send_command6(uint8_t command1, uint8_t command2, uint8_t command3, uint8_t command4, uint8_t command5, uint8_t command6)
{
ssd1306_send_command_start();
i2c_write(command1);
i2c_write(command2);
i2c_write(command3);
i2c_write(command4);
i2c_write(command5);
i2c_write(command6);
i2c_stop();
}
void ssd1306_send_command7(uint8_t command1, uint8_t command2, uint8_t command3, uint8_t command4, uint8_t command5, uint8_t command6, uint8_t command7)
{
ssd1306_send_command_start();
i2c_write(command1);
i2c_write(command2);
i2c_write(command3);
i2c_write(command4);
i2c_write(command5);
i2c_write(command6);
i2c_write(command7);
i2c_stop();
}
void ssd1306_begin_default(void)
{
ssd1306_begin(sizeof(ssd1306_init_sequence), ssd1306_init_sequence);
}
void ssd1306_begin(uint8_t init_sequence_length, const uint8_t init_sequence [])
{
i2c_init();
ssd1306_send_command_start();
for (uint8_t i = 0; i < init_sequence_length; i++)
{
ssd1306_send_command_byte(pgm_read_byte(&init_sequence[i]));
}
i2c_stop();
}
void ssd1306_setFont(const DCfont *font)
{
oledFont = font;
}
void ssd1306_setCursor(uint8_t x, uint8_t y)
{
ssd1306_send_command3(renderingFrame | (y & 0x07), 0x10 | ((x & 0xf0) >> 4), x & 0x0f);
oledX = x;
oledY = y;
}
void ssd1306_clear(void)
{
ssd1306_fill(0x00);
}
void ssd1306_fill(uint8_t fill)
{
for (uint8_t m = 0; m < SSD1306_PAGES; m++)
{
ssd1306_setCursor(0, m);
ssd1306_fillToEOL(fill);
}
ssd1306_setCursor(0, 0);
}
void ssd1306_newLine_height(uint8_t fontHeight)
{
oledY+=fontHeight;
if (oledY > SSD1306_PAGES - fontHeight)
{
oledY = SSD1306_PAGES - fontHeight;
}
ssd1306_setCursor(0, oledY);
}
void ssd1306_newLine(void)
{
ssd1306_newLine_height(oledFont->height);
}
uint8_t ssd1306_write(uint8_t c)
{
if (!oledFont)
return 1;
if (c == '\r')
return 1;
uint8_t h = oledFont->height;
if (c == '\n')
{
ssd1306_newLine_height(h);
return 1;
}
uint8_t w = oledFont->width;
if (oledX > ((uint8_t)128 - w))
{
ssd1306_newLine_height(h);
}
uint16_t offset = ((uint16_t)c - oledFont->first) * w * h;
uint8_t line = h;
do
{
ssd1306_send_data_start();
for (uint8_t i = 0; i < w; i++)
{
ssd1306_send_data_byte(pgm_read_byte(&(oledFont->bitmap[offset++])));
}
i2c_stop();
if (h == 1)
{
oledX+=w;
}
else
{
if (line > 1)
{
ssd1306_setCursor(oledX, oledY + 1);
}
else
{
ssd1306_setCursor(oledX + w, oledY - (h - 1));
}
}
}
while (--line);
return 1;
}
void ssd1306_bitmap(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, const uint8_t bitmap[])
{
uint16_t j = 0;
for (uint8_t y = y0; y < y1; y++)
{
ssd1306_setCursor(x0,y);
ssd1306_send_data_start();
for (uint8_t x = x0; x < x1; x++)
{
ssd1306_send_data_byte(pgm_read_byte(&bitmap[j++]));
}
i2c_stop();
}
ssd1306_setCursor(0, 0);
}
void ssd1306_clearToEOL(void)
{
ssd1306_fillToEOL(0x00);
}
void ssd1306_fillToEOL(uint8_t fill)
{
ssd1306_fillLength(fill, 128 - oledX);
}
void ssd1306_fillLength(uint8_t fill, uint8_t length)
{
oledX += length;
ssd1306_send_data_start();
do
{
ssd1306_send_data_byte(fill);
}
while (--length);
i2c_stop();
}
void ssd1306_startData(void)
{
ssd1306_send_data_start();
}
void ssd1306_sendData(const uint8_t data)
{
ssd1306_send_data_byte(data);
}
void ssd1306_endData(void)
{
i2c_stop();
}
// Double Buffering Commands
void ssd1306_switchRenderFrame(void)
{
renderingFrame ^= 0x04;
}
void ssd1306_switchDisplayFrame(void)
{
drawingFrame ^= 0x20;
ssd1306_send_command(drawingFrame);
}
void ssd1306_switchFrame(void)
{
ssd1306_switchDisplayFrame();
ssd1306_switchRenderFrame();
}
uint8_t ssd1306_currentRenderFrame(void)
{
return (renderingFrame >> 2) & 0x01;
}
uint8_t ssd1306_currentDisplayFrame(void)
{
return (drawingFrame >> 5) & 0x01;
}
// 1. Fundamental Command Table
void ssd1306_setContrast(uint8_t contrast)
{
ssd1306_send_command2(0x81,contrast);
}
void ssd1306_setEntireDisplayOn(bool enable)
{
if (enable)
ssd1306_send_command(0xA5);
else
ssd1306_send_command(0xA4);
}
void ssd1306_setInverse(bool enable)
{
if (enable)
ssd1306_send_command(0xA7);
else
ssd1306_send_command(0xA6);
}
void ssd1306_off(void)
{
ssd1306_send_command(0xAE);
}
void ssd1306_on(void)
{
ssd1306_send_command(0xAF);
}
// 2. Scrolling Command Table
void ssd1306_scrollRight(uint8_t startPage, uint8_t interval, uint8_t endPage)
{
ssd1306_send_command7(0x26, 0x00, startPage, interval, endPage, 0x00, 0xFF);
}
void ssd1306_scrollLeft(uint8_t startPage, uint8_t interval, uint8_t endPage)
{
ssd1306_send_command7(0x27, 0x00, startPage, interval, endPage, 0x00, 0xFF);
}
void ssd1306_scrollRightOffset(uint8_t startPage, uint8_t interval, uint8_t endPage, uint8_t offset)
{
ssd1306_send_command6(0x29, 0x00, startPage, interval, endPage, offset);
}
void ssd1306_scrollLeftOffset(uint8_t startPage, uint8_t interval, uint8_t endPage, uint8_t offset)
{
ssd1306_send_command6(0x2A, 0x00, startPage, interval, endPage, offset);
}
void ssd1306_deactivateScroll(void)
{
ssd1306_send_command(0x2E);
}
void ssd1306_activateScroll(void)
{
ssd1306_send_command(0x2F);
}
void ssd1306_setVerticalScrollArea(uint8_t top, uint8_t rows)
{
ssd1306_send_command3(0xA3, top, rows);
}
// 3. Addressing Setting Command Table
void ssd1306_setColumnStartAddress(uint8_t startAddress)
{
ssd1306_send_command2(startAddress & 0x0F, startAddress >> 4);
}
void ssd1306_setMemoryAddressingMode(uint8_t mode)
{
ssd1306_send_command2(0x20, mode & 0x03);
}
void ssd1306_setColumnAddress(uint8_t startAddress, uint8_t endAddress)
{
ssd1306_send_command3(0x21, startAddress & 0x7F, endAddress & 0x7F);
}
void ssd1306_setPageAddress(uint8_t startPage, uint8_t endPage)
{
ssd1306_send_command3(0x22, startPage & 0x07, endPage & 0x07);
}
void ssd1306_setPageStartAddress(uint8_t startPage)
{
ssd1306_send_command(0xB0 | (startPage & 0x07));
}
// 4. Hardware Configuration (Panel resolution and layout related) Command Table
void ssd1306_setDisplayStartLine(uint8_t startLine)
{
ssd1306_send_command(0x40 | (startLine & 0x3F));
}
void ssd1306_setSegmentRemap(uint8_t remap)
{
ssd1306_send_command(0xA0 | (remap & 0x01));
}
void ssd1306_setMultiplexRatio(uint8_t mux)
{
ssd1306_send_command2(0xA8, (mux - 1) & 0x3F);
}
void ssd1306_setComOutputDirection(uint8_t direction)
{
ssd1306_send_command(0xC0 | ((direction & 0x01)<<3));
}
void ssd1306_setDisplayOffset(uint8_t offset)
{
ssd1306_send_command2(0xD3, offset & 0x3F);
}
void ssd1306_setComPinsHardwareConfiguration(uint8_t alternative, uint8_t enableLeftRightRemap)
{
ssd1306_send_command2(0xDA, ((enableLeftRightRemap & 0x01) << 5) | ((alternative & 0x01) << 4) | 0x02 );
}
// 5. Timing and Driving Scheme Setting Command table
void ssd1306_setDisplayClock(uint8_t divideRatio, uint8_t oscillatorFrequency)
{
ssd1306_send_command2(0xD5, ((oscillatorFrequency & 0x0F) << 4) | ((divideRatio -1) & 0x0F));
}
void ssd1306_setPrechargePeriod(uint8_t phaseOnePeriod, uint8_t phaseTwoPeriod)
{
ssd1306_send_command2(0xD9, ((phaseTwoPeriod & 0x0F) << 4) | (phaseOnePeriod & 0x0F));
}
void ssd1306_setVcomhDeselectLevel(uint8_t level)
{
ssd1306_send_command2(0xDB, (level & 0x07) << 4);
}
void ssd1306_nop(void)
{
ssd1306_send_command(0xE3);
}
// 6. Advance Graphic Command table
void ssd1306_fadeOut(uint8_t interval)
{
ssd1306_send_command2(0x23, (0x20 | (interval & 0x0F)));
}
void ssd1306_blink(uint8_t interval)
{
ssd1306_send_command2(0x23, (0x30 | (interval & 0x0F)));
}
void ssd1306_disableFadeOutAndBlinking(void)
{
ssd1306_send_command2(0x23, 0x00);
}
void ssd1306_enableZoomIn(void)
{
ssd1306_send_command2(0xD6, 0x01);
}
void ssd1306_disableZoomIn(void)
{
ssd1306_send_command2(0xD6, 0x00);
}
// Charge Pump Settings
void ssd1306_enableChargePump(void)
{
ssd1306_send_command2(0x8D, 0x14);
}
void ssd1306_disableChargePump(void)
{
ssd1306_send_command2(0x8D, 0x10);
}

View File

@ -0,0 +1,113 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*
* Port of Stephen Denne's Tiny4kOLED to C,
* without the Arduino framework dependency but with
* a hardcoded dependency on VeryTinyI2C.
*
* Original:
* https://github.com/technoblogy/tiny-i2c
*/
#ifndef __VeryTinySSD1306
#define __VeryTinySSD1306
#include <stdint.h>
#include <stdbool.h>
typedef struct {
uint8_t *bitmap; // character bitmaps data
uint8_t width; // character width in pixels
uint8_t height; // character height in pages (8 pixels)
uint8_t first, last; // ASCII extents
} DCfont;
#define SSD1306_DisplayWidth 128
#define SSD1306_DisplayHeight 32
#ifndef SSD1306
#define SSD1306 0x3C // Slave address
#endif
void ssd1306_begin_default(void);
void ssd1306_begin(uint8_t init_sequence_length, const uint8_t init_sequence []);
void ssd1306_switchRenderFrame(void);
void ssd1306_switchDisplayFrame(void);
void ssd1306_switchFrame(void);
uint8_t ssd1306_currentRenderFrame(void);
uint8_t ssd1306_currentDisplayFrame(void);
void ssd1306_setFont(const DCfont *font);
void ssd1306_setCursor(uint8_t x, uint8_t y);
void ssd1306_newLine();
void ssd1306_fill(uint8_t fill);
void ssd1306_fillToEOL(uint8_t fill);
void ssd1306_fillLength(uint8_t fill, uint8_t length);
void ssd1306_clear(void);
void ssd1306_clearToEOL(void);
void ssd1306_bitmap(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, const uint8_t bitmap[]);
void ssd1306_startData(void);
void ssd1306_sendData(const uint8_t data);
void ssd1306_endData(void);
// 1. Fundamental Command Table
void ssd1306_setContrast(uint8_t contrast);
void ssd1306_setEntireDisplayOn(bool enable);
void ssd1306_setInverse(bool enable);
void ssd1306_off(void);
void ssd1306_on(void);
// 2. Scrolling Command Table
void ssd1306_scrollRight(uint8_t startPage, uint8_t interval, uint8_t endPage);
void ssd1306_scrollLeft(uint8_t startPage, uint8_t interval, uint8_t endPage);
void ssd1306_scrollRightOffset(uint8_t startPage, uint8_t interval, uint8_t endPage, uint8_t offset);
void ssd1306_scrollLeftOffset(uint8_t startPage, uint8_t interval, uint8_t endPage, uint8_t offset);
void ssd1306_deactivateScroll(void);
void ssd1306_activateScroll(void);
void ssd1306_setVerticalScrollArea(uint8_t top, uint8_t rows);
// 3. Addressing Setting Command Table
void ssd1306_setColumnStartAddress(uint8_t startAddress);
void ssd1306_setMemoryAddressingMode(uint8_t mode);
void ssd1306_setColumnAddress(uint8_t startAddress, uint8_t endAddress);
void ssd1306_setPageAddress(uint8_t startPage, uint8_t endPage);
void ssd1306_setPageStartAddress(uint8_t startPage);
// 4. Hardware Configuration (Panel resolution and layout related) Command Table
void ssd1306_setDisplayStartLine(uint8_t startLine);
void ssd1306_setSegmentRemap(uint8_t remap);
void ssd1306_setMultiplexRatio(uint8_t mux);
void ssd1306_setComOutputDirection(uint8_t direction);
void ssd1306_setDisplayOffset(uint8_t offset);
void ssd1306_setComPinsHardwareConfiguration(uint8_t alternative, uint8_t enableLeftRightRemap);
// 5. Timing and Driving Scheme Setting Command table
void ssd1306_setDisplayClock(uint8_t divideRatio, uint8_t oscillatorFrequency);
void ssd1306_setPrechargePeriod(uint8_t phaseOnePeriod, uint8_t phaseTwoPeriod);
void ssd1306_setVcomhDeselectLevel(uint8_t level);
void ssd1306_nop(void);
// 6. Advance Graphic Command table
void ssd1306_fadeOut(uint8_t interval);
void ssd1306_blink(uint8_t interval);
void ssd1306_disableFadeOutAndBlinking(void);
void ssd1306_enableZoomIn(void);
void ssd1306_disableZoomIn(void);
// Charge Pump Settings
void ssd1306_enableChargePump(void);
void ssd1306_disableChargePump(void);
uint8_t ssd1306_write(uint8_t c);
#endif

83
module/src/main.c Normal file
View File

@ -0,0 +1,83 @@
/*
* Stairs lighting
* Copyright 2017 (c) Mark van Renswoude
*
* https://git.x2software.net/pub/Stairs
*/
#include <stdint.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "lib/TinyMillis.h"
#include "lib/TinyUART.h"
#include "lib/TinyRS485.h"
#include "global.h"
#include "display.h"
#define STEPS_DELAY_SHORT 200
#define STEPS_DELAY 800
#define STEPS_DELAY_LONG 2000
uint8_t uartRead(void)
{
return uart_getc();
}
uint8_t uartAvailable(void)
{
return uart_available();
}
void uartWrite(uint8_t what)
{
uart_putc(what);
}
typedef enum
{
WaitingForComm,
Connected
} State;
State currentState = WaitingForComm;
int main(void)
{
// Allow peripherals to start up before sending messages
_delay_ms(40);
global_init();
millis_init();
sei();
uart_init();
rs485_begin(uartRead, uartAvailable, uartWrite, 20);
display_init();
for (;;)
{
if (rs485_update())
{
// TODO get data
currentState = Connected;
}
switch (currentState)
{
case WaitingForComm:
display_drawWait();
break;
case Connected:
display_drawIndex();
break;
}
}
return 0;
}

1
module/upload.bat Normal file
View File

@ -0,0 +1 @@
@pio run -t program

View File

@ -4,181 +4,181 @@
#include <pgmspace.h>
const uint8_t EmbeddedIndex[] PROGMEM = {
0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0xed,0x5b,0x6b,0x57,0xe3,0x38,0x12,0xfd,0x2b,0xee,
0xcc,0xee,0x40,0x6f,0x0f,0x8f,0x00,0xcd,0x34,0x0c,0xb0,0x13,0xf2,0x80,0x00,0x09,0x21,0x09,0xcf,0x2f,
0x7b,0x14,0x5b,0x89,0x05,0x8e,0x6d,0x24,0x3b,0x21,0x3d,0xd3,0xff,0x7d,0xf5,0xf0,0x43,0xb6,0x65,0xc7,
0x61,0x7b,0x4f,0xcf,0x9e,0xb3,0xfd,0xa1,0x83,0x55,0xa5,0xab,0xab,0x52,0xa9,0x54,0x92,0xe5,0xa3,0x0f,
0x8d,0xeb,0xfa,0xf0,0xb1,0xd7,0xd4,0x4c,0x6f,0x6a,0x9d,0x1c,0x05,0xff,0x43,0x60,0x9c,0x1c,0x4d,0xa1,
0x07,0x34,0xdd,0x04,0x98,0x40,0xef,0xb8,0x72,0x3b,0x6c,0x6d,0x7c,0xa9,0x9c,0x1c,0x79,0xc8,0xb3,0xe0,
0xc9,0xd1,0x56,0xf0,0xcb,0x95,0x6c,0x30,0x85,0xc7,0x15,0xcf,0x84,0x53,0xb8,0xa1,0x3b,0x96,0x83,0x2b,
0x9a,0xee,0xd8,0x1e,0xb4,0x69,0xbd,0x9f,0xb6,0xf9,0xbf,0x4a,0x42,0x75,0x86,0xe0,0xdc,0x75,0xb0,0x27,
0xe9,0xcd,0x91,0xe1,0x99,0xc7,0x06,0x9c,0x21,0x1d,0x6e,0xf0,0x87,0x5f,0x90,0x8d,0x3c,0x04,0xac,0x0d,
0xa2,0x03,0x0b,0x1e,0x57,0x29,0x84,0x85,0xec,0x17,0x0d,0x43,0xeb,0xb8,0x42,0xbc,0x85,0x05,0x89,0x09,
0x21,0xc5,0x30,0x31,0x1c,0x1f,0x57,0x46,0xbe,0x6d,0x58,0x70,0x53,0x27,0x84,0x2a,0x12,0x1d,0x23,0xd7,
0xd3,0x08,0xd6,0x23,0xc1,0x33,0x2b,0xdf,0x12,0x02,0xfa,0x87,0xe8,0xe3,0xc8,0x31,0x16,0x27,0x47,0x06,
0x9a,0x69,0xc8,0x38,0xae,0x00,0xd7,0xad,0x88,0xa7,0xd9,0x86,0x6e,0x39,0xe0,0x45,0x3c,0xe8,0x16,0x20,
0xe4,0xb8,0x62,0x3b,0x1e,0x1a,0x23,0x1d,0x78,0xc8,0xb1,0xeb,0x94,0x36,0x40,0x36,0xc4,0x95,0x5c,0x95,
0x8a,0x76,0x18,0x94,0xfe,0xa1,0x41,0x8c,0x1d,0x7c,0xa8,0xc9,0x62,0xed,0xc3,0xb1,0x66,0xfb,0x96,0xa5,
0xfd,0xfc,0x73,0xa2,0x7c,0x93,0xeb,0x6a,0xdf,0x2a,0x94,0x03,0x1a,0x27,0x21,0xc3,0x3a,0x15,0xed,0x77,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x66,0x01,0x4d,0xb6,
0x34,0x51,0x4d,0x37,0x64,0xc2,0xd7,0xaa,0x4d,0x1c,0xc9,0x02,0x27,0x70,0xa9,0x4a,0x08,0xc5,0x85,0x7d,
0x08,0x08,0xb3,0x6b,0xb6,0x9a,0x90,0x6c,0x4a,0x13,0x4d,0x2a,0x96,0xd0,0x04,0x11,0x12,0x8d,0xb9,0xfe,
0x32,0xc4,0x40,0x87,0x29,0xc8,0x58,0x10,0x33,0x89,0x6d,0xa0,0xa8,0x7d,0x04,0x42,0x9e,0x23,0xdf,0xf3,
0xa8,0x3d,0xc4,0xcf,0x86,0x8b,0xe9,0x2a,0x86,0x17,0x61,0x6e,0xb1,0x05,0x5c,0xb4,0xc5,0xeb,0x79,0xac,
0xde,0x16,0x1d,0xce,0xdc,0x96,0x1b,0xce,0xdc,0x66,0xc6,0x0e,0x18,0x80,0x13,0x2d,0xdd,0x48,0xb8,0x7c,
0x53,0x1f,0x82,0x16,0xf4,0xe0,0x60,0x79,0x77,0x1a,0x5c,0x31,0x82,0xcc,0x38,0x4e,0x98,0x7f,0x80,0x19,
0x9a,0x88,0x81,0xf5,0xc0,0x88,0x64,0xfb,0x27,0x27,0x25,0x6b,0x80,0x7a,0xfb,0x0c,0xd2,0x30,0x27,0xfe,
0x18,0x82,0x11,0x75,0x07,0x6d,0x4d,0x98,0x69,0x8d,0xa5,0x20,0x21,0x4f,0x49,0x21,0x92,0x47,0x5c,0x03,
0xb3,0xd2,0x06,0x87,0x52,0xcc,0x05,0xef,0x6a,0xdb,0xc3,0x68,0x32,0x81,0xb8,0xa0,0xf5,0x48,0x23,0x6a,
0x3f,0x2c,0xf9,0x3e,0x0c,0xe2,0x30,0x90,0xcf,0x41,0xd2,0x89,0x58,0xc4,0x65,0xdf,0x87,0x87,0x58,0x6f,
0x0a,0x46,0x41,0xc8,0xe3,0x51,0xe0,0xcf,0x8a,0xb6,0xd3,0x91,0x40,0x39,0xd8,0x6c,0xe9,0xdc,0x4d,0x0f,
0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c,0x74,0x44,0x7f,0x4d,0x8f,0x8e,0x16,0xf9,0x71,0x79,0x59,0x96,0x4b,0x41,
0x7e,0x26,0x67,0x69,0x6c,0x52,0xc7,0x67,0xea,0xec,0xd8,0x45,0x1d,0x16,0xbb,0x4e,0x83,0xca,0x72,0x8e,
0x9e,0xc4,0x5e,0x8b,0x35,0x19,0xec,0xed,0x0f,0xc3,0xb3,0x2a,0xca,0x98,0x6e,0x94,0x59,0x3a,0x94,0x5e,
0xbc,0x80,0x61,0x48,0x2b,0x97,0xba,0xd1,0x9a,0x11,0xee,0xed,0x05,0x6e,0xee,0xd2,0x14,0x13,0x90,0x8d,
0x29,0xb2,0xcb,0x8a,0x8a,0x4d,0x18,0xa0,0xc4,0x73,0x70,0x26,0xc9,0xb3,0xcf,0x53,0x0e,0x35,0xe0,0xe5,
0xb4,0xf1,0xc3,0xb4,0x64,0xed,0x63,0x6c,0x59,0x96,0xc4,0x16,0xa6,0xb2,0x1d,0x87,0x67,0x3e,0x85,0xc9,
0xec,0x54,0xe8,0xac,0x98,0xce,0x8a,0x5a,0x4b,0x12,0x0e,0xa1,0x54,0x32,0xa5,0x4d,0x21,0x26,0x72,0xca,
0x04,0x50,0xc3,0xc7,0xd4,0x36,0x85,0x83,0x57,0xac,0x9f,0xcc,0x35,0x93,0x8b,0x52,0x2e,0xa1,0x6c,0xab,
0x3c,0x23,0x5d,0xc6,0x6c,0x79,0xb2,0x51,0x8c,0xd0,0xa5,0xc3,0x89,0x57,0x4d,0x41,0x8a,0x21,0x6b,0xd6,
0x9c,0x2e,0x67,0xab,0xe6,0x26,0xc5,0x98,0xd7,0xb6,0xb5,0xc8,0xcb,0x59,0xb8,0xaf,0xae,0xe6,0x4f,0x02,
0xbf,0xc1,0x43,0x69,0x3c,0x79,0xca,0x8e,0x0c,0x4b,0x69,0x76,0xca,0xb8,0x64,0xd4,0x8c,0x22,0x20,0x67,
0xbc,0x6f,0xd9,0x9e,0x46,0xa5,0x55,0x6e,0x57,0xa3,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08,0x5f,0x23,0x67,
0xa9,0x05,0xfa,0xa5,0xf8,0x45,0xd8,0x11,0xc9,0xa8,0xe8,0x44,0x0b,0x37,0x7d,0x99,0x49,0x0f,0x01,0xd6,
0xcd,0xab,0xa8,0xae,0x1c,0x4c,0xb9,0x88,0xce,0xbf,0x48,0x9a,0x4f,0x70,0xc0,0x75,0x95,0x7b,0xc0,0xcc,
0x9c,0x77,0x91,0x4d,0x0a,0x26,0x7d,0xde,0xe0,0xd1,0x6a,0x57,0xcd,0x46,0xad,0x97,0x66,0x11,0x96,0x97,
0xf3,0xeb,0x08,0x25,0x7b,0x0f,0x28,0x66,0xb7,0x49,0xfb,0xcf,0x1a,0x2a,0xef,0x59,0x02,0x76,0x30,0xac,
0xa9,0xd9,0x51,0xc1,0x2a,0xf4,0x18,0xce,0x32,0x7e,0xbc,0xad,0x95,0x08,0xd6,0x7a,0x22,0x70,0x2b,0x28,
0x86,0xa2,0xd2,0x24,0x23,0xac,0x42,0x9a,0xc0,0x0d,0x5b,0x5c,0x89,0x68,0xef,0xbe,0xd3,0xc0,0x34,0x11,
0xc1,0x83,0x86,0xca,0x9e,0xb2,0xb8,0x34,0xe1,0x04,0x66,0x21,0x69,0x77,0x3e,0xe5,0xed,0xbe,0x93,0x72,
0xfd,0xaa,0x90,0x72,0xfd,0xea,0x1d,0x94,0x29,0xe6,0x52,0xca,0xac,0xdd,0x15,0x28,0xcf,0xa7,0x35,0xb1,
0x6f,0xca,0xb0,0x8d,0x24,0x25,0x89,0xc6,0x48,0xb9,0x1c,0xa5,0xc6,0x56,0xa2,0xd8,0xc2,0xf0,0xd5,0x87,
0xb6,0xbe,0x50,0x90,0x8c,0x64,0xa5,0x69,0xc6,0x68,0x05,0x44,0xa5,0x26,0xf3,0xe2,0xd7,0x14,0xb8,0x99,
0xf8,0x25,0xbf,0x28,0xa1,0xe2,0x5a,0xaf,0x7d,0x09,0x33,0xac,0x63,0x49,0x99,0x78,0x2e,0xe1,0xe4,0xf1,
0x95,0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0x5f,0x49,0xd2,0x15,0x96,0xc8,0xd9,0xad,0xee,0xb8,0x0b,0xfe,0x8e,0x46,0x60,0x8f,0xb0,0xf4,
0xed,0x5f,0xa0,0x9b,0xfe,0xf4,0x2f,0x3c,0xba,0xb8,0x13,0x62,0xfe,0x05,0x60,0xaa,0x46,0xf4,0xe5,0x5f,
0xe6,0x2d,0x4f,0xf0,0xb9,0xb1,0x45,0x87,0xc2,0x07,0x13,0xea,0x4b,0xcf,0x60,0x06,0x44,0x61,0xe5,0x84,
0x6f,0xca,0x6b,0x2e,0xb5,0x8f,0xf4,0xf9,0xb1,0xf8,0xf0,0x78,0x8b,0x7f,0x6f,0xfd,0x6f,0x98,0x74,0xa6,
0x4d,0x85,0x3d,0x00,0x00};
0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0xed,0x5b,0x69,0x57,0xe3,0x38,0x16,0xfd,0x2b,0x26,
0x3d,0xd3,0x50,0x53,0xc5,0x12,0x48,0xd1,0x05,0x0d,0x74,0x87,0x2c,0x10,0x20,0x21,0x24,0x61,0xfd,0x32,
0x47,0xb1,0x15,0x5b,0xe0,0xd8,0x46,0xb2,0x13,0x52,0xdd,0xf5,0xdf,0x47,0x8b,0x17,0x79,0x8d,0xc3,0xd4,
0x9c,0xea,0x3e,0x67,0xea,0x43,0x05,0xeb,0x3d,0x5d,0x5d,0x3d,0x3d,0x3d,0x3d,0xc9,0xf2,0xd1,0x5a,0xf3,
0xba,0x31,0x7a,0xec,0xb7,0x14,0xc3,0x9d,0x9a,0x27,0x47,0xfe,0xff,0x10,0x68,0x27,0x47,0x53,0xe8,0x02,
0x45,0x35,0x00,0x26,0xd0,0x3d,0xae,0xdc,0x8e,0xda,0x9b,0x5f,0x2a,0x27,0x47,0x2e,0x72,0x4d,0x78,0x72,
0xb4,0xed,0xff,0x72,0x25,0x0b,0x4c,0xe1,0x71,0xc5,0x35,0xe0,0x14,0x6e,0xaa,0xb6,0x69,0xe3,0x8a,0xa2,
0xda,0x96,0x0b,0x2d,0x5a,0xef,0xa7,0x1d,0xfe,0xaf,0x12,0x53,0x9d,0x21,0x38,0x77,0x6c,0xec,0x4a,0x7a,
0x73,0xa4,0xb9,0xc6,0xb1,0x06,0x67,0x48,0x85,0x9b,0xfc,0xe1,0x13,0xb2,0x90,0x8b,0x80,0xb9,0x49,0x54,
0x60,0xc2,0xe3,0x2a,0x85,0x30,0x91,0xf5,0xa2,0x60,0x68,0x1e,0x57,0x88,0xbb,0x30,0x21,0x31,0x20,0xa4,
0x18,0x06,0x86,0x93,0xe3,0xca,0xd8,0xb3,0x34,0x13,0x6e,0xa9,0x84,0x50,0x45,0xa2,0x62,0xe4,0xb8,0x0a,
0xc1,0x6a,0x28,0x78,0x66,0xe5,0xdb,0x42,0x40,0xff,0x10,0x7d,0x1c,0xdb,0xda,0xe2,0xe4,0x48,0x43,0x33,
0x05,0x69,0xc7,0x15,0xe0,0x38,0x15,0xf1,0x34,0xdb,0x54,0x4d,0x1b,0xbc,0x88,0x07,0xd5,0x04,0x84,0x1c,
0x57,0x2c,0xdb,0x45,0x13,0xa4,0x02,0x17,0xd9,0x56,0x83,0xd2,0x06,0xc8,0x82,0xb8,0x92,0xab,0x52,0x51,
0x0e,0xfd,0xd2,0x3f,0x14,0x88,0xb1,0x8d,0x0f,0x15,0x59,0xac,0xac,0x1d,0x2b,0x96,0x67,0x9a,0xca,0xcf,
0x3f,0xc7,0xca,0xb7,0xb8,0xae,0xf2,0xad,0x42,0x39,0xa0,0x49,0x1c,0x32,0xa8,0x53,0x51,0x7e,0x57,0x4d,
0xa4,0xbe,0x6c,0x39,0x18,0xce,0xb8,0xf5,0x0c,0xa4,0xc1,0x9e,0xdc,0x38,0x35,0x81,0x03,0xac,0x80,0xd7,
0x14,0x12,0x02,0x74,0x58,0x39,0xf9,0xe3,0x8f,0x78,0x63,0xbe,0x40,0xf9,0xf6,0x8d,0x9a,0x86,0x56,0xa0,
0x86,0xa1,0xdd,0x09,0xfe,0x0f,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,0x36,0x45,0x65,
0x01,0x34,0x14,0x8d,0x02,0x67,0x0b,0x5a,0x60,0x6c,0x42,0x8d,0x12,0x5c,0xf7,0x91,0xa0,0xb6,0xce,0x48,
0x68,0x88,0x44,0x05,0x15,0x7f,0xca,0xfa,0x9d,0x97,0x21,0x54,0x95,0xce,0x71,0xc7,0x46,0x96,0xbb,0x15,
0xd9,0x44,0xa1,0x8a,0x79,0xed,0xc4,0xcb,0x91,0x43,0x1b,0x2b,0xc0,0xa4,0x34,0x78,0x45,0xdf,0xd4,0x61,
0xdc,0x78,0x6f,0xef,0x75,0xe8,0xde,0xa3,0x36,0x6f,0x89,0x56,0x12,0x0d,0x6e,0x7c,0xc8,0xef,0x1f,0x11,
0x8a,0x53,0x5b,0x83,0x89,0xfe,0x65,0x21,0x8d,0xe0,0x9b,0xbb,0xf1,0x6e,0xa6,0x31,0xa2,0xb2,0xfd,0x13,
0xf4,0xc4,0x2a,0x36,0x42,0x53,0x41,0x46,0x70,0x69,0x86,0x85,0x51,0xf3,0xc9,0x60,0x2b,0x42,0x3e,0x5d,
0x79,0x34,0x64,0xe9,0x95,0x80,0x41,0xf0,0x1c,0xc0,0xfb,0xcf,0x61,0x47,0xfd,0xe7,0x4e,0x40,0x34,0xde,
0x3d,0x81,0xb9,0xe6,0x2b,0xb1,0xe5,0x86,0x2e,0xa7,0x68,0x8c,0xc5,0x8a,0x72,0xec,0x4f,0x80,0x78,0x9f,
0xe7,0x00,0x5b,0x9c,0x81,0xa8,0x6c,0x00,0x32,0x80,0x34,0x0b,0x68,0xb1,0xa5,0x89,0x6a,0x3a,0x01,0x13,
0xbe,0x56,0x6d,0xe1,0x50,0xe6,0x3b,0x81,0x43,0x55,0x02,0x28,0x2e,0x1c,0x40,0x40,0x98,0x5d,0xd3,0xd5,
0x84,0x64,0x4b,0x9a,0x68,0x52,0xb1,0x84,0x26,0x88,0x90,0x70,0xcc,0xd5,0x97,0x11,0x06,0x2a,0x4c,0x40,
0x46,0x82,0x88,0x09,0x08,0x98,0x8c,0x3d,0xd7,0xa5,0x3d,0x16,0x3f,0x9b,0x0e,0xa6,0xeb,0x14,0x5e,0x04,
0xd9,0xc3,0x36,0x70,0xd0,0x36,0xaf,0xee,0xb2,0xea,0xdb,0x3a,0x4b,0x2c,0x56,0x6d,0xb4,0x69,0xcf,0x2d,
0x66,0x67,0xbf,0x71,0x70,0xa2,0x24,0x5b,0x0f,0x56,0x6e,0xea,0x3e,0xd0,0x84,0x2e,0x1c,0x96,0x00,0xe5,
0x8a,0x21,0x64,0xda,0x71,0x2d,0x30,0x43,0xba,0x18,0x4d,0x17,0x8c,0x59,0xf4,0x49,0x35,0x1a,0x65,0x22,
0xeb,0x80,0xba,0xf8,0x0c,0xd2,0xd8,0x26,0xfe,0x18,0x81,0x31,0xf5,0x01,0x65,0x5d,0x74,0x72,0x9d,0xe5,
0x1d,0x01,0x43,0x49,0x21,0x94,0x87,0x2c,0x7d,0xa3,0xd0,0x06,0x47,0x52,0xa0,0x05,0xef,0x6a,0xdb,0xc5,
0x48,0xd7,0x21,0x2e,0x68,0x3d,0xd4,0x08,0xdb,0x0f,0x4a,0xbe,0x0f,0x83,0x68,0xee,0xe7,0x73,0x90,0x74,
0x42,0x16,0x51,0xd9,0xf7,0xe1,0x21,0x16,0x99,0x82,0x51,0x10,0xf2,0x68,0x14,0xf8,0x73,0x46,0xdb,0xc9,
0xe9,0x9f,0x39,0xd8,0x6c,0xbd,0xdc,0x4b,0x0e,0xa8,0xbc,0x6c,0xee,0x71,0x88,0x93,0x23,0x4c,0x43,0x87,
0xad,0x1c,0x72,0xd9,0x71,0x45,0xd2,0x06,0xa6,0x39,0x74,0xa1,0x43,0x46,0xd8,0xa3,0x95,0xd8,0x84,0x61,
0x71,0x98,0xa6,0xe7,0x81,0x80,0x76,0x9a,0x25,0x90,0x2e,0x95,0xb3,0x18,0xc9,0x81,0x24,0x76,0x25,0xa0,
0xdb,0xc0,0x24,0x85,0xd8,0x13,0xa6,0x90,0x05,0x1e,0x98,0x9f,0x98,0x34,0x39,0xc6,0x89,0x55,0x99,0xda,
0xcd,0x09,0x26,0x78,0x08,0x18,0x4f,0x9a,0x67,0xc0,0xf4,0xc4,0xb4,0xec,0x02,0xd7,0xd8,0x9a,0x98,0xb6,
0x8d,0x37,0x02,0xdd,0x3b,0x26,0x54,0xb6,0x95,0xdd,0xcf,0x9f,0x95,0x7f,0x29,0xd5,0x9d,0x1d,0x66,0xb2,
0x7f,0x06,0x49,0x74,0xaa,0x75,0x39,0x83,0x46,0x96,0xe3,0xb9,0x8a,0xbb,0x70,0x68,0x87,0x31,0xb0,0x68,
0x5a,0xae,0x4c,0x91,0x75,0x5c,0xd9,0xa1,0xbf,0xe0,0xed,0xb8,0x42,0x21,0x2b,0xf1,0xda,0x61,0xe7,0xb7,
0x2c,0x6f,0x3a,0x86,0x38,0xa2,0x7c,0x27,0x38,0xa6,0x16,0x92,0x8c,0x5e,0xae,0x45,0x76,0x9b,0x6d,0x4e,
0x6c,0x0a,0xb2,0xc1,0xc4,0x9f,0x14,0xba,0xc0,0xc1,0xb7,0x0f,0xf4,0x47,0x21,0x65,0xad,0xc0,0x14,0xb7,
0x66,0x3f,0xd6,0x04,0x11,0x87,0x44,0xff,0xb3,0x17,0xd5,0x9c,0x90,0x43,0xeb,0x52,0x5b,0x4c,0x95,0xdf,
0x89,0x37,0x9e,0x22,0x37,0xda,0x51,0xd1,0xbd,0xa0,0xb9,0x60,0xab,0xf5,0xc8,0x57,0x8d,0xcd,0x96,0x28,
0xfc,0x30,0x8d,0xc4,0x9c,0x51,0x0d,0xa8,0xbe,0x84,0x7c,0xc7,0xb6,0x6d,0x42,0x60,0xb1,0x49,0x20,0xd5,
0x09,0xf2,0xad,0x4a,0xcc,0xf7,0x63,0x2a,0x2d,0xcb,0x4f,0xac,0x58,0xff,0x38,0xa6,0xdc,0x9f,0x6c,0xb4,
0xa2,0x55,0x7c,0x2d,0x9d,0x35,0x85,0x59,0xdf,0x9f,0x7f,0x2a,0x19,0x52,0x31,0x15,0xd9,0xae,0x73,0x2f,
0x23,0xf0,0xd2,0x76,0x3b,0x74,0xf3,0x8e,0x2d,0xe8,0xca,0xc9,0x9f,0x09,0xc6,0xd0,0x54,0xb8,0x83,0x71,
0xe3,0xd0,0xf1,0x25,0x88,0xc1,0x31,0x63,0x66,0xc3,0xc4,0x75,0x7c,0x30,0x8e,0x13,0x77,0x15,0x31,0xf4,
0x15,0xbe,0x27,0xcd,0xc0,0x4e,0xb9,0x48,0xdc,0x46,0x6e,0x82,0xc9,0x91,0x51,0x3b,0x19,0x40,0x1d,0x9a,
0x84,0x0e,0x5b,0x2d,0xdf,0xb6,0xe1,0x93,0x09,0x2d,0xdd,0x35,0xc2,0x13,0x02,0x31,0x87,0x7c,0xa9,0x3c,
0x8d,0xb2,0xab,0x87,0x0e,0x4d,0xa7,0x07,0x34,0xe5,0xd5,0x40,0xb8,0xe6,0x61,0x50,0x2f,0x1c,0x94,0x6f,
0xf1,0xe1,0xe4,0xf5,0x36,0xc3,0x4d,0x77,0xb1,0x97,0x95,0xf0,0x2f,0xdf,0xb1,0xb3,0xdc,0x4c,0x0e,0x00,
0x80,0xaf,0x6f,0x22,0xad,0x10,0xb9,0xd2,0x4f,0xe9,0xf3,0x07,0x91,0xcd,0x48,0xd3,0x65,0x43,0x98,0x23,
0x7b,0xbc,0x53,0x29,0x4d,0x2a,0x64,0xa8,0xb4,0x33,0x38,0x3f,0xae,0x09,0x53,0xb0,0xc3,0x1b,0x16,0xad,
0x28,0x9a,0xea,0xe6,0x0d,0x7e,0x60,0xff,0x11,0xf5,0xa0,0x4a,0x94,0xd3,0x9b,0x34,0x12,0xd1,0xba,0xb6,
0xc3,0xf3,0x26,0x1e,0x46,0x58,0xf8,0xc9,0xa4,0xdb,0x46,0x6f,0x50,0x93,0x3c,0x53,0x54,0x4a,0x56,0xae,
0x66,0x57,0x1e,0x7a,0x16,0x46,0xa4,0xb8,0xea,0x6e,0x6e,0x55,0x12,0xce,0xad,0xa0,0xe6,0xb6,0xe8,0xee,
0xd2,0x6e,0x4f,0x02,0xd2,0xc9,0x4e,0xc7,0x7d,0x5c,0x36,0x0f,0x8b,0x8c,0x3b,0x92,0x51,0x36,0xc3,0x49,
0xcc,0xbc,0x3a,0x04,0x64,0x0b,0xaf,0x4f,0xdc,0x0d,0xa6,0x34,0xdb,0xdf,0x20,0xe2,0x98,0x80,0x87,0xcc,
0x0d,0x56,0xfe,0x49,0xe1,0x2b,0xf3,0xfb,0xd8,0x63,0x68,0x02,0x1e,0xaf,0xb3,0x3b,0x40,0xe7,0x2c,0xcc,
0xe3,0x29,0x57,0x2d,0x4d,0x95,0x25,0x28,0x39,0x4c,0xe5,0x80,0x0a,0xe1,0x8b,0x06,0x16,0x64,0xf9,0xec,
0x9b,0xda,0x16,0x55,0x2c,0x98,0x7c,0x5d,0xae,0x10,0x9b,0x74,0x4b,0x20,0x5d,0x0f,0x92,0x62,0xcc,0x91,
0xd0,0x58,0x05,0x74,0x0e,0x35,0x6b,0x19,0xec,0x7d,0xa0,0xb3,0x12,0x5b,0xc3,0xc3,0xcb,0xe8,0xfa,0x2a,
0xab,0xc0,0x4e,0x30,0x2a,0x06,0x6d,0x73,0x85,0x55,0x20,0x09,0x5d,0xe3,0x70,0x31,0xe8,0xd0,0x57,0x59,
0x09,0xd6,0x5b,0xe2,0x01,0x43,0x2f,0xe5,0x01,0xd9,0xf9,0x5b,0x89,0x7c,0x2c,0x68,0x74,0x4c,0x7f,0x0d,
0x97,0x8e,0x16,0xf9,0x71,0x79,0x59,0x9a,0x4b,0x41,0x7e,0x26,0x67,0x69,0x6c,0x52,0x47,0x07,0xe9,0xec,
0xac,0x25,0x3b,0x2c,0xf6,0xec,0x26,0x95,0xe5,0x9c,0x37,0x89,0xbd,0x16,0x6b,0xd2,0xdf,0xee,0x1f,0x06,
0x07,0x54,0x94,0x31,0xdd,0x28,0xb3,0x74,0x28,0xb9,0x78,0x01,0x4d,0x93,0x56,0xae,0xec,0x46,0xeb,0x5a,
0xb0,0xab,0x17,0xb8,0xb9,0x4b,0x53,0x44,0x40,0x36,0xa6,0xc8,0x2e,0x2b,0x59,0x6c,0x82,0x00,0x25,0x9e,
0xfd,0x83,0x48,0x9e,0x7d,0x9e,0x72,0xa8,0x21,0x2f,0xa7,0x8d,0x1f,0x26,0x25,0xeb,0x1f,0x22,0xcb,0xb2,
0x24,0xb6,0x30,0x95,0xed,0xda,0x3c,0xf3,0x29,0x4c,0x66,0xa7,0x42,0x67,0xc5,0x74,0x56,0xd4,0x5a,0x92,
0x70,0x08,0xa5,0x92,0x29,0x6d,0x02,0x31,0x96,0x53,0xc6,0x80,0x9a,0x1e,0xa6,0xb6,0x29,0x1c,0xbc,0x62,
0xfd,0x78,0xae,0x19,0x5f,0x94,0x72,0x09,0xa5,0x5b,0xe5,0x19,0xe9,0x32,0x66,0xcb,0x93,0x8d,0x62,0x84,
0x1e,0x1d,0x4e,0xbc,0x6a,0x0a,0x52,0x0c,0x59,0x37,0xe7,0x74,0x39,0x5b,0x35,0x37,0x29,0xc6,0xbc,0xb6,
0xcc,0x45,0x5e,0xce,0xc2,0x7d,0x75,0x35,0x7f,0x12,0xf8,0x4d,0x1e,0x4a,0xa3,0xc9,0x53,0x76,0x64,0x58,
0x4a,0xb3,0x5b,0xc6,0x25,0xc3,0x66,0x32,0x02,0x72,0xca,0xfb,0x96,0xed,0x69,0xb2,0xb4,0xca,0xed,0x6a,
0x32,0xf1,0xf3,0xf7,0x35,0x7e,0xef,0x53,0x3b,0x9b,0x14,0x63,0x9a,0x71,0x53,0x0b,0xe6,0x10,0xe5,0xc2,
0x55,0xf8,0x09,0xb4,0xa5,0xb4,0x34,0xd1,0x68,0x89,0x7d,0x56,0xd8,0x8f,0xf7,0xee,0xb4,0x12,0x00,0x7f,
0xa9,0xbd,0xd6,0x54,0x8e,0xbc,0xdf,0x71,0xb7,0x15,0x8b,0xe8,0xb9,0xfb,0xad,0x70,0xc4,0xbe,0xe3,0x8e,
0x4b,0xb8,0xd7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x94,0xb2,0x91,0x53,0x56,0x09,0xae,0x4d,0xa5,0xcc,0x92,0x1b,0x3d,
0x93,0x15,0x8b,0xc2,0x67,0x64,0xab,0x65,0x17,0x96,0x92,0xc9,0x1e,0xf5,0x4f,0xec,0x36,0xa2,0x3b,0x5d,
0xb9,0xcd,0x07,0x96,0x8a,0x5f,0x12,0x29,0xc8,0x98,0x86,0x1c,0x20,0xcb,0x43,0x2c,0xd7,0x49,0x5a,0xe1,
0x87,0xbf,0x78,0x96,0x6f,0x26,0xdb,0x18,0x7d,0x65,0xfb,0x00,0x33,0x1e,0x36,0x29,0xed,0x21,0xc4,0x33,
0x29,0x21,0x8e,0xfa,0x23,0x04,0x65,0xc2,0x66,0x84,0x12,0x05,0x94,0x24,0x4e,0x25,0x23,0x89,0x2e,0x60,
0xc5,0xfb,0x33,0x63,0x82,0x14,0xaf,0x40,0x54,0xee,0x80,0x46,0xc6,0xca,0x62,0x17,0x35,0x54,0x9e,0x9f,
0x09,0x52,0x2e,0x4d,0x91,0xae,0x80,0x5b,0xc6,0x58,0xac,0x72,0x8a,0x08,0x47,0x5c,0x81,0x80,0x74,0xf9,
0x51,0x22,0xe0,0x5f,0x81,0x5c,0x46,0x40,0x38,0x62,0x82,0x00,0x43,0xcc,0x78,0xdf,0x92,0x93,0xc3,0x98,
0x76,0x70,0xa7,0x3f,0xb8,0x92,0xc9,0x64,0x9b,0xc1,0x6b,0xe4,0x34,0x35,0x5f,0xbf,0x14,0xbf,0x10,0x3b,
0x24,0x19,0x16,0x9d,0x28,0xc1,0xa6,0x2f,0x35,0xe9,0x21,0xc0,0xaa,0x71,0x15,0xd6,0x95,0x83,0x29,0x17,
0xd1,0xf9,0x17,0x4a,0xf3,0x09,0x0e,0xb9,0x6e,0xe6,0x1e,0x30,0x35,0xe7,0x1d,0x64,0x91,0x82,0x49,0x9f,
0x37,0x78,0xb4,0xda,0x55,0xab,0x59,0xef,0x27,0x59,0x04,0xe5,0xe5,0xfc,0x3a,0x44,0x49,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0xd7,0x1d,
0x6a,0x1f,0xe9,0x9b,0x63,0xf1,0xb5,0xf1,0x36,0xff,0xc8,0xfa,0x3f,0xf2,0xaa,0x5e,0xb3,0x7a,0x3d,0x00,
0x00};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,12 @@
#define __assets_version
const uint8_t VersionMajor = 2;
const uint8_t VersionMinor = 1;
const uint8_t VersionMinor = 2;
const uint8_t VersionPatch = 0;
const uint8_t VersionMetadata = 2;
const char VersionBranch[] = "release/2.1";
const char VersionSemVer[] = "2.1.0-beta.1";
const char VersionFullSemVer[] = "2.1.0-beta.1+2";
const uint8_t VersionMetadata = 0;
const char VersionBranch[] = "develop";
const char VersionSemVer[] = "2.2.0-unstable.1";
const char VersionFullSemVer[] = "2.2.0-unstable.1";
const char VersionCommitDate[] = "2018-04-29";
#endif

View File

@ -304,6 +304,13 @@ bool lastMotion = false;
void updateMotionTrigger()
{
if (motionTriggerSettingsChanged)
{
initMotionPins();
activeMotionStart = 0;
}
if (!motionTriggerSettings->enabled() || !motionTriggerSettings->triggerCount())
{
activeMotionStart = 0;
@ -378,6 +385,12 @@ void checkTriggers()
bool motionChanged = inMotionTrigger != lastMotion;
lastMotion = inMotionTrigger;
if (motionTriggerSettingsChanged)
{
motionChanged = true;
motionTriggerSettingsChanged = false;
}
if (!motionChanged && !timeTriggerChanged)
return;

View File

@ -1,5 +1,36 @@
function startApp()
{
// Source: https://github.com/axios/axios/issues/164
axios.interceptors.response.use(undefined, function axiosRetryInterceptor(err) {
var config = err.config;
// If config does not exist or the retry option is not set, reject
if(!config || !config.retry) return Promise.reject(err);
// Set the variable for keeping track of the retry count
config.__retryCount = config.__retryCount || 0;
// Check if we've maxed out the total number of retries
if(config.__retryCount >= config.retry) {
// Reject with the error
return Promise.reject(err);
}
// Increase the retry count
config.__retryCount += 1;
// Create new promise to handle exponential backoff
var backoff = new Promise(function(resolve) {
setTimeout(function() {
resolve();
}, config.retryDelay || 1);
});
// Return the promise in which recalls axios to retry the request
return backoff.then(function() {
return axios(config);
});
});
Vue.component('check', {
template: '<div class="check" :class="{ checked: value, disabled: disabled }" @keydown="handleKeyDown" @click="handleClick" tabindex="0"><div class="control"><div class="inner"></div></div><div class="label">{{ title }}</div></div>',
props: {
@ -119,7 +150,7 @@ function startApp()
});
var i18n = new VueI18n({
locale: navigator.language,
locale: navigator.language.split('-')[0],
fallbackLocale: 'en',
messages: messages
});
@ -338,7 +369,7 @@ function startApp()
loadStatus: function()
{
var self = this;
return axios.get('/api/status')
return axios.get('/api/status', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -350,7 +381,7 @@ function startApp()
loadConnection: function()
{
var self = this;
return axios.get('/api/connection')
return axios.get('/api/connection', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -362,7 +393,7 @@ function startApp()
loadSystem: function()
{
var self = this;
return axios.get('/api/system')
return axios.get('/api/system', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -374,7 +405,7 @@ function startApp()
loadTimeTriggers: function()
{
var self = this;
return axios.get('/api/triggers/time')
return axios.get('/api/triggers/time', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -419,7 +450,7 @@ function startApp()
loadMotionTriggers: function()
{
var self = this;
return axios.get('/api/triggers/motion')
return axios.get('/api/triggers/motion', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -431,7 +462,7 @@ function startApp()
loadSteps: function()
{
var self = this;
return axios.get('/api/steps/values')
return axios.get('/api/steps/values', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (Array.isArray(response.data))
@ -481,7 +512,7 @@ function startApp()
ip: self.connection.ip,
subnetmask: self.connection.subnetmask,
gateway: self.connection.gateway,
})
}, { retry: 10, retryDelay: 1000 })
.then(function(response)
{
})
@ -499,7 +530,7 @@ function startApp()
self.saving = true;
axios.post('/api/system', self.system)
axios.post('/api/system', self.system, { retry: 10, retryDelay: 1000 })
.then(function(response)
{
self.showNotification(i18n.t('rebootPending'));
@ -595,7 +626,7 @@ function startApp()
var self = this;
if (!self.saving)
{
axios.get('/api/connection/status')
axios.get('/api/connection/status', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -693,7 +724,9 @@ function startApp()
axios.post('/api/steps/values', {
transitionTime: 1000,
values: steps
values: steps,
retry: 10,
retryDelay: 1000
})
.then(function(response)
{
@ -761,7 +794,7 @@ function startApp()
});
}
axios.post('/api/triggers/time', timeSettings)
axios.post('/api/triggers/time', timeSettings, { retry: 10, retryDelay: 1000 })
.then(function(response)
{
})
@ -806,7 +839,7 @@ function startApp()
self.saving = true;
axios.post('/api/triggers/motion', self.triggers.motion)
axios.post('/api/triggers/motion', self.triggers.motion, { retry: 10, retryDelay: 1000 })
.then(function(response)
{
})
@ -857,7 +890,7 @@ function startApp()
{
var self = this;
axios.get('/api/steps')
axios.get('/api/steps', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
if (typeof response.data == 'object')
@ -945,7 +978,7 @@ function startApp()
count: self.calibration.count,
useCurve: self.calibration.useCurve,
ranges: self.calibration.ranges
})
}, { retry: 10, retryDelay: 1000 })
.then(function(response)
{
})
@ -960,7 +993,7 @@ function startApp()
{
var self = this;
return axios.get('/api/stacktrace/delete')
return axios.get('/api/stacktrace/delete', { retry: 10, retryDelay: 1000 })
.then(function(response)
{
self.status.resetReason = 0;

2
web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -54,10 +54,8 @@
{{ $t('error.stackTrace') }}
</p>
<div v-if="status.stackTrace">
<a class="button button-primary" href="/api/stacktrace/get">{{ $t('error.stackTraceDownload') }}</a>
<a class="button" @click="deleteStackTrace">{{ $t('error.stackTraceDelete') }}</a>
</div>
<a class="button button-primary" href="/api/stacktrace/get" v-if="status.stackTrace">{{ $t('error.stackTraceDownload') }}</a>
<a class="button" @click="deleteStackTrace">{{ $t('error.stackTraceDelete') }}</a>
</div>

View File

@ -168,7 +168,7 @@ var messages = {
},
stackTrace: 'A stack trace is available. Please send it to your nearest developer and/or delete it from this Stairs device to remove this message.',
stackTraceDownload: 'Download',
stackTraceDelete: 'Remove',
stackTraceDelete: 'Hide',
stackTraceDeleteError: 'Could not remove stack trace'
},
@ -354,7 +354,7 @@ var messages = {
},
stackTrace: 'Een stack trace is beschikbaar. Stuur het naar de dichtsbijzijnde ontwikkelaar en/of verwijder het van deze Trap module om dit bericht te verbergen.',
stackTraceDownload: 'Downloaden',
stackTraceDelete: 'Verwijderen',
stackTraceDelete: 'Verbergen',
stackTraceDeleteError: 'Kan stack trace niet verwijderen'
},