Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Sensors / Re: uneven reading on: March 28, 2013, 10:48:46 am
i don't know abouth frequency. I bought this: http://www.hobbyking.com/hobbyking/store/__11784__TURNIGY_Voltage_Booster_for_Servo_Rx_1S_to_5v_1A_.html . the is no datasheet. but i'll try those caps.
2  Using Arduino / Sensors / Re: Proprio-sensor? on: March 28, 2013, 07:55:45 am
how abouth infrared LED and reciever. SMD reciever can be really small and will only work on 38KHz.
http://www.newark.com/vishay-semiconductor/tsop6238tr/ir-receiver-40m-950nm-smd/dp/22H1515
3  Using Arduino / Sensors / Re: uneven reading on: March 28, 2013, 07:48:13 am
It was the ac hum. It works fine after averaging 64 values. Is there a way to fix hardware. i think the ac hum is made by 3.7V to 5V booster.Might that be problem? I'll try to power it different way. if it was a problem, would there be a way to fix it without removing the booster?
4  Using Arduino / Sensors / Re: uneven reading on: March 24, 2013, 02:35:19 pm
do you mean the same ac hum as in audio use to be?
5  Using Arduino / Sensors / Re: uneven reading on: March 24, 2013, 02:03:54 pm
Here is the connection. I have 9 of these sensors on bottom of my robot. They for line recognition.all of them are digital but only two are analog. digital reading is fine, only analog is uneven.
6  Using Arduino / Networking, Protocols, and Devices / Re: can shield on: March 24, 2013, 09:55:27 am
yes it's connected trough the OBDII cable. All new cars have this connector but older might not have
7  Using Arduino / Sensors / uneven reading on: March 24, 2013, 09:41:12 am
I have a cny70 sensor connected as voltage divider and output goes to MCU and also to comparator. I'm building linefollowing robot. Even when the robot is not moving the reading show values from 50 - 100. It's weird because my last robot showed values from 243 -  248, when it wasnt moving.is there anything else that i can do? I appriciate your help, thanks.
8  Using Arduino / Programming Questions / Re: only 1V on output on: March 18, 2013, 08:44:54 am
Where do you have the equivalent of this? It's usually in void setup():

pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);

thanks that was problem. I forgot something so basic  smiley-roll-sweat
9  Using Arduino / Programming Questions / only 1V on output on: March 18, 2013, 07:35:08 am
I wasn't  sure if this is hardware or software error. The problem is that on digital output of my atmega1284 i only have 1V when it's set to HIGH. I only have this problem with this code
Code:
int tlac=digitalRead(12);
int naraz=digitalRead(5);

void rovno(){
 digitalWrite(3, HIGH);
 digitalWrite(4, LOW);
 digitalWrite(6, LOW);
 digitalWrite(7, HIGH);
 Serial.println(5);
 delay(10);
}

void vzad(){
 digitalWrite(3, LOW);
 digitalWrite(4, HIGH);
 digitalWrite(6, HIGH);
 digitalWrite(7, LOW);
}

void vlavo(){
 digitalWrite(3, HIGH);
 digitalWrite(4, LOW);
 digitalWrite(6, LOW);
 digitalWrite(7, LOW);
 Serial.println(4);
 delay(10);
}

void vpravo(){
 digitalWrite(3, LOW);
 digitalWrite(4, LOW);
 digitalWrite(6, LOW);
 digitalWrite(7, HIGH);
 Serial.println(6);
 delay(10);
}

void stoj(){
 digitalWrite(3, LOW);
 digitalWrite(4, LOW);
 digitalWrite(6, LOW);
 digitalWrite(7, LOW);
}

void vlavo90(){
 digitalWrite(3, HIGH);
 digitalWrite(4, LOW);
 digitalWrite(6, HIGH);
 digitalWrite(7, LOW);
 Serial.println(3);
 delay(10);
 delay(10);
}

void vpravo90(){
  digitalWrite(3,LOW);
  digitalWrite(4,HIGH);
  digitalWrite(6,LOW);
  digitalWrite(7,HIGH);
  Serial.println(7);
  delay(10);
}

void kalibracia(){
 
}

void prekazka(){
  int s1=digitalRead(15);
  int s2=digitalRead(16);
  int s3=digitalRead(17);
  int s4=digitalRead(18);
  int s5=digitalRead(19);
  int s6=digitalRead(20);
  int s7=digitalRead(21);
  int s8=digitalRead(22);
  int s9=digitalRead(23);
  vlavo90();
  delay(275);
  while (s1==1 || s2==1 || s3==1 || s4==1 || s5==1 || s6==1 || s7==1 || s8==1 || s9==1){
    float volts = analogRead(A0)*0.0048828125;
    float distance = 13*pow(volts, -0.9);
    if (distance < 6) {
      vlavo();
      prekazka();
    }
    if (distance > 6 && distance < 11) {
      rovno();
      prekazka();
    }
    if (distance > 11) {
      vpravo();
      prekazka();
    }
  }
}
 
void rovinka(){
  int s6a=analogRead(A2);
  int s4a=analogRead(A1);
  analogWrite(3,255);
  analogWrite(6,255);
}
 
void vlavomimo(){
  int s1=digitalRead(15);
  int s2=digitalRead(16);
  int s3=digitalRead(17);
  int s4=digitalRead(18);
  int s5=digitalRead(19);
  int s6=digitalRead(20);
  int s7=digitalRead(21);
  int s8=digitalRead(22);
  int s9=digitalRead(23);
  while (s2==0 || s3==0 || s4==0 || s5==0 || s6==0 || s7==0 || s8==0 || s9==0){
  vlavo();
  delay(10);
  rovno();
  }
}

void vpravomimo(){
  int s1=digitalRead(15);
  int s2=digitalRead(16);
  int s3=digitalRead(17);
  int s4=digitalRead(18);
  int s5=digitalRead(19);
  int s6=digitalRead(20);
  int s7=digitalRead(21);
  int s8=digitalRead(22);
  int s9=digitalRead(23);
  while (s2==0 || s3==0 || s4==0 || s5==0 || s6==0 || s7==0 || s8==0 || s1==0){
  vpravo();
  delay(10);
  rovno();
  }
}

void setup(){
  while (millis() == 5000) {
    if (tlac == HIGH) kalibracia();
  }
  Serial.begin(9600);
}



void loop() {
  int s1=digitalRead(15);
  int s2=digitalRead(16);
  int s3=digitalRead(17);
  int s4=digitalRead(18);
  int s5=digitalRead(19);
  int s6=digitalRead(20);
  int s7=digitalRead(21);
  int s8=digitalRead(22);
  int s9=digitalRead(23);
 //if (naraz==HIGH) prekazka();
 if (s5==0) rovno(); //0 cierna, 1 biela
 else { if (s4==0) vlavo();
 else { if (s6==0) vpravo();
 else { if (s3==0) vlavo();
 else { if (s7==0) vpravo();
 else { if (s2==0) vlavo90();
 else { if (s8==0) vpravo90();
 else { if (s1==0) vlavomimo();
 else { if (s9==0) vpravomimo();
}}}}}}}}}

The problem is with voids rovno, vlavo ,vpravo, vpravo90 and vlavo90. all of them are for digital pins 3,4,6,7. when i messure them with multimeter i get 1V however when there is only rovno() in void loop it is working fine. i appreciate your help.
10  Using Arduino / Microcontrollers / Re: atmega1284 uploading problem on: March 13, 2013, 03:46:21 pm
wow, thanks that actually hepled. everytime i upload something it says problem uploading to board but MCU starts doing the code. i just add caps
11  Using Arduino / Microcontrollers / Re: atmega1284 uploading problem on: March 13, 2013, 03:16:10 pm
1. only 1000uf
2. 5V
3. 115200. i'd try less if i knew how. i guess changing it in baords.txt.
4. 22pf
5. yes
6. yes
7. no
12  Using Arduino / Microcontrollers / Re: atmega1284 uploading problem on: March 13, 2013, 03:01:51 pm
16mhz
13  Using Arduino / Microcontrollers / Re: atmega1284 uploading problem on: March 13, 2013, 02:46:33 pm
bootloader isn't problem. it was ok without problems. i changed signature and it works. max232 is fine. i can upload codes to uno with it without problems everytime.
14  Using Arduino / Microcontrollers / Re: atmega1284 uploading problem on: March 13, 2013, 02:06:07 pm
Thanks lefty, unfortunatlly it didn't help much. first upload with max232 worked but others didnt work.
even when i uploaded it i got this:
Code:
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x003b
         0x00 != 0x80
avrdude: verification error; content mismatch
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.
15  Using Arduino / Microcontrollers / atmega1284 uploading problem on: March 13, 2013, 01:27:11 pm
i§m using atmega1284 with ''mighty atmega1284 using optiboot'' burnloader. I have problem with uploading code. sometimes i upload code sometimes not but mostly not. Can the problem be that i'm using atmega1284 instead of atmega1284p? thanks for everyones help.


succesfull upload with max232(just the end):
Code:
avrdude: Recv: . [10]
######## | 100% 0.18s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0016
         0xa5 != 0xf5
avrdude: verification error; content mismatch
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.

unsuccesfull upload with max232(just the end):
Code:
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c]   [20]
avrdude: Recv:
avrdude: stk500_cmd(): programmer is out of sync

unsuccesfull upload with uno rev3(just the end):
Code:
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c]   [20]
avrdude: Recv:
avrdude: stk500_cmd(): programmer is out of sync
Pages: [1] 2 3 ... 6