Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 22, 2012, 12:10:15 pm
This is a better display in serial monitor. I also put the whole number back together "H = (E*100)+(F*10)+G

Code:
void setup(){
  Serial.begin(9600);
 
}
int A = 0;
int B = 0;
int C = 0;
int D = 0;
int E = 0;
int F = 0;
int G = 0;
int H = 0;
void loop(){
 
 Serial.println("     ");
  Serial.print("    A ");
 Serial.print(A);
  Serial.print("    B ");
  Serial.print(B);
  Serial.print("    C ");
  Serial.print(C);
   Serial.print("    D ");
   Serial.print(D);
   Serial.print("    E ");
   Serial.print(E);
   Serial.print("    F ");
   Serial.print(F);
   Serial.print("    G ");
   Serial.print(G);
   Serial.print("    H ");
   Serial.print(H);
 
  A ++;
  delay (500);
 
  B = A %100;
  C = A %10;
  D = A %1;
  E = (A - B) * .01;
  F = (B - C) * .1;
  G = C - D;
  H = (E * 100) + (F * 10) + G;
 }
2  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 22, 2012, 11:43:25 am
Mike, Thanks so much, Not sure I got it coded right, but this works.

Code:
void setup(){
  Serial.begin(9600);
 
}
int A = 0;
int B = 0;
int C = 0;
int D = 0;
int E = 0;
int F = 0;
int G = 0;

void loop(){
 
 Serial.println("     ");
  Serial.print("  A   ");
 Serial.print(A);
  Serial.print("  B   ");
  Serial.print(B);
  Serial.print("   C  ");
  Serial.print(C);
   Serial.print("  D   ");
   Serial.print(D);
   Serial.print("  E   ");
   Serial.print(E);
   Serial.print("  F   ");
   Serial.print(F);
   Serial.print("  G   ");
   Serial.print(G);
 
  A ++;
  delay (500);
 
  B = A %100;
  C = A %10;
  D = A %1;
  E = (A - B) * .01;
  F = (B - C) * .1;
  G = C - D;
 /code]
3  General Category / General Discussion / Re: How do I view replies on: November 22, 2012, 10:35:17 am
Thanks so much. profile/show post is what i was needing.
4  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 22, 2012, 01:17:35 am
I done something like A = 375 rounded down to the nearest hundreds =300 B =375 - 300 =75 rounded to the nearest tens = 70 and C= 75 - 70 = 5     A=3 B=7 C=5 in excel but not sure hoy to do it with arduino.

Thanks in advance
5  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 22, 2012, 01:04:06 am
Not sure on how to word it, but I guess what I'm looking for is how to separate the ones place, tens place and hundreds place. this is not going to be worded right but if for say "Num = Count++" and "A= ones place of Num",         "B= Tens place of Num" and "C= Hundreds place of Num"
6  General Category / General Discussion / Re: How do I view replies on: November 22, 2012, 12:40:20 am
the problem there is amost 1000 post. Thats a lot to search through to find the the ones you have viewed already. if I click replies and some one has replied to a post then I can see it but once I have viewed it, it will not show up in replies until some one replies again.
7  General Category / General Discussion / How do I view replies on: November 21, 2012, 11:55:15 pm
How do I view replies that I have already viewed on this forum other than waiting for someone to post a new reply
8  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 21, 2012, 07:05:38 pm
Mike, the code I've been working on is for three seven segments displayed on a TFT LCD display but its pretty lengthy. What is the best way to write the to code for the firth 7 segment display to count 0 to 9 then add 1 to the second 7 segment display and after it counts 0to 9 and then add 1 to the third 7 segment display and so on.

another words, some type of shift register code that will count pulses for the first digit then generate a pulse after 10 pulses for the second digit and so on for the third digit. (ones place, tens place and hundreds place).
9  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 21, 2012, 04:09:48 pm
Grumpy Mike, Thanks for the link, this looks like it will shorten up my supper long code.
10  Using Arduino / Programming Questions / Re: I don't understand this simple code on: November 21, 2012, 12:08:49 am
Not sure but think it takes the last stored "time" and monitors the current "time' and subtracts the last stored "time" from the current "time" and if it is more than 500 milliseconds then it stores the new current "time" as the new last "time" and adds one count to the brightness. By using millis (milliseconds) it allows the program to continue to keep looping so other codes can keep being processed. if delay is used it stops every thing else from being processed until the delay has reached the end time.
11  Using Arduino / Programming Questions / Re: Tlc5940 7 Segment on: November 20, 2012, 11:45:58 pm
I'm doing something similar. I tried use a clear code but it caused flicker, because each time the program loops it turns off the segments that would stay on for the case statement and back on. The way Grumpy Mike is talking about leaves the segments that need to be on and the ones that need to be off to stay in that state until the switch case changes.

To Grumpy Mike, I am looking for a better way to display 7 segments any links to code would be appreciated
12  Using Arduino / Programming Questions / Re: FastWrite for Mega 2560 on: November 20, 2012, 11:08:35 pm
Did you select the Mega 2560 as the board in tools/board?
13  Using Arduino / Programming Questions / Re: writing arduino library on: November 20, 2012, 08:25:20 pm
Thanks Tuxduino, You help out a lot just with the word "tab". This I can see lets you work on the sketch and name it for example "ABC" then create a tab and name it ABCh for the header code and ABCcpp for the sourse code and save it in libraries. then open the ABC folder and change the name of the the file ABCh.ino to ABC.h and ABCcpp.ino to ABC.cpp. At least this is what I had to do to get it to import to a new sketch on iMac. the cool thing about using the create a tab is its all in one folder.

Just a little info about Me. I an a newbie at Arduino. Two weeks ago I was looking for something I could control with a computer for example, turn a light on and off and was introduced to "Arduino" and so for I like it. So I will be the guy "for now" that if you ask me to walk to the store and get a piece of candy, you might have to teach me how to "walk" first before I can get there. I'm sure i will have plenty of questions that have simple answers but I a sure you, it will be appreciated.


It took a someone to invent a switch and someone else to take two of them and make the and/or gate circuit that led to the electronics we have today.
14  Using Arduino / Programming Questions / Re: writing arduino library on: November 18, 2012, 10:46:06 pm
The library tutorial link was great at teaching writing the .h and .cpp sketch but when I saved it as Morse.h and Morse.cpp and put it in documents/arduino/libraries and restarted arduino it would not show up in sketch/import libraries and if I go to documents/arduino/libraries/Morse it shows up as Morse_h.ino and Morse_cpp.ino. But I figured out how to manually rename it to Morse.h and Morse.cpp and now it shows up and works.

I'm new to using iMac and I guess I'm use to clicking save as then clicking a file type drop down box and selecting a file type in Windows
 
Again thanks for the replies
15  Using Arduino / Programming Questions / Re: writing arduino library on: November 18, 2012, 08:55:00 pm
Thanks for the help, but I worded it wrong. what I needed to know was, are the libraries written in the arduino sketch and ifs so how to save it as a library. I got it to work finally by saving the 2 arduino sketches "ABC1 and ABC2" then going to documents and opining them and cut/pasted them in a new folder named ABC into the documents/arduino/libraries and then open the ABC (folder)/ABC1.ino andABC2.ino and changing ABC1.ino to ABC.h for the header and ABC2.ino to ABC.cpp for the source. I never found anything on the web that gave a clear way to do this. Is their an easier way to save these files as .h and .cpp on an iMac lion oxs
Pages: [1] 2