EPsys LLC
  • Home
  • Web Hosting
  • Electronics
  • Computers
  • Apps
  • Contact
  • Technology Blog

BAM Testing

3/13/2013

0 Comments

 
I have been investigating the BAM method of LED dimming.  There are already many microcontroller programs written to control a LED or multiple LEDs with BAM, however I wanted to fully understand the method so I threw together some SPIN code to prove it would work.   Click the Read more link for details on the code.
Picture
This is the main output loop.  It reads the variable "bam" and turns the output (pin 16) on if that bit of the variable is a 1.  It repeats each bit of the variable a different number of times to keep the output on longer for the bits that represent a larger number.  By doing so it can keep the LED an practically any brightness level.

Since the propeller has multiple cogs this loop can run in a cog completely separate from the code that will calculate what value the variable needs to be to provide the proper output.

Picture
In order to test the main loop I created a simple fade in and out sequence that slowly turns the LED on, and then turns the LED off in a slightly faster manner.  

You can  download the code below.

simple_bam_test_spin_example.spin
File Size: 10 kb
File Type: spin
Download File

0 Comments



Leave a Reply.

    Author

    Jon owner
    of EPSys LLC.  

    About

    This blog covers a multitude of up and coming technology, as well as how to guides, tips and tricks, and other interesting technology related items.

    Archives

    January 2016
    December 2015
    December 2014
    September 2014
    August 2014
    October 2013
    July 2013
    June 2013
    April 2013
    March 2013
    February 2013

    Categories

    All
    Gamma
    How To
    Internet
    Javelin Stamp
    Lantern
    Microcontrollers
    Parallax
    Pc Repair
    Project
    Propeller
    Rgb Led
    Robotics
    Travel
    Web App
    Web Hosting

    RSS Feed

    Currently Reading

    Nothing Like it in the World: The Men Who Built the Transcontinental Railroad, 1863-1869
    Moonraker
Website by EPSys LLC
  • Home
  • Web Hosting
  • Electronics
  • Computers
  • Apps
  • Contact
  • Technology Blog
✕