Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / Re: storing values on: June 25, 2013, 04:53:15 pm
thank you
2  Using Arduino / Programming Questions / storing values on: June 25, 2013, 04:17:12 pm
Hello I just want to know how can i save a hexadecimal value for instance 0x0D in a variable?
3  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing to Arduino, mistakes while transfering data on: March 14, 2013, 02:30:37 am
the code

arduino
Code:
byte recieve;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if(Serial.available() > 0 )
  {
    recieve=Serial.read();
    delay(50);
    Serial.write(recieve);   
  }


processing

Code:
import processing.serial.*;
int val;
Serial myPort;
int send=234;

    void setup()
    {
      String arduinoPort = Serial.list()[0];       
       myPort = new Serial(this, arduinoPort, 9600);
       myPort.write(2);
    }
   
    void draw()
    {
     myPort.write(send);
     print("sent ");
     println(send);
     delay(50);
     val = myPort.read();
     print("recieved ");
     println(val);
    }
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing to Arduino, mistakes while transfering data on: March 13, 2013, 06:25:47 pm
PaulS I are right I didnt pay enough attention on this effect that serial monitor can cause. Good that you mentioned it, somehow I forgot it.

Quote
But how can I know then whether the data is sent correct or not, if I' can't open the Serial monitor?
You have to find another way. Say a software serial emulator with a TTL level USB interface.
-> no idea about it

Quote
Or echo back what you recieve and use processing to see what is recieved, it should be the same as what you sent.
-> just did it, the result you can see beneath

Processing said:

Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
RXTX Warning:  Removing stale lock file. /var/lock/LK.012.011.028
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved -1
sent 234
recieved 234
sent 234
recieved 234
sent 234
recieved 234
sent 234
recieved 234
sent 234
recieved 234


Well the first recieved data I can't explain why, normaly when there is no data sent back it returns -1. But after a while it became more stable.
5  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing to Arduino, mistakes while transfering data on: March 13, 2013, 05:41:02 pm
well, I do all this on Mac and you are probably right. But how can I know then whether the data is sent correct or not, if I' can't open the Serial monitor?

I was allready thinking about the processing program. I think it doesn't depend on it, because I use the newest one. And also don't need a library for communication with arduino, it's in processing implemented.

Should I try asking people on Processing Forum?! I dont know, seems to me that is a hardware issue. hm?!
6  Using Arduino / Interfacing w/ Software on the Computer / Processing to Arduino, mistakes while transfering data on: March 13, 2013, 05:01:12 pm
Hello everyone, I allready tried to send data from processing to arduino. The problem is that not all numbers arrive at arduino.

I see this Serial Monitor
Quote
2234
42
42
242
2242
4
2
4
instead of every line repeating 234

My arduino code

Code:
byte recieve;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if(Serial.available() > 0 )
  {
    recieve=Serial.read();
   
    Serial.println(recieve);   
  }
}


my processing code

Code:
import processing.serial.*;
Serial myPort;
int send=234,;

    void setup()
    {
      String arduinoPort = Serial.list()[0];       
       myPort = new Serial(this, arduinoPort, 9600);
       myPort.write(2);
    }
   
    void draw()
    {
     myPort.write(send);
     print("sent ");
     println(send);
     delay(2000);
    }

Thanks

P.S. I know that I can only send from Processing to Arduino 8byte on data. 234<255.

 I have some doubts about it. It seems to me that arduino dont get the data because of some reasons. 
The one is maybe the cable issue, contact or the length of it ??? I allready tried with another one, doesnt work

another ideas?


2nd p.s. the strange thing is if i send data from arduino to processing it works perfectly
7  Using Arduino / LEDs and Multiplexing / Re: Shiftregister,PWM and RGB LED I need help on: July 29, 2012, 03:19:39 am
I have RGB LEDs with common anode. Every color needs max. 20mA. Thats totally 60mA.

My though was I use 5 TLC5940. They just switch on or off the connection to the common anode of a RGB LED. Then I connect all the pins which stands for the same color at collector pin of my trasistor. So it's totally 3 transistors.

The idea seems to be good. But unfortunatelly TLC 5940 is designed for current sink. I fully understand you.

MAX7219 seems to be a good solution. It has only 8 bit and they are expensive 11€ or 9$ (sparksfun) too.They are more expensive than TLC smiley-sad .  As result I need 10 of them ->90 $, thats hurts really. Do you have something alternative?

UDN2981A seems to match as well, but it needs 15 Vin.
http://www.datasheetcatalog.org/datasheet/allegromicrosystems/2981.pdf

I am starting to doubt about the whole project.



8  Using Arduino / LEDs and Multiplexing / Re: Fading LEDs on Analog pins on: July 28, 2012, 03:47:55 pm
here is a good explanation

http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
9  Using Arduino / LEDs and Multiplexing / Re: Shiftregister,PWM and RGB LED I need help on: July 28, 2012, 03:23:55 pm
First of all lets talk about the pins. Well,  driving transistors thru the analog pins is a good idea. I read in the documentation of the TLC5940 that I only need 3 pins SIN, SCLK and XLAT. TLC 5940 library use 5 pins. Can I reduce it. I don't need the pwm stuff on my tlc IC.

http://www.ti.com/lit/ds/symlink/tlc5940.pdf (Page 12)

funkyguy4000 what I meant with the first question is: do you know a good "amplification" IC (sorry I don't know how they are called)?
Which I can attach in addition to my tlc5940? ULN... I don't know which one. The one criteria is: it should output current more than 60 mA per pin. Is it possible ?

thanks



p.s. funkyguy I found what you meant
http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
10  Using Arduino / Networking, Protocols, and Devices / Re: Weird stuff in the TLC5940 library on: July 28, 2012, 03:10:04 pm
but what about 23?
11  Using Arduino / Networking, Protocols, and Devices / Weird stuff in the TLC5940 library on: July 28, 2012, 01:27:22 pm
Hello everyone.

I have found some differences between the wiring scheme
http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png

and the description in the arduino TLC5940 library. Please pay attention on the connection where +5 V come in

Code:
    Basic Pin setup:
                        ------------                                     ---u----
    ARDUINO   13|-> SCLK (pin 25)                 OUT1 |1     28| OUT channel 0
                    12|                                         OUT2 |2     27|-> GND (VPRG)
                    11|-> SIN (pin 26)                    OUT3 |3     26|-> SIN (pin 11)
                    10|-> BLANK (pin 23)               OUT4 |4     25|-> SCLK (pin 13)
                      9|-> XLAT (pin 24)                       .  |5     24|-> XLAT (pin 9)
                      8|                                               .  |6     23|-> BLANK (pin 10)
                      7|                                               .  |7     22|-> GND
                      6|                                               .  |8     21|-> VCC (+5V)
                      5|                                               .  |9     20|-> 2K Resistor -> GND
                      4|                                               .  |10    19|-> +5V (DCPRG)
                      3|-> GSCLK (pin 18)                     .  |11    18|-> GSCLK (pin 3)
                      2|                                               .  |12    17|-> SOUT
                      1|                                               .  |13    16|-> XERR
                      0|                                         OUT14|14    15| OUT channel 15
                         ------------                                  --------

    -  Put the longer leg (anode) of the LEDs in the +5V and the shorter leg
         (cathode) in OUT(0-15).
    -  +5V from Arduino -> TLC pin 21 and 19     (VCC and DCPRG)
    -  GND from Arduino -> TLC pin 22 and 27     (GND and VPRG)
    -  digital 3        -> TLC pin 18            (GSCLK)
    -  digital 9        -> TLC pin 24            (XLAT)
    -  digital 10       -> TLC pin 23            (BLANK)
    -  digital 11       -> TLC pin 26            (SIN)
    -  digital 13       -> TLC pin 25            (SCLK)

12  Using Arduino / LEDs and Multiplexing / Re: Shiftregister,PWM and RGB LED I need help on: July 28, 2012, 10:41:22 am
thank you very much for the links and the video, which is really helpful. I 'm sorry, I didn't mention that I used for 74HC595 additionally some transistors.

This brings me to a new question. this guy used for the columns a ULN... IC, which works as an "amplifier". I would also buy some, that can work finally with 60 mA per pin.  I know that it consumes a lot of current, but in case of wrong coding, I would have some free space for mistakes. Any advice?

And finally an additional question. I already connected my arduino with TLC5940. I took a look on my arduino uno and I noticed that this connection left only 2 pwm pins over. I need 3 pwm pins to control 3 trasistors. (every transistor controls only one color).

There are two options. 1) Buy an arduino mega. (I don't need it know, mayne a bit later)
                                   2) Redefine the pins which TLC5940 library needs. is it possible?
do you have any other options?


13  Using Arduino / Networking, Protocols, and Devices / Re: Modify SPI on: July 28, 2012, 06:57:47 am
that is perfect. thank you very much
14  Using Arduino / LEDs and Multiplexing / Re: Shiftregister,PWM and RGB LED I need help on: July 28, 2012, 05:00:55 am
To be honest I'm not sure about the right IC. On the one hand the TLC5940 seems to be a good one,but on the other hand it has it's own "illness"

look here
http://effluviaofascatteredmind.blogspot.de/2012/05/tlc5940-tlc5941-and-arduino.html
http://e2e.ti.com/support/power_management/led_driverslcd_bias/f/192/t/85711.aspx

Also a negative aspect is, you can't use SPI library, tlc5940 needs it's own. Additionally the current limitation goes only up to 130mA is not enough.

If I devide 130mA by 16 outputs, I receive 8,125mA per each output. Normally if you just write at only one channel while the other are still off you can consume more current. But I want have some free space for mistakes, because I'm not perfect in C++. (Note I use RGB LED with common anode which need up to 60mA (20mA for each color) ). If turn on all RGB LED accidentally it becomes damaged.


I saw a modification of 74HC595. It's current limitation goes up to 500mA. But the problem is
Quote
They [the chip] cannot source current so they should be connected to LED cathodes. This makes them ideal for use with LED matrices where you end up sinking 8 or more LEDs at once.

http://www.adafruit.com/products/457
http://www.adafruit.com/datasheets/tpic6b595.pdf

Are there other alternative ICs?


P.S. I'm not sure about the wiring of tlc5940
http://tlc5940arduino.googlecode.com/svn/wiki/images/breadboard-arduino-tlc5940_close.png

I read that some people used decoupling caps. Do they have any sense?
15  Using Arduino / Networking, Protocols, and Devices / Re: Modify SPI on: July 28, 2012, 04:38:32 am
And how can I send to 5   16-bit ICs? I'm sorry for this silly question, but I'm not familiar with SPI. thanks
Pages: [1] 2 3