Shop OBEX P1 Docs P2 Docs Learn Events
QuickStart Candle — Parallax Forums

QuickStart Candle

CircuitsoftCircuitsoft Posts: 1,166
edited 2012-12-09 15:20 in Propeller 1
I suppose it's probably moisture sensing. Anyway, run this on a quickstart. The last LED lights up. If you blow on the button next to it, it will dim, and it may take some time for it to recover.
CON

  _XINFREQ = 5_000_000          'Propeller Processor Crystal value (5MHz)
  _CLKMODE = XTAL1 + PLL16X     'Set PLL value to X16 to get an 80MHz (5MHz x 16 = 80MHz) clock

  SensePin = 0                  'ADC INPUT pin
  DrivePin = 16                 'ADC OUTPUT pin
  
VAR


PUB CapsenseDemo | time
  outa[SensePin] := 1
  dira[SensePin] := 1
  dira[DrivePin] := 1
  cognew(@DriveLED, 0)
  repeat
    dira[SensePin] := 1
    dira[SensePin] := 0
    waitcnt(cnt+(clkfreq/500))
    
DAT       
DriveLED      org
              mov       dira,tmp

Loop          mov       tmp,ina
              shl       tmp,#16
              mov       outa,tmp
              jmp       #Loop
              
tmp           long |<16

Comments

  • idbruceidbruce Posts: 6,197
    edited 2012-12-08 23:53
    I suppose it's probably moisture sensing.

    Or perhaps it could be sensing BAC :) Sorry, Circuitsoft, I couldn't resist :)
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-12-09 12:34
    While I'm not exactly a teetotaler, I don't drink very often, so...

    So has anyone actually found this amusing, or is it just me?
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-12-09 13:02
    I'm going to give it a try. At least the moisture part. I don't drink so the BAC part I can't test. :D
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-12-09 13:13
    I had to actually lick it to get the LED to dim. :D
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-12-09 14:37
    Blow slower, and from closer. It'll build up just a tiny bit of moisture, then should brighten as it dries.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-12-09 14:39
    Yes. A long "haaaaaaa" from an inch or so works good. The same way you might try to fog a cold window with your breath. Pretty cool. Thanks for sharing.
  • xanaduxanadu Posts: 3,347
    edited 2012-12-09 14:43
    I think this is what allowed Nintendo games to work back in the day.
  • skylightskylight Posts: 1,915
    edited 2012-12-09 15:20
    [wheeze] very good Circuitsoft,[wheeze] I've got it to dim [wheeze]i'm just going to [wheeze] take a break now [wheeze] while I get [wheeze] my breath back [cough]
Sign In or Register to comment.