From: Russ Handorf Date: Tue, 29 Oct 2019 02:37:45 +0000 (-0400) Subject: FIRSTIES X-Git-Url: https://handorf.org/code/?a=commitdiff_plain;h=642bfa5ae7fe182b0ecedd5fd5ce832e4cb441da;p=russ-button.git FIRSTIES --- 642bfa5ae7fe182b0ecedd5fd5ce832e4cb441da diff --git a/board.brd b/board.brd new file mode 100755 index 0000000..e0bd443 --- /dev/null +++ b/board.brd @@ -0,0 +1,777 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +RUSS-BUTTON + v1 + + + +<b>AVR Microcontrollers</b> +<p>Created by Michael Shimniok <a href="http://www.bot-thoughts.com/">www.bot-thoughts.com</a></b> + + + + + + + + + + + + +>VALUE + + + + +>NAME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +1 + + + + + + + + + + + + + +>NAME + + + + +<b>Pin Header Connectors</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +PIN HEADER + + + + + + + +<h3>SparkFun Resistors</h3> +This library contains resistors. Reference designator:R. +<br> +<br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is <b> the end user's responsibility</b> to ensure correctness and suitablity for a given componet or application. +<br> +<br>If you enjoy using this library, please buy one of our products at <a href=" www.sparkfun.com">SparkFun.com</a>. +<br> +<br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br> +<br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + +<p><b>Generic 1608 (0603) package</b></p> +<p>0.2mm courtyard excess rounded to nearest 0.05mm.</p> + + + + + + + + +>NAME +>VALUE + + + + + + + +Generic 1608 (0603) package +0.2mm courtyard excess rounded to nearest 0.05mm. + + + + + + + +<b>https://componentsearchengine.com</b><p> +<author>Created by SamacSys</author> + + +<b>BAT-HLD-001</b><br> + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>EAGLE Design Rules</b> +<p> +Die Standard-Design-Rules sind so gewählt, dass sie für +die meisten Anwendungen passen. Sollte ihre Platine +besondere Anforderungen haben, treffen Sie die erforderlichen +Einstellungen hier und speichern die Design Rules unter +einem neuen Namen ab. +<b>EAGLE Design Rules</b> +<p> +The default Design Rules have been set to cover +a wide range of applications. Your particular design +may have different requirements, so please make the +necessary adjustments and save your customized +design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Since Version 6.2.2 text objects can contain more than one line, +which will not be processed correctly with this version. + + +Since Version 8.2, EAGLE supports online libraries. The ids +of those online libraries will not be understood (or retained) +with this version. + + +Since Version 8.3, EAGLE supports URNs for individual library +assets (packages, symbols, and devices). The URNs of those assets +will not be understood (or retained) with this version. + + +Since Version 8.3, EAGLE supports the association of 3D packages +with devices in libraries, schematics, and board files. Those 3D +packages will not be understood (or retained) with this version. + + + diff --git a/board.sch b/board.sch new file mode 100755 index 0000000..d3542ce --- /dev/null +++ b/board.sch @@ -0,0 +1,1120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +1 + + + + + + + + +>NAME + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME + + + + + + + + +>NAME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME + + + + + + + + +<b>AVR ISP HEADER</b> +<br> +Standard 6 pin header for AVR programming + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<h3>SparkFun Resistors</h3> +This library contains resistors. Reference designator:R. +<br> +<br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is <b> the end user's responsibility</b> to ensure correctness and suitablity for a given componet or application. +<br> +<br>If you enjoy using this library, please buy one of our products at <a href=" www.sparkfun.com">SparkFun.com</a>. +<br> +<br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br> +<br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + +<h3>AXIAL-0.3</h3> +<p>Commonly used for 1/4W through-hole resistors. 0.3" pitch between holes.</p> + + + + + + + + + + +>Name +>Value + + +<p><b>Generic 1608 (0603) package</b></p> +<p>0.2mm courtyard excess rounded to nearest 0.05mm.</p> + + + + + + + + +>NAME +>VALUE + + + + + +This is the "EZ" version of the standard .3" spaced resistor package.<br> +It has a reduced top mask to make it harder to install upside-down. + + + + + + + + + + +>Name +>Value + + + + + + +<h3>AXIAL-0.1</h3> +<p>Commonly used for 1/4W through-hole resistors. 0.1" pitch between holes.</p> + + + + + + +>Name +>Value + + +<h3>AXIAL-0.1-KIT</h3> +<p>Commonly used for 1/4W through-hole resistors. 0.1" pitch between holes.</p> +<p><b>Warning:</b> This is the KIT version of the AXIAL-0.1 package. This package has a smaller diameter top stop mask, which doesn't cover the diameter of the pad. This means only the bottom side of the pads' copper will be exposed. You'll only be able to solder to the bottom side.</p> + + + + + + +>Name +>Value + + + + + + + + + +AXIAL-0.3 +Commonly used for 1/4W through-hole resistors. 0.3" pitch between holes. + + + + + +Generic 1608 (0603) package +0.2mm courtyard excess rounded to nearest 0.05mm. + + + + + +This is the "EZ" version of the standard .3" spaced resistor package. +It has a reduced top mask to make it harder to install upside-down. + + + + + +AXIAL-0.1 +Commonly used for 1/4W through-hole resistors. 0.1" pitch between holes. + + + + + +AXIAL-0.1-KIT +Commonly used for 1/4W through-hole resistors. 0.1" pitch between holes. +Warning: This is the KIT version of the AXIAL-0.1 package. This package has a smaller diameter top stop mask, which doesn't cover the diameter of the pad. This means only the bottom side of the pads' copper will be exposed. You'll only be able to solder to the bottom side. + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<h3>100Ω resistor</h3> +<p>A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. Resistors act to reduce current flow, and, at the same time, act to lower voltage levels within circuits. - Wikipedia</p> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>AVR Microcontrollers</b> +<p>Created by Michael Shimniok <a href="http://www.bot-thoughts.com/">www.bot-thoughts.com</a></b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>VALUE + + + + +>NAME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>ATtiny441, ATtiny841 AVR Microcontroller</b> +<p>The high-performance Atmel picoPower 8-bit AVR RISC-based microcontroller combines 4KB ISP +flash memory, 512-Byte EEPROM, 128B SRAM, 12 general purpose I/O lines, 32 general purpose +working registers, an 8-bit timer/counter with two PWM channels, two 16-bit timer/counters with +two PWM channels, internal and external interrupts, an 12-channel 10-bit A/D converter, 2 On-chip +analog comparators, 2 full duplex USARTs with Start Frame wake up from power down, master/slave +SPI serial interface, slave I2C serial interface, programmable gain stage (1x, 20x, and 100x) for +12 differential ADC channel pairs, programmable watchdog timer with internal oscillator, internal +calibrated oscillator, and four software selectable power saving modes. The device operates +between 1.7-5.5 volts.</p> +<a href="http://www.atmel.com/Images/Atmel-8495-8-bit-AVR-Microcontrollers-ATtiny441-ATtiny841_Datasheet.pdf">datasheet.pdf</a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>Pin Header Connectors</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>PIN HEADER</b> + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +PIN HEADER + + + + + +PIN HEADER + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>https://componentsearchengine.com</b><p> +<author>Created by SamacSys</author> + + +<b>BAT-HLD-001</b><br> + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>Coin Cell Battery Holders Linx CR2032 Battery Holder</b><p> +Source: <a href="https://componentsearchengine.com/Datasheets/1/BAT-HLD-001.pdf"> Datasheet </a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Since Version 8.2, EAGLE supports online libraries. The ids +of those online libraries will not be understood (or retained) +with this version. + + +Since Version 8.3, EAGLE supports URNs for individual library +assets (packages, symbols, and devices). The URNs of those assets +will not be understood (or retained) with this version. + + +Since Version 8.3, EAGLE supports the association of 3D packages +with devices in libraries, schematics, and board files. Those 3D +packages will not be understood (or retained) with this version. + + + diff --git a/sketch_oct25a/sketch_oct25a.ino b/sketch_oct25a/sketch_oct25a.ino new file mode 100644 index 0000000..b5d69a7 --- /dev/null +++ b/sketch_oct25a/sketch_oct25a.ino @@ -0,0 +1,131 @@ +//USBtinyISP(ATTinyCore) upload using programmer +//Atinny841(Optiboot) + +const int RED = 4; //LED row 1 +const int GREEN = 3; //LED row 2 +const int BLUE = 2; //LED row 3 + +static uint16_t hue = 0; // 0-359 +unsigned long previousMillis = 0; +int shift = 0; + +void setup() { + previousMillis = millis() + 5000; + pinMode(RED, OUTPUT); + pinMode(GREEN, OUTPUT); + pinMode(BLUE, OUTPUT); + +} + +void loop() { + randomSeed(analogRead(0)); + if (shift==1) { + for (int hue=0; hue<360; hue++) { + setLedColorHSV(hue,random(1, 5),random(1, 5)); + delay(random(1, 25)); + } + } + if (shift==0) { + for (int hue=360; hue>0; hue--) { + setLedColorHSV(hue,random(1, 5),random(1, 5)); + delay(random(1, 25)); + } + } + if (((signed long)(millis() - previousMillis)) > 0) { + previousMillis = millis() + 3000; + long dice = random(1000); + if (dice > 900) { + glowgreen(); + shift=1; + RGB_color(0,100,0); + } else if (dice<100) { + glowblue(); + shift=0; + RGB_color(100,0,0); + } + } +} + +void RGB_color(int red_light_value, int green_light_value, int blue_light_value) { + analogWrite(RED, red_light_value); + analogWrite(GREEN, green_light_value); + analogWrite(BLUE, blue_light_value); +} + +void setLedColorHSV(int h, double s, double v) { + //this is the algorithm to convert from RGB to HSV + double r=0; + double g=0; + double b=0; + + double hf=h/60.0; + + int i=(int)floor(h/60.0); + double f = h/60.0 - i; + double pv = v * (1 - s); + double qv = v * (1 - s*f); + double tv = v * (1 - s * (1 - f)); + + switch (i) + { + case 0: //rojo dominante + r = v; + g = tv; + b = pv; + break; + case 1: //verde + r = qv; + g = v; + b = pv; + break; + case 2: + r = pv; + g = v; + b = tv; + break; + case 3: //azul + r = pv; + g = qv; + b = v; + break; + case 4: + r = tv; + g = pv; + b = v; + break; + case 5: //rojo + r = v; + g = pv; + b = qv; + break; + } + + //set each component to a integer value between 0 and 255 + int red=constrain((int)255*r,0,255); + int green=constrain((int)255*g,0,255); + int blue=constrain((int)255*b,0,255); + + RGB_color(red,green,blue); +} + +void glowgreen() { + for(uint16_t t=0; t<255; t++) { + RGB_color(0,t,0); + delay(random(1, 25)); + } + for(uint16_t t=255; t>0; t--) { + RGB_color(0,t,0); + delay(random(1, 25)); + } +} + +void glowblue() { + for(uint16_t t=0; t<255; t++) { + RGB_color(0,0,t); + delay(random(1, 25)); + } + for(uint16_t t=255; t>0; t--) { + RGB_color(0,0,t); + delay(random(1, 25)); + } +}