Forum >indicator always blink
ArduinoGeneral

indicator always blink

userHead welly 2013-04-22 21:55:10 4301 Views4 Replies
Hi Eveyone,
I bought a i/o expansion shield v5.0 to try RS485 transmition and interfaced with Arduino Mega 2560.
[url=http://ppt.cc/RWdC.]http://ppt.cc/RWdC.[/url]
Everything is fine while connecting with usb debug.
But I find the indicator is always blink while charging with batterise,and the scenerio of testing led is not correct.
The connected led just flash once if i set the ledPin to high(it should be always lighted).
Are this problem releated to voltage.
We use batteries 9v(series connection, 1.5v each*6).
Hope you have some ideas.

regards
Welly

2013-04-24 19:26:54 Hi Jose:
    Thx for your reply, the issue was solved, another issue was as below:
    I would like to input a char '1' to set ledPin high and '2' to low, then print the value.
    If I don't interface with io expansion shield v5, it works fine.
    When i connect to RS485, the scenerio was strange, after input '1', it print 49,50,50,50,....successively.
    It should print 49 only once, then I cant' input '2' to set ledPin low.
    It confused me a lot. please help me to figure these out.

    int EN=2;
    int ledPin=13;
    if(Serial.available()>0){
// receive data
digitalWrite(EN, LOW);//Enable Receiving Data
val = Serial.read();
if (-1 != val) {
if (val == '1') {
digitalWrite(ledPin, HIGH);
}else if(val = '2'){
digitalWrite(ledPin, LOW);
}
}

// send data
if(val!=-1){
delay(1000);
digitalWrite(EN, HIGH);//Enable data transmit
Serial.println(val, DEC);
}
  }

cheers
   
userHeadPic welly
2013-04-23 21:10:34 [quote="welly"]
    error log:
            Uploading to I/O board using 'COM6'
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_getsync(): timeout communicating with programmer
[/quote]

This is happening because the serial port is blocked with RS485. So when you try to flash a new firmware, it will connect to RS485.  Detach the Expansion shield or change the jumpers so the Serial port it is not blocked, that should fix it
userHeadPic Jose
2013-04-23 21:08:30 [quote="welly"]
    But I find the indicator is always blink while charging with batterise,and the scenerio of testing led  is not correct.
  The connected led just flash once if i set the ledPin to high(it should be always lighted).
    Are this problem  releated to voltage.
    We use batteries 9v(series connection, 1.5v each*6).
[/quote]

How are you charging the battery? It might be that the batteries don't have enough power?
userHeadPic Jose
2013-04-23 01:38:30 Hi Everyone:
    Another strange situtaion was as below:
    I cannot upload sketch to Arduino Mega 2560 while interfaced with I/O expansion shield v5.
    error log:
            Uploading to I/O board using 'COM6'
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_ReceiveMessage(): timeout
            avrdude: stk500v2_getsync(): timeout communicating with programmer

regards
Welly
   
userHeadPic welly