Show Posts
Pages: [1] 2 3 ... 12
1  Using Arduino / Displays / Re: Dot matrix "blurring" on: February 11, 2011, 12:08:26 pm

Thank you sir! That makes perfect sense. It does beg the question, though; how would this particular shift register be useful? Wouldn't almost any logic device connect to it see those ones moving by and flip some flops and so forth? Also, does the internal circuitry of the atmel chip shift data into the PORT data registers this way? (wondering if this is why my POV display had slightly ON LEDs that were supposed to be OFF). I'll check to see what we have in the lab for shift registers and change to code to handle latching. Again, thank you.

2  Using Arduino / Displays / Re: Dot matrix "blurring" on: February 10, 2011, 03:57:05 pm
The POV display used PORTD directly. If I wanted to turn on each of the 7 LEDs I would simply write: PORTD = B11111110;
The schematic on that project was as follows:

...where the gate on the n-channel mosfet was connected directly to the corresponding pin of PORTD..

I don't have a schematic for the matrix circuit, but I am simply using shiftOut() on two shift reg's which have there outputs tied to the corresponding row/column pin of this display (

I don't believe that the issue is with my code because when I use a substantial delay in my drawing function, there is not problem. The faster the program runs, the more the image blurs (eventually to the point where the entire display is solid green). Sounds electrical, but I have been wrong.
3  Using Arduino / Displays / Dot matrix "blurring" on: February 08, 2011, 10:04:37 pm
I have found in multiple instances that, when running 8 LEDs by manipulating a port (PORTD = B10101010) or using an 8-bit shift register (shiftOut), the 0's don't quite turn the LEDs off. First, I observed this when using a shift reg to run 7 LEDs in a POV display. Then in my Solid State Lighting project where I ran 7 HIGH POWER LEDs with MOSFETs and the port manipulation technique. Now I'm seeing it happen with an 8x8 matrix running from 2x74HCT164 shift reg's. Any advice?

The High Power POV project:

The current 8x8 LED matrix: Drawing a square one pixel at a time. If i remove a delay in my program, the image looks nothing like a sqaure.

4  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: byte not supported in header file??? on: September 04, 2010, 09:14:58 pm
I had the same exact problem earlier today. I just used uint8_t instead of byte. After all, uint8_t (unsigned 8-bit integer) is the same as byte. I looked everywhere through the arduino core stuff to find how the type byte is defined, but to no avail. I was hoping to find the header file needed to be included so it would work...

So just replace "byte" with "uint8_t". That worked for me.
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Function to Return a Value? on: August 14, 2010, 06:08:05 pm
Sorry for replying so late. I understand what you are saying AWOL. My function, though, was a little more involved than drhex's example. The statements in my function return either a true or a false depending on the conditions. I know I could use int and return either a 1 or a 0. I guess boolean seems more professional? More like the way it should be.. Thanks for the advice.

6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Function to Return a Value? on: August 12, 2010, 02:51:43 am
Thanks drhex. I ended up using "boolean function()..." instead. That way my if statements are more literal. if( somethingHappened() )... do this..
7  Forum 2005-2010 (read only) / Syntax & Programs / Function to Return a Value? on: August 12, 2010, 01:00:41 am
I want to make a function(or whatever) that returns a value. By that I mean I want to be able to do something like:
if(function == value) {  //or would it be "function() == value"??
   do something
I know I could just set a variable equal to something in said function, but I think this would be cleaner...

The way I would intend to make this function would be with the following syntax:
function void() {
   value returned by function generated here...
Is this possible somehow? I have no formal training with programming, but I am starting to get better. Any help would be greatly appreciated.

8  Forum 2005-2010 (read only) / Interfacing / Re: How to control the Arduino with MATLAB in realtime on: August 13, 2010, 12:48:49 am
A better question would be: how does one afford MATLAB????

[edit]Sorry.. I'm being ridiculous. :-X[/edit]
9  Forum 2005-2010 (read only) / Interfacing / works from processing to arduino but not other way on: June 20, 2010, 07:48:41 pm
I've used this method to send X & Y angles for servos from processing to the arduino over a serial connection. However, when I try to send XY angles calculated from an accelerometer to processing from the arduino I can't get it to work. I know I need to use things like ";" on processing instead of ";" on arduino. I changed those, but still can't get processing code to compile.

I want to:
Send data from arduino "Serial.write(xAngle+'x');"
And have processing get the incoming numbers and if they're followed either an 'x' or a 'y' act accordingly.
Here's the code that works on arduino but not processing:
void loop() {

  static int v = 0;

  if ( Serial.available()) {
    char ch =;

    switch(ch) {
      case '0'...'9':
        v = v * 10 + ch - '0';
      case 'x':
        servoX.write(v); //instead of servoX.write() say "xAngle = v;"
        v = 0;
      case 'y':
        servoY.write(v); //instead of servoY.write() say "yAngle = v;"
        v = 0;

The first issue is that the keyword "static" isn't allowed for some reason. Second issue it that "case '0'...'9':" won't compile. There are more issues but I'd just like to get moving in the right direction here. Any advice would be appreciated. Thanks in advance.
10  Forum 2005-2010 (read only) / Troubleshooting / Re: Why does this board not work??? on: December 15, 2010, 11:36:28 pm
The other pins are at 0V when "running" the previously mentioned code. When I power up the board with no micro the pin is at 0V. Trying the above code with a different pin yields the same result. It looks like the code isn't being run on the micro or something.
11  Forum 2005-2010 (read only) / Troubleshooting / Re: Why does this board not work??? on: December 15, 2010, 09:37:49 pm
I am using an ATMega that I programmed in my Duemelinove. It works in the development board, just not in mine. I have even tried supplying the board with regulated 5V from the USB powered dev board. Im sure it has to do with my board. Perhaps the layout of the crystal is bad?? I don't know anything about RF stuff or what the t 22pF caps do. I just know to use them.

This board runs 7 2.5W LEDs, however the micro only has to switch some N-channel MOSFETs to control the LEDs. Also, the LEDs run from a separate supply (with common ground) to prevent brown out and it exhibits the previously mentioned behavior with and WITHOUT the LEDs attached.
12  Forum 2005-2010 (read only) / Troubleshooting / Re: Why does this board not work??? on: December 14, 2010, 02:49:51 pm
I made a mistake in my original post. The "LEDs" pin 1 is connected to the digital pin 1. Therefor I only used the number '1' in my pinMode and digitalWrite. Also, what difference would it make if I used the tx pin as digital pin 1. This is in fact what it is, right? I am not using any Serial functions in the code...
void setup() {
  pinMode(1, OUTPUT);
  //digitalWrite(1, LOW); here yields the same result

void loop() {
13  Forum 2005-2010 (read only) / Troubleshooting / Re: Why does this board not work??? on: December 13, 2010, 09:09:54 pm
Here is the schematic used:

14  Forum 2005-2010 (read only) / Troubleshooting / Why does this board not work??? on: December 13, 2010, 09:06:56 pm
I designed this board for a college project. It is very simple. It is a stand alone Arduino. I soldered all of the components to the board, wired up the power supply, and it doesn't work. I have been pulling my hair out trying to troubleshoot this thing. Any help/advice would be awesome.

I supply 5V to the board and pin 1 of the "LEDs" header (digital pin 2, I think) stays at 5V. This happens with a simple program which sets the pinMode(1, OUTPUT); in setup and then digitalWrite(1, LOW); in the loop or in setup...
15  Forum 2005-2010 (read only) / Troubleshooting / Re: problem with digitalwrite?, upload works! on: August 11, 2010, 11:40:54 pm
I feel all sympathetic now  :'(

Did it work to begin with?? I hope it's not toast. It's not so bad on the 328's as you can swap the IC out. The mega's, however, are not so fortunate.

Pages: [1] 2 3 ... 12