Shop OBEX P1 Docs P2 Docs Learn Events
Automated Menorah — Parallax Forums

Automated Menorah

JonnyMacJonnyMac Posts: 9,104
edited 2016-12-18 22:18 in Propeller 1
An EFX-TEK customer asked for code to run a fully-automated Menorah. Attached is the first crack for those who might be interested.

Note that the code is written for the EFX-TEK HC-8+ but will run on any Propeller board that has eight contiguous outputs for "wicks" and two pins for the I2C RTC (DS3231)

Comments

  • Did you feed the output of the LFSR to each of the wicks, to simulate a candle flame?

    That is how the commercial LED tea lights work.
  • JonnyMacJonnyMac Posts: 9,104
    edited 2016-12-19 15:04
    No; I have a PWM cog that drives the outputs, and a flame simulation cog that randomly ramps the "wick" levels up and own -- here's that code:
    pri flame_generator | ch                                        ' call only with cognew()
    
      repeat ch from 0 to 7
        target[ch] := (prng.random >> 1) // 33 + 223                ' pre-seed high value
    
      repeat
        repeat ch from 0 to 7
          if (flame[ch] < target[ch])
            if (++flame[ch] == target[ch])
              target[ch] := (prng.random >> 1) // 33 + 159          ' low (159..191)
          else
            if (--flame[ch] == target[ch])
              target[ch] := (prng.random >> 1) // 33 + 223          ' high (223..255)       
              
        time.pause_us(3500)
    
  • Heater.Heater. Posts: 21,230
    JonnyMac,
    ...eight contiguous outputs for "wicks"...
    I thought Menorah had 7 lamps.

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Heater. wrote: »
    JonnyMac,
    I thought Menorah had 7 lamps.

    https://en.wikipedia.org/wiki/Menorah_(Hanukkah)
  • Heater. wrote: »
    JonnyMac,
    ...eight contiguous outputs for "wicks"...
    I thought Menorah had 7 lamps.

    I've always wondered why "the menorah" had two names: menorah and hanukiah. Apparently The Menorah is the 7-candle holder used only in the temple (Talmudic law says though shalt not use outside the temple). Then the hanukiah is the special 9-candle holder used during Hannukah to celebrate the special event.

    Source
  • Heater.Heater. Posts: 21,230
    Confusing.

    Just put up a tree and stick some lights on it.
  • JonnyMacJonnyMac Posts: 9,104
    edited 2016-12-20 01:28
    I'm a guy who claims no religion, but is respectful of those who do. Every [home] Hanukkah event I've been to uses a Menorah (that's what they called it) with nine candles: the shamash (guide) and a candle for each day of Hanukkah (there are 8 days). The state of of CA even asked me for BASIC Stamp 1 code (for an EFX-TEK Prop-1 Controller) for a Menorah display on the capitol grounds (I don't know if they still use that).

    The code I shared was at the request of a customer; it was not intended to cause offense or controversy.
  • JonnyMac wrote: »
    The code I shared was at the request of a customer; it was not intended to cause offense or controversy.

    Now that statement has me confused, as to why anyone would be even slightly offended or find a cause for controversy.

    I always like your posts Jon as they are exemplify the practical side of the Propeller chip and how easy and quick it is to implement a prototype at a moments notice or even to "fix" other poorly designed products. When you team up experience, good practical sense, some get-stuck-into-it'ness, and a Propeller chip, then wonderful things happen, and happen sooner than later.
  • Heater. wrote: »
    Confusing.

    Just put up a tree and stick some lights on it.


    It certainly isn't about religious beliefs, seven, eight or nine. That is for the ultimate user to decide. Isn't it about the flicker of a candle? Let the ultimate user have some work to do.
  • Jon, thanks for putting up the automated Menorah code. I remember the BS1 version and look forward to trying this out. I think I've seen some electric Menorahs in Bed Bath & Beyond that could use this to control them.

    Jeff
  • Isn't it about the flicker of a candle?

    Actually, the original request was how to automate with an RTC. That person suggested he was going to purchase the DS3231 so I picked up a couple inexpensive boards from Amazon and knocked out the program.
  • Very cool! This would be cool to expand to make a Parallax Yule Log fire place insert.

    Thanks for sharing.
  • Heater.Heater. Posts: 21,230
    I do hope no one was offended by my "...put up a tree and stick some lights on it" comment. That was not intended as a slight on any ones traditions.
  • I'm not Jewish, but I found that comment insensitive, and at the very least, utterly unhelpful.
  • Heater.Heater. Posts: 21,230
    Certainly it was unhelpful. My apologies for that.

    On the plus side, I learned something new of these ancient traditions along the way.
  • JonnyMacJonnyMac Posts: 9,104
    edited 2016-12-20 18:06
    For those interested in the DS3231 used in the project, I've uploaded a tidied version of my object (with demo code) to ObEx. This also includes access to the temperature registers in the DS3231.

    -- http://obex.parallax.com/object/857

    I used this module in my test:
    -- https://www.amazon.com/gp/product/B014IYBGG0

    This include an AT24C32 EE on the board, too. Its address is preset to %111, so it doesn't conflict with the Propeller EEPROM if this board is connected to the Propeller EE buss.
  • I'm no expert but the ones I see have nine candles. Could be the difference of commercial versions and more Orthodox versions.
  • Or how about just a 8-9 candelabra to be used with seasonal events.
  • DigitalBob wrote: »
    I'm no expert but the ones I see have nine candles. Could be the difference of commercial versions and more Orthodox versions.
    DigitalBob wrote: »
    Or how about just a 8-9 candelabra to be used with seasonal events.

    See this post above.
Sign In or Register to comment.