Show Posts
Pages: [1] 2
1  Development / Other Hardware Development / Re: Arduino Pin Duplicator on: October 07, 2012, 12:02:59 am
Now solve how you can stack two shield boards to an arduino where each must be the top shield, say like yours and another that was a nice LCD display.  smiley-wink

Lefty

Somebody already did.
http://shieldlist.org/liquidware/double-wide
2  Development / Other Hardware Development / Arduino Pin Duplicator on: October 06, 2012, 11:21:30 pm
Has anyone ever run into this problem? You have a top level shield such as Sparkfun's MIDI Shield with the short headers, but you want to have access to the unused pins on the Arduino:


I now know that I should have put female headers on this, but I've had bad experiences de-soldering and re-soldering parts on PCBs. Things tend not to work afterwards...

I bought and  soldered together two sets of female headers at right angles  and clip the leads on one side:


Problem solved for $3.00 USD!
3  Development / Suggestions for the Arduino Project / Re: More customizable IDE? on: March 09, 2011, 08:58:36 pm
I've solved the problem by just using Notepad++ and copy-paste into the Arduino editor when I want to debug, compile and upload.
4  Using Arduino / Programming Questions / Re: noob can't exit a loop on: March 04, 2011, 09:50:06 pm
Wow! I missed that too, and I have an associate's degree in business computer programming. I getting rusty...

Of course, in my defense, I'm a complete noob when it comes to C.
5  Using Arduino / Programming Questions / Re: #include syntax question on: March 03, 2011, 01:06:20 am
Thank you! I searched but I didn't find this. This is just what I was looking for!
6  Using Arduino / Programming Questions / Re: noob can't exit a loop on: March 03, 2011, 12:32:26 am
Not exactly sure, but I'm surprised the compiler didn't catch the extra curly brace at the end... that might be the problem.

Code:
//Fade an LED in and out like on a sleeping Apple computer

#define LED 11 //the pin for the LED
#define Button 8

int ButtonState = 0;
 
int i = 0; //We'll se this to count up and down

void setup() {
  pinMode(LED, OUTPUT); //tell Arduino LED is an output
  pinMode(Button, INPUT);
}
void loop()
  {
    ButtonState = digitalRead(Button);
 
    if (ButtonState == HIGH)
      {
        analogWrite(LED, 225); //starts initial rapid blink
        delay(50);
        analogWrite(LED, 0);
        delay(50);
        analogWrite(LED, 225);
        delay(50);
        analogWrite(LED, 0);
        delay(50); //end rapid blink
      }//neamerjell: end if
   
  //start pulse
    while(ButtonState == HIGH)
    {
      for (i = 0; i < 255;i++) //loop from 0 to 254(fade in)
        {
          analogWrite(LED, i); //set the LED brightness
          delay(10);
        }//neamerjell: end for
 
     delay(1000); //stay full bright for 1 sec
     for (i = 255; i > 0; i--)  //loop from 255 to 1 (fade out)
        {
         analogWrite(LED, i); //set the LED brightness
         delay(10);
        }//neamerjell: end for
      delay(1000); //stay full off for 1 sec
    }//neamerjell: end while
  }//neamerjell: end of void loop()
}//neamerjell: extra, no matching opening curly brace
7  Using Arduino / Programming Questions / #include syntax question on: March 03, 2011, 12:17:51 am
What is the difference, if any between

#include "Charliplexing.h"

and

#include <Charliplexing.h>

both seem to work just fine. Some files use the quotation marks, and others use the less than and greater than signs. Does using one over the other change the meaning or does the compiler simply support both methods?
8  Using Arduino / LEDs and Multiplexing / Re: Understanding the LoL Shield Library on: March 02, 2011, 11:30:38 pm
I recently saw the video at and downloaded the zip file that ikkei3 posted in the comments.

http://web.mac.com/kxm_ikkei/Si­te/LoL_files/LoL_Shield-100913­.zip

Upon examining his version of Font.cpp, I found that he had created a character set based on columns, not rows like in the example included with the library.

I also went through the code and figured out just what everything did and made clear comments about what was going on. It's too big to put in a code block here so here is a link to my edited version:

Font.cpp
9  Using Arduino / LEDs and Multiplexing / Re: Understanding the LoL Shield Library on: March 02, 2011, 01:39:20 am
I made bitmap style arrays for the characters and was able to display each character in sequence after some bug hunting. I think I may have stumbled on the reason why the original author could not store both upper case and lowercase letters in his array; I tried to put all 93 characters into one array and got garbage when I tried to display each character in sequence. I did the math, each array element is 9 bytes long and there are 93 (94 if you count a space, ASCII 32) elements. 94 x 9 = 846, just under 1KB.

I split the array up into letters, numbers and symbols, and it worked fine. Go figure.

Here are the array declarations if you care to use them. I took the characters from the character map of a CrystalFontz 634, 4x20 character LCD screen. Each character is 5 pixels wide by 7 pixels tall.

My next task is to string the characters together somehow and then use the bitmap display function to scroll text across the LoL shield.

Code:
/*
Putting all the characters together in one array causes garbage to
appear on the screen at random when attempting to display each
character in sequence.
*/

/*
//uint16_t letters[] [9] = {
uint16_t BitMap[][9] = {
{0,14,17,17,17,31,17,17,0}, //65, A
{0,15,17,17,15,17,17,15,0}, //66, B
{0,14,17,1,1,1,17,14,0}, //67, C
{0,7,9,17,17,17,9,7,0}, //68, D
{0,31,1,1,15,1,1,31,0}, //69, E
{0,31,1,1,15,1,1,1,0}, //70, F
{0,14,17,1,29,17,17,30,0},         //71, G
{0,17,17,17,31,17,17,17,0}, //72, H
{0,14,4,4,4,4,4,14,0}, //73, I
{0,28,8,8,8,8,9,6,0}, //74, J
{0,17,9,5,3,5,9,17,0}, //75, K
{0,1,1,1,1,1,1,31,0}, //76, L
{0,17,27,21,17,17,17,17,0}, //77, M
{0,17,17,19,21,25,17,17,0}, //78, N
{0,14,17,17,17,17,17,14,0}, //79, O
{0,15,17,17,15,1,1,1,0}, //80, P
{0,14,17,17,17,21,9,22,0},         //81, Q
{0,15,17,17,15,5,9,17,0}, //82, R
{0,30,1,1,14,16,16,15,0}, //83, S
{0,31,4,4,4,4,4,4,0}, //84, T
{0,17,17,17,17,17,17,14,0}, //85, U
{0,17,17,17,17,17,10,4,0},         //86, V
{0,17,17,17,21,21,21,10,0}, //87, W
{0,17,17,10,4,10,17,17,0},         //88, X
{0,17,17,17,10,4,4,4,0}, //89, Y
{0,31,16,8,14,2,1,31,0}, //90, Z
{0,0,0,14,16,30,17,30,0}, //97,  a
{0,1,1,13,19,17,17,15,0}, //98,  b
{0,0,0,14,1,1,17,14,0}, //99,  c
{0,16,16,22,25,17,17,30,0}, //100, d
{0,0,0,14,17,31,1,14,0}, //101, e
{0,12,18,2,7,2,2,2,0}, //102, f
{0,0,30,17,17,30,16,14,0},         //103, g
{0,1,1,13,19,17,17,17,0}, //104, h
{0,4,0,6,4,4,4,14,0}, //105, i
{0,8,0,12,8,8,9,6,0}, //106, j
{0,1,1,9,5,3,5,9,0}, //107, k
{0,6,4,4,4,4,4,14,0}, //108, l
{0,0,0,10,21,21,21,21,0}, //109, m
{0,0,0,13,19,17,17,17,0}, //110, n
{0,0,0,14,17,17,17,14,0}, //111, o
{0,0,0,15,17,15,1,1,0}, //112, p
{0,0,0,14,9,14,8,24,0}, //113, q
{0,0,0,13,19,1,1,1,0}, //114, r
{0,0,0,14,1,14,16,15,0}, //115, s
{0,2,2,7,2,2,18,12,0}, //116, t
{0,0,0,17,17,17,25,22,0}, //117, u
{0,0,0,17,17,17,10,4,0}, //118, v
{0,0,0,17,17,21,21,10,0}, //119, w
{0,0,0,17,10,4,10,17,0}, //120, x
{0,0,0,17,17,30,16,14,0}, //121, y
{0,0,0,31,8,4,2,31,0}, //122, z
{18000}
};
*/

/*
uint16_t numbers [][9] = {
//uint16_t BitMap[][9] = {
{0,14,17,25,21,19,17,14,0}, //48, 0
{0,4,6,4,4,4,4,14,0}, //49, 1
{0,14,17,16,8,4,2,31,0}, //50, 2
{0,31,8,4,8,16,17,14,0}, //51, 3
{0,8,12,10,9,31,8,8,0}, //52, 4
{0,31,1,15,16,16,17,14,0},      //53, 5
{0,12,2,1,15,17,17,14,0}, //54, 6
{0,31,16,8,4,2,2,2,0}, //55, 7
{0,14,17,17,14,17,17,14,0}, //56, 8
{0,14,17,17,30,16,8,6,0}, //57, 9
{18000}
};
*/

//uint16_t symbols [][9] = {
uint16_t BitMap[][9] = {
{0,4,4,4,4,4,0,4,0}, //33, !
{0,10,10,10,0,0,0,0,0}, //34, "
{0,10,10,31,10,31,10,10,0}, //35, #
{0,4,30,5,14,20,15,4,0}, //36, $
{0,3,19,8,4,2,25,24,0}, //37, %
{0,6,9,5,2,21,9,22,0}, //38, &
{0,6,4,2,0,0,0,0,0}, //39, '
{0,8,4,2,2,2,4,8,0}, //40, (
{0,2,4,8,8,8,4,2,0}, //41, )
{0,0,4,21,14,21,4,0,0}, //42, *
{0,4,4,31,4,4,0,0,0}, //43, +
{0,0,0,0,6,4,2,0,0}, //44, ,
{0,0,0,0,31,0,0,0,0}, //45, -
{0,0,0,0,0,0,6,6,0}, //46, .
{0,0,16,8,4,2,1,0,0}, //47, /
{0,6,6,0,6,6,0,0,0}, //58, :
{0,6,6,0,6,4,2,0,0}, //59, ;
{0,8,4,2,1,2,4,8,0}, //60, <
{0,0,31,0,31,0,0,0,0}, //61, =
{0,2,4,8,16,8,4,2,0}, //62, >
{0,14,17,16,8,4,0,4,0}, //63, ?
{0,14,17,25,21,29,1,14,0},         //64, @
{0,14,2,2,2,2,2,14,0}, //91, [
{0,0,1,2,4,8,16,0,0}, //92, backslash,
//putting in an actual backslash character in this comment prevents
//the next character from showing
{0,14,8,8,8,8,8,14,0}, //93, ]
{0,4,10,17,0,0,0,0,0}, //94, ^
{0,0,0,0,0,0,0,31,0}, //95, _
{0,2,4,8,8,0,0,0,0}, //96, `
{0,8,4,4,2,4,4,8,0}, //123, {
{0,4,4,4,0,4,4,4,0}, //124, |
{0,2,4,4,8,4,4,2,0}, //125, }
{0,0,2,21,8,0,0,0,0}, //126, ~
{18000}
};
10  Using Arduino / LEDs and Multiplexing / Understanding the LoL Shield Library on: March 01, 2011, 11:01:45 pm
After much poking through lots of code (aptly named as it definitely required deciphering), I am finally beginning to understand what is being done by this obscure collection of alien writing (aka bit-wise operators).

Code:
if (data==18000){
        run=false;
      }
     
      //This is where the bit-shifting happens to pull out
      //each LED from a row. If the bit is 1, then the LED
      //is turned on, otherwise it is turned off.
      else for (byte led=0; led<14; ++led) {
        if (data & (1<<led)) {
          LedSign::Set(led, line, 1);
        }
        else {
          LedSign::Set(led, line, 0);
        }
/*
after reading http://www.arduino.cc/playground/Code/BitMath#bit_pack, the line
"if (data & (1<<led)) {" finally makes sense;
shift the binary value 1 to the left by the number of spaces stored in the variable
"led"
then perform a bitwise AND on that value and "data"
if both that position in "data" and the shifted binary value are 1, then it returns true
and sets the LED at the column "led" and the row "line" to 1 or on

the shifted binary value acts as a selection pointer to the binary value stored
in the variable "data"
*/
      }

    }

Again, the link that demystified that one obscure line of code was
http://www.arduino.cc/playground/Code/BitMath#bit_pack

I liken my experience to that of a chimpanzee examining a hand-crank style egg beater, wondering what practical use it could possibly have been made for. However, my "Aha! moment" was priceless! What was once obscure and convoluted has been revealed to be elegant, but I still can't honestly say simple...

Using my new found knowledge, I intend to rework the Font subset of the library, which currently supports only uppercase letters and a few symbols. My version will include 95 characters from ASCII 32 to 126. I will post updates on my progress.
11  Using Arduino / Programming Questions / Re: LoLShield library on: March 01, 2011, 01:58:32 am
I just bought an LOLShield myself, and before it even arrived in the mail, I dove headfirst into the code, trying to understand it.

Here is what I have so far:

LedSign::Init() does what it says, sets things up to work, like hardware timers.

The two colons are the syntax for referring to a piece of a namespace. A namespace is a device in the C language to group classes together, like putting a bunch of similar tools into a box. I had to look this up to find out what it was, as I am new to the more obscure aspects of the C language.

LedSign::Set(<col, 0 to 13>, <row 0 to 8>, <state 0 or 1>) sets the state, 1 = on , 0=off of an led at a row or column. The rows and columns are counted from zero, like an array, and start from the top, left corner (while attached to the Arduino, the top-left corner will be just above the USB jack).

LedSign::Clear(<set 1 or 0>) clears the board, setting all LEDs to 0 (off) or 1 (on)

LedSign::Horizontal(<row 0 to 8>, <set 0 or 1>) sets a whole row on or off

LedSign::Vertical(<col 0 to 13>, <set 0 or 1>) sets a whole column on or off

LedSign::Flip(<blocking true or false>) I honestly have no clue what this does, I put it in code with both true and false values and saw no change. It is used inside of the Init() routine, though.



12  Using Arduino / General Electronics / Re: Identification of harvested components on: February 24, 2011, 09:59:07 pm
Could be, or they could have just given it to Goodwill because they bought an MP3 player...

Either way, I won't be using the harvested components for anything mission critical.
13  Using Arduino / General Electronics / Re: Identification of harvested components on: February 24, 2011, 02:39:16 am
Wow, thanks! I have no idea what I will do with these parts, but at least I now know what they are.

I swear this tape player was a gold mine of capacitors and transistors! I probably scored $50 in parts if they were new in packages!

PS: I didn't think it was an inductor because the symbol didn't exactly match what Google image search brought up (I typed in this: inductor schematic symbol). So I wasn't sure what it was.
14  Using Arduino / General Electronics / Identification of harvested components on: February 24, 2011, 12:08:21 am
I bought an old Fischer tape deck from Goodwill for $8 and I'm desoldering components from the circuit board for use in projects so I don't have to go out and buy components at high prices in comparison to $8 for an all you can eat buffet of capacitors, transistors, resistors, etc.

I'm able to identify the resistors and capacitors, they are clearly marked, and I have a resistor color code cheat sheet printed out. I've also identified some ICs as audio amplifiers. I have found that I can identify the transistors as well.

What about diodes? The only markings I can see are D, 8J, and 135. I typed these into Google as D8J135, 8J135D, and 135D8J with no results. It is black with a grey stripe and lettering.

Another pink glass diode I was able to identify as a Zener diode.

I also found these blue cylinders, plastic outer casing, with a schematic symbol on the circuit board that looks like a symbol for a lamp, but it is not enclosed in a circle.  It just looks like a curled loop symbol. I looked up inductors, but it is not an inductor.

I also found this green box with a screw top. The top can be unscrewed all the way, revealing a center post thing. I have no clue what this is. A variable capacitor, maybe?


Here is a pic of all components, the symbol of the blue cylinder, and three views of the green box thing:


Anybody know what the blue and green things are or what kind of diode that is?
15  Community / Exhibition / Gallery / Arduino workstation on: February 23, 2011, 07:19:45 pm
I've seen backplates on Sparkfun that can accommodate an Arduino and a small breadboard, but I have a full size breadboard. So, I made my own out of Medium Density Fiberboard (commonly abbreviated as MDF) and about $6 worth of parts and hardware.

The breadboard I have came from Radio Shack (yes, I know I paid way too much for it) and is mounted to a thin metal plate, possibly aluminum. I drilled two holes in the metal plate with a drill press at low speed.

I bought a small project box from Radio Shack to house a 9v battery which I equipped with a header from Sparkfun. I drilled holes in the bottom and the side of this, also with the drill press at low speed.

I placed the breadboard, project box, and the Arduino board on the MDF and marked and drilled all the holes. I had to go back to Home Depot to get 4-40 screws to mount the Arduino as the 8-32 screws were too big.

I put the screws in and mounted everything, using additional nuts as spacers for the Arduino board. The MDF did not take well to self tapping screws, so I ended up gluing the rubber feet on with super glue (cyanoacrylate). I scored the MDF and the rubber feet so the glue would hold.

And now the pics: (I've swapped the image hosting to ImageShack, click the thumbnails to enlarge the images)

Front:


Back:


Close up of nuts used as spacers:


Up and running:
Pages: [1] 2