Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: How to receive byte array and put it into another byte array through serial port on: January 29, 2013, 12:23:19 pm
@ PaulS

Thank you for the hint.

I replaced "Serial.print" with "Serial.write" and it worked!

here is the fix:-

//*******************************Arduino( A) *************************************************
byte crypt [8]={0x7E, 0x05, 0xBD, 0xEB, 0x1A, 0x3A, 0x6E, 0x91 };
void loop(){
      for (int j=0;j<8;j++)
    {
      Serial.write(crypt[j]);
    }
    delay(1000);
}

what i get from serial monitor for this code is
~½ë:n‘       //which doesn't matter how it looks

//**********************************************************************************************

I have connected the Rx of the arduino(A) to Tx of the arduino(B) and Tx to Rx.

//*********************************Arduino(B)******************************************************************
byte crypt [8];
void loop(){
while(Serial.available() <=0); // wait for incoming serial data

  if (Serial.available() >= smiley-cool  // wait for four bytes
  {
    for(int i=0;i <=8; i++) crypt=Serial.read();
    for (int j=0;j<8;j++)
    {
      if (crypt[j]<0x10){
      Serial.print("0");
      }
      Serial.print(crypt[j],HEX);
      Serial.print(" ");
    }
    Serial.println("");
  }
}

what i get from serial monitor for this code is
7E 05 BD EB 1A 3A 6E 91   //just like how i wanted it smiley
//*********************************************************************************************************************
2  Using Arduino / Networking, Protocols, and Devices / Re: How to receive byte array and put it into another byte array through serial port on: January 29, 2013, 06:49:22 am
@ PaulS

Does that mean i have to send it using "Serial.write"  rather than "Serial.print"?

No, its not the serial monitor where the data is needed. I just wanted to be sure the received data is put into a byte array exactly like it was sent, so that i can take it and process it in the other end(in arduino B).
3  Using Arduino / Networking, Protocols, and Devices / How to receive byte array and put it into another byte array through serial port on: January 29, 2013, 05:45:42 am
There is a byte array being sent from one Arduino(A) to another Arduino (B) like this

//*******************************Arduino( A) *************************************************
byte crypt [8]={0x7E, 0x05, 0xBD, 0xEB, 0x1A, 0x3A, 0x6E, 0x91 };
void loop(){
      for (int j=0;j<8;j++)
    {
      if (crypt[j]<0x10){
      Serial.print("0");
      }
      Serial.print(crypt[j],HEX);
      Serial.print(" ");
    }
   
   Serial.println();
    delay(1000);
}

what i get from serial monitor for this code is
7E 05 BD EB 1A 3A 6E 91

//**********************************************************************************************

I have connected the Rx of the arduino(A) to Tx of the arduino(B) and Tx to Rx.

//*********************************Arduino(B)******************************************************************
byte crypt [8];
void loop(){
while(Serial.available() <=0); // wait for incoming serial data

  if (Serial.available() >= 8 )  // wait for eight bytes
  {
    for(int i=0;i <=8; i++) crypt = Serial.read();
     for (int j=0;j<8;j++)
    {
    if (crypt[j]<0x10){
      Serial.print("0");
      }
      Serial.print(crypt[j],HEX);
      Serial.print(" ");
    }
    Serial.println("");
  }
}

what i get from serial monitor for this code is
37 45 20 30 35 20 42 44
20 45 42 20 31 41 20 33
20 36 45 20 39 31 20 0D
//*********************************************************************************************************************

The problem is how do i read the bytes in arduino(B) and put it into a byte array like it was in the arduino(A)?


Any help would be appreciated


 
4  Development / Other Software Development / Re: Arduino simulator. on: May 22, 2012, 02:07:55 pm
Great Job!!, but don't you think "Proteus" can do the same and more?
5  Using Arduino / Displays / Re: 16bit data bus color LCD interfacing? on: August 31, 2011, 08:26:49 am
I don't know from where to start smiley-sad-blue , can u plz provide me an example code on how to initialize it and a code for write instruction?
6  Using Arduino / Displays / Re: 16bit data bus color LCD interfacing? on: August 30, 2011, 01:43:48 pm
thank u Andy Brown, it seems i have to do a lot of work  smiley-confuse
7  Using Arduino / Displays / 16bit data bus color LCD interfacing? on: August 29, 2011, 07:04:48 pm
I have a 2inch color LCD from my old not working MP3 player and i wanted to display some text on it using arduino mega2560.
It has 36 pins of which 16 pins are for data bus.

Is there any way i can interface it with my arduino mega2560? if yes, how?  smiley
I know how to interface and program alphanumeric lcd displays but not color LCDs.
If you guys have any tutorial about interfacing color LCD with arduino, I would be greatfull if u share it with me. Thanks

here is a link for its diagram
http://320volt.com/wp-content/uploads/2010/10/schematic-tft-kgm265g3-mp4-kgm265f1-lcd.png
8  Using Arduino / Programming Questions / Re: Here is how i was able to upload external hex file to mega2560 on: July 25, 2011, 05:10:20 pm
thanks retrolefty it worked.. but only with command line i posted, every time i upload i have to give it the command line and the hex file path written with it. Thats because i chose stk500v2 programmer and used COM instead of usb.

thank u, this is definitely better software
9  Using Arduino / Programming Questions / Re: Here is how i was able to upload external hex file to mega2560 on: July 25, 2011, 07:24:45 am
oops... you don't have to replace the avrdude.conf
just start from the 2nd step
10  Using Arduino / Programming Questions / Here is how i was able to upload external hex file to mega2560 on: July 25, 2011, 07:16:54 am
After a lot of searching i was finally able to upload hex files to Arduino mega2560 with the help of this small software

http://www.ngcoders.com/downloads/arduino-hex-uploader-and-programmer

this software was only for m8, m168, m328p and m128

but the usefull thing about it was, it lets u change the command line for avrdude

so all i did was
>Replace the (avrdude.conf) in the software with the (avrdude.conf) that is in arduino-0022\hardware\tools\avr\etc\avrdude.conf
>Run the software and add the hex file
> Choose your com port and any microntroller i.e m328p
>Change the AVR Dude Params to:-

-F -v -patmega2560 -cstk500v2 -P\\.\COM24 -b115200 -D -Uflash:w:"your_hex_file path.hex":i

Don't forget to change COM24 to your COM port number

>Click the upload button and I WAS DONE! smiley-lol

If you guys have better way to upload hex file to meg2560 please enlighten me..
11  Topics / Education and Teaching / Question about Arduino Cookbook on: July 24, 2011, 06:42:10 am
This must be a stupid question to ask but really i can't figure it out!

There are schematics in Arduino Cookbook which some components (i.e resistors, transistors...)
don't have values and only say "See TEXT for component value.

the question is, Where am i supposed to see? Where is the 'TEXT' to see?  smiley-confuse
Pages: [1]