0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« on: February 16, 2011, 05:54:58 pm » |
Hi!
i have a led display banner. I used windows software and i write some letter but i wanna edit it with arduino...
How can i send ascii data with TX pin to display banner?
I have to send 255, 254, 0, 100, 200, 95, 1, 1, 200, 43, 10, 1, 77, 117, 115, 108, 117, 32, 89, 252, 107, 115, 101, 107, 116, 101, 112, 101, 200, 253 code to banner.
I write:
#include <SoftwareSerial.h> #define rxPin 0 #define txPin 1
SoftwareSerial swSerial = SoftwareSerial(rxPin, txPin);
void setup() { pinMode(rxPin, INPUT); pinMode(txPin, OUTPUT);
swSerial.begin(19200); char sounds[] = {255, 254, 0, 100, 200, 95, 1, 1, 200, 43, 10, 1, 77, 117, 115, 108, 117, 32, 89, 252, 107, 115, 101, 107, 116, 101, 112, 101, 200, 253}; Serial.print(sounds); delay(10); }
void loop() {
}
its accepted this code but never changed...
|
|
|
|
|
Logged
|
|
|
|
|
United States (Texas)
Offline
God Member
Karma: 2
Posts: 525
Arduino socks
|
 |
« Reply #1 on: February 16, 2011, 07:14:13 pm » |
try this char sounds[] = {255, 254, 0, 100, 200, 95, 1, 1, 200, 43, 10, 1, 77, 117, 115, 108, 117, 32, 89, 252, 107, 115, 101, 107, 116, 101, 112, 101, 200, 253}; void setup() { Serial.begin(19200);
for(int i = 0; i <=30;i++) { Serial.print(sounds[i],BYTE); } }
void loop() {
}
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #2 on: February 22, 2011, 08:01:54 am » |
ok will try tonight
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #3 on: February 22, 2011, 11:51:40 am » |
You will need a value delimiter if all the values are going to be different lenghts. Serial.print(sounds[i],BYTE); Serial.print(','); ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #4 on: February 23, 2011, 05:32:57 pm » |
i programmed with vb6. its working but when isend this ascii code its not working.
VB6 code:
ComPort = 1 ComDelay = 20 ComTimeOut = 3 ComBaud = "19200" ComParity = "N" ComDataBits = "8" ComStopBits = "1"
'-/- Open ComPort If Open_Port = False Then GoTo End_Send '-/- Check ID Sleep ComDelay: MSComm.Output = Chr$(255) 'Uyandırma İşareti Sleep ComDelay: MSComm.Output = Chr$(254) 'Hazır Komutu Sleep ComDelay: MSComm.Output = Chr$(0) 'Device ID '-/- Writing Animation Sleep ComDelay: MSComm.Output = Chr$(100) 'Animasyon Transfer Komutu 'Font Size Sleep ComDelay: MSComm.Output = Chr$(200) 'Komut İşareti If xSize = 5 Then Sleep ComDelay: MSComm.Output = Chr$(95) 'Efekt (5x7 Pixel Yazı Boyutu) ElseIf xSize = 7 Then Sleep ComDelay: MSComm.Output = Chr$(97) 'Efekt (7x7 Pixel Yazı Boyutu) End If Sleep ComDelay: MSComm.Output = Chr$(1) 'Süre/Hız Sleep ComDelay: MSComm.Output = Chr$(1) 'Tekrar 'Shift Left Sleep ComDelay: MSComm.Output = Chr$(200) 'Komut İşareti Sleep ComDelay: MSComm.Output = Chr$(43) 'Efekt Sleep ComDelay: MSComm.Output = Chr$(10) 'Süre/Hız Sleep ComDelay: MSComm.Output = Chr$(1) 'Tekrar 'İçerik (Numara) For i = 1 To Len(xText) Sleep ComDelay: MSComm.Output = Mid$(xText, i, 1) 'Her Karakter İçin 1 Byte Veri Next 'Animasyon Sonu Sleep ComDelay: MSComm.Output = Chr$(200) 'Komut İşareti Sleep ComDelay: MSComm.Output = Chr$(253) 'Veri Gönderimi Sonu '-/- Close_Port
i wanna send data with ethernet shiled. i can read data on net and send to rs232 but not working..
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #5 on: February 28, 2011, 10:12:44 am » |
Please answer me? i need to send ascii code with arduino to rs232 like this.
VB6 code: Sleep ComDelay: MSComm.Output = Chr$(255) Sleep ComDelay: MSComm.Output = Chr$(254) Sleep ComDelay: MSComm.Output = Chr$(0)
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #6 on: February 28, 2011, 10:22:06 am » |
Are you saying that the data is not reaching the Arduino?
If so let us look at the Arduino code.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #7 on: February 28, 2011, 10:29:23 am » |
i use this code. i am sending data but not changing my led banner. i showed vb code when i send code with vb its working.
char sounds[] = {255, 254, 0, 100, 200, 95, 1, 1, 200, 43, 10, 1, 77, 117, 115, 108, 117, 32, 89, 252, 107, 115, 101, 107, 116, 101, 112, 101, 200, 253}; void setup() { Serial.begin(19200);
for(int i = 0; i <=30;i++) { Serial.print(sounds,BYTE); } }
void loop() {
}
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #8 on: February 28, 2011, 10:53:00 am » |
Your first problem is that you're not sending any of the array bytes, exactly what Serial.print(sounds,BYTE); sends I'm not sure (probably the lower half of sound's address or something). You need to index into the array, and as there are only 30 elements in the array use < 30, not <=30 for(int i = 0; i < 30;i++) { Serial.print(sounds[i],BYTE); } EDIT: I just noticed that weirdo told you this days ago. ______ Rob
|
|
|
|
« Last Edit: February 28, 2011, 11:00:08 am by Graynomad »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #9 on: February 28, 2011, 05:34:52 pm » |
i tested it. i want to tell you. i am not sending data to pc. i am sending to led banner. do i must to use max232 or other chip? when i send data with pc serial port its working but when i sen data with Arduino its doesnt work.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #10 on: February 28, 2011, 11:50:06 pm » |
do i must to use max232 or other chip? when i send data with pc serial port its working but when i sen data with Arduino its doesnt work. That would imply that maybe you do need a MAX232, in which case you should NOT be plugging the display into an Arduino. Don't you have any specs on the display or a scope to look at the signals. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 13
Arduino rocks
|
 |
« Reply #11 on: March 01, 2011, 04:54:15 am » |
i didnt see any character in led banner.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6839
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #12 on: March 01, 2011, 05:18:44 am » |
Sorry musluyuksektepe but you can't just keep saying it doesn't work. We need technical details of the display.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
|