Hi! its my second question.
i have a led banner. i send data to it with vb6 or python its working.
my python code:
-- coding: utf-8--
import serial, time
ser = serial.Serial('COM1',19200)
ser.parity = 'N'
ser.bytesize = 8
ser.stopbits = 1
ser.timeout = 1
beklemesuresi = 0.2
try:
#yazmaya başla
message = raw_input("Mesaj girin: ")
databasla = [255,254,0,100,200,95,1,1,200,43,10,1]
print "Datalar gonderiliyor"
for x in databasla:
ser.write(chr(x))
time.sleep(beklemesuresi)
#yazmaya başla
#Mesaj
for ch in message:
mesaj = chr(ord(ch),)
ser.write(mesaj)
time.sleep(beklemesuresi)
#Mesaj
#yazmayı bitir
databitir = [200,253]
for x in databitir:
ser.write(chr(x))
time.sleep(beklemesuresi)
#yazmayı bitir
ser.close()
Hata oluşursa
except IOError:
print "Hata olustu"
my arduino code:
int data[] = {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);}
void loop()
{
for (int i = 0; i < 30; i++){
Serial.print(data*);*
- delay(30);*
- }*
- Serial.end();*
}
How can i send data with arduino like python?
Do i have use max232 or other chip?