Pages: 1 2 [3]   Go Down
Author Topic: Running two pieces of code at once  (Read 2010 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I will try it! The voltmeter show a value from 1.9V to 3.3V (Depends on the distance from the sensor).

EDIT: This seems to work but now I get multiple activations for one pass so I can't be 100%. I would use delay but that reference says that delay wont work in interrupt functions. I actualy tryed running and it detected me :o. So probaly only problem here are multiple activations.

EDIT2 : while this does work the other parts of code don't. The function that needs to write to some pins for very little time and then write to naother pin again for a few miliseconds doesn't work too good. Or it doesn't work at all. Depends on the moment when you run it.
« Last Edit: April 14, 2009, 01:05:22 pm by roli » Logged


0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 250
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok I am realy realy annoyed. My arduino is crazy! When I want to run a piece of code that writes to some pins in sequence it gets extremly strange. These pins control the motors but every time I run that piece of code the motor starts and never stops (until I press reset) I tryed NoInterrupts() but it doesn't help. So it does write high to the pin but then doesn't turn it off after 400ms delay. And when interrupt happens the arduino freezes again - sometimes. Without the interrupts the motors work better (so they start and stop) but the timing is strange. And it gets worse - When I put some pressure on the LCD this thing starts to work. So problem is with LCD screen and interrupts. I had to modify the LCD4Bit library to use analog pins as output but I just changed the pin where the comment indicated that I can change it.
« Last Edit: April 16, 2009, 10:40:00 am by roli » Logged


Pages: 1 2 [3]   Go Up
Jump to: