MarkMayhew

Member Since: November 28, 2007

Country: United States

Profile

Role

Designer, Student

Organizations

Mayhew Labs, Institute of Electrical and Electronics Engineers, Audio Engineering Socieity

Spoken Languages

English, Spanish, Mandarin

Programming Languages

C, Java, Assembly

Universities

Ball State University, Purdue University

Websites

www.MayhewLabs.com

  • Product COM-10407 | about 2 years ago

    sybednar,

    I think this may have to do with the version of Arduino software. The path Nick gives may be the old library path. The current software looks for libraries inside your sketchbook folder and you add a library within a drop down menu. See if either of these pages set you up:

    http://arduino.cc/it/Reference/Libraries

    http://arduino.cc/en/Guide/Environment

    If not, you may need to look at your settings file (use caution if you do): http://arduino.cc/hu/Hacking/Preferences

  • Product COM-10407 | about 2 years ago

    Don’t worry Midknight5000, you didn’t waste your money! I’ll explain how the example code works a little and then explain how you can output to the LEDs anything you would like.

    In the example there is an array of 16 bit values that represent the on/off state of 16 LEDs (0x0 means all LEDs off, 0x2 means just the second LED on…). The rotary encoder counter indexes this array of 16 bit values. So looking at the first array, if the encoder has been rotated 3 counts, the LED output would be 0x4 (only the 3rd LED would be on). There is a scaling that happens to show how you can make the output change every 10 turns instead of 1, for example. This is not really needed for functionality.

    Now the output actually occurs (and this is where you are most interested) in these lines: shiftOut(SDI,CLK,MSBFIRST,(sequence[sequenceNumber][scaledCounter] >> 8)); shiftOut(SDI,CLK,MSBFIRST,sequence[sequenceNumber][scaledCounter]);

    Since there are 16 LEDs, we have to send two 8 bit sequences. We bit shift the high 8 bits and send them, then we send the lower 8 bits next. I think we need an an example:

    Suppose you want every 3rd LED on. This is 0b1001001001001001 (binary) = 0x9249 (hex) as seen in OSX or Windows programming calculator. 0x9249 >> 8 (shift the bits right 8 times) gives us the upper 8 LED on/off states, ie : 0b10010010 = 0x92. This is sent to the LED Ring. Then, the remaining 8 LED states are sent. We use a 16 bit value, but since the Arduino is 8 bit, the upper 8 bits (which we already sent) are disregarded. 0b01001001=0x49 is sent.

    So here is the easiest way to send anything you’d like: unsigned int myLED = 0xDB6D; //1101101101101101, 1 means LED on, 0 means LED off digitalWrite(LE,LOW); //let the LED Ring know you are talking to it shiftOut(SDI,CLK,MSBFIRST,(myLED >> 8)); shiftOut(SDI,CLK,MSBFIRST,myLED); digitalWrite(LE,HIGH); //let the LED Ring know you are done

    There is another approach that includes bitwise OR'ing that has the benefit of being able to turn on/off any single LED, regardless of the state of other LEDs. It might be better for applications that don’t output a set sequence. I can show if anyone is interested.

  • Product COM-10409 | about 3 years ago

    It’s an LDO (low drop out) linear regulator in a SOT25 or SOT23-5 package. These LDOs come in several packages ranging in size and available current output. Here is an IC that is similar to the one on the LED Ring.

  • Product DEV-09832 | about 3 years ago

    Mayhew Labs will be shipping more Mux Shields to Sparkfun early next week (Aug 22). Check back late next week or early the following week (Aug 29).

  • Product COM-10407 | about 3 years ago

    I can think of two things to check. First, check the pin names you are using in your code. The same pins may have different names on the Mega than on the Duemilanova. Second, the code that reads the rotary encoder needs to know what port the encoder is on:
    #define ENC_PORT PINB
    The port names may be different on the Mega than the Duemilanova.

  • Product DEV-09832 | about 3 years ago

    Elda -
    1. To use multiple Mux Shields, you can use the same Control lines to all three shields, but will need to use separate input lines for them (so 4 control lines, 9 input lines total). Since you are using two for digital input, you can run the outputs of these Mux Shields to digital in’s on your microcontroller, while the analog Mux Shield will need to run to analog in’s. The example code will need to have the input arrays and for loops (where the inputs are gathered) tripled. No major changes - just copy-paste, and rename!
    2. The latency is extremely small, and by this I mean that if I have a switch connected to an input, I am not able to tap the switch fast enough that the Arduino will not catch it. Of course, the latency depends on how much you have going on in your main() loop, but usually the limiting speed factor are things like serial communications. There are options like interrupts and timers that can reduce the latency to almost zero, regardless of what your main() is doing.
    Hope this helps!
    Mark

  • News - The Return to Shenzhen - … | about 3 years ago

    So do these vendors provide the datasheets for what they carry or is it what you see is what you get?

  • News - According to Pete | about 3 years ago

    The sinc function?

  • Product COM-10409 | about 3 years ago

    DClarke -
    Contact us directly and we can supply them for you. SparkFun may carry the yellow LED units in the future, but don’t currently.
    Mayhew Labs Contact

  • Product TOL-10624 | about 3 years ago

    wow… that would be a cruel gift.

No public wish lists :(