Show Posts
Pages: 1 [2]
16  Forum 2005-2010 (read only) / Syntax & Programs / How to do parallel output efficiently on: May 11, 2010, 01:00:51 pm
Hi, ,i am an arduino beginner. i have a programming problem. Is there any efficient way to do the digital parallel output. While programming directly to AVR, we only need to give the data to PORTXn.
I use the following function to do so. But it may take a little long to finish writing. So i hope somebody can help me.
Thanks. smiley
Code:
int Dpin[]={3,4,5,6,7,8,9,10};

void sendPin(byte j)
{
        for (int n=0;n<8;n++)
      {
            if((0x01&j) < 0x01)
                {digitalWrite(Dpin[n],LOW);}
                else
                {digitalWrite(Dpin[n],HIGH);}
            j>>=1;
      }
}
17  Forum 2005-2010 (read only) / Troubleshooting / only can download program once on: April 30, 2010, 07:12:03 am
I have a prolem. I hope somebody can help me. :'(
My Arduino MEGA board can only download program once after i burn the bootloader. When I download another program, it tells error:
avrdude: stk500_getsync (): not in sync: resp = 0x00 avrdude: stk500_disable (): protocol error, expect = 0x14, resp = 0x51.
So every time when i want to download program, I have to burn bootloader again. I set the fuse bits as follows: Low FF; high DA; extension bit FF; encryption digital FF.
So please give me some advice. Thanks
18  Forum 2005-2010 (read only) / Development / Re: Robot Camera  With  2.8" TFT on: June 06, 2010, 01:33:58 pm
It can be found on Ebay.
Just search on Ebay: AVR Camera REV 4.0 with TF Screen
19  Forum 2005-2010 (read only) / Development / How does FT232 on Arduino work? on: January 03, 2011, 06:57:00 am
Hi,
I am a beginner of Arduino hardware. I am a little confused about the uploading sketch via Arduino USB. I know after clicking the Upload button, Arduino software would send something to FT232 before sending the sketch data, which forces DTR pin of FT232 to go low. Then the Arduino is reseted. And a piece of programme of bootloarder will run for several seconds. During this period, the schetch data is transmitted to Arduino. And after the uploading is done, i think Arduino would send back some data to Arduino software. So the software can display "Uploading done".
 I guess FT232 will get DTR pin down while it receives some command via USBDM or USBDP. So my question is, before uploading the schetch data, what would Arduino software send to FT232? And what would be sent back from Arduino after the schetch data uploading is done?
Or maybe i am totally wrong about how it works.  ;D
Could someone explain it? Thanks
20  Forum 2005-2010 (read only) / Exhibition / Re: IR-RF converter on: October 22, 2010, 05:33:02 am
The remote control device seems very cool. It has touch screen!
Where can I more information about it?
21  Forum 2005-2010 (read only) / Exhibition / Re: A simple security system on: October 30, 2010, 03:37:52 am
thanks, april, you are right
22  Forum 2005-2010 (read only) / Exhibition / A simple security system on: October 22, 2010, 03:52:48 am
Hi, I use what I have to make a simple security system.
Except Arduino Mega, I used an LED1602 module and an RFID module.
Here is how i conenct them together.


After the RFID reader detects the ID card, it will sound the LED and sound the buzzer, then send the card number to Arduino via TX port. Then Arduino decides whether the card is authenticated. Then it will output the result to LCD via Serial2 Port.

Put the authenticated card on the antenna:

Put other card on the antenna:

Meanwhile, card number send to PC, to displayed or do other application development.
I display it on Serial Monitor:


Code:
Code:
char incomingByte[20];      // for incoming serial data
int i;
boolean compareString(char a_str[], char b_str[], int length)
{
  for(int i=0; i<length; i++)
  {
    if(a_str[i]!=b_str[i])
    return false;
  }
  return true;
}

void setup() {
      Serial.begin(9600);      // opens serial port, sets data rate to 9600 bps
        Serial1.begin(9600);
        Serial2.begin(9600);
        pinMode(7, OUTPUT);
}

void loop() {

      for(i=0;i<19;i++)
       {
       // send data only when you receive data:
      if (Serial1.available() > 0) {
            // read the incoming byte:
            incomingByte[i] = Serial1.read();
                digitalWrite(7, HIGH);
                delay(10);
         }
            
        else
        {
          digitalWrite(7, LOW);
          incomingByte[i] = '\0';  
          break;
          
              
      }
       }
        if (i>0)
        {
      Serial.write(incomingByte);
        Serial.println();
        if(compareString(incomingByte, "2900119980290C", 14)== true)
          {
            Serial2.print("$CLEAR\r\n");
            Serial2.print("$PRINT Authenticated\r\n");
          }
        else
         {
          Serial2.print("$CLEAR\r\n");
          Serial2.print("$PRINT Denied\r\n");
         }
        delay(2000);
        Serial2.print("$CLEAR\r\n");
        Serial2.print("$PRINT Please check in\r\n");
        Serial1.flush();
      
        }
      
        
}

Please give some advice smiley
23  Forum 2005-2010 (read only) / Exhibition / Re: To make an LED Screen of any size on: May 09, 2010, 08:16:00 am
Well, We developed it together. Since he introduced it here. No need for me to do the same thing. I drop out
Pages: 1 [2]