Timers, Millis and BLE! Help!

Hey All, i’m new to the whole arduino world but need some help. Been using this site to get as far as I have, but stuck for now! So I have an Arduino Mega, and have a working file that listens to a pair of sonar sensors via NewPing, and then activates a servo/relay/leds. However, when I tired to add the BLE library, all my components went haywire, relay starting clicking, servo started going up and down. I’m guessing there is a conflict with the BLE library and the way i’m using millis()? Any help would be GREATLY appreciated!

Updated: Code attached as plain text, was too long for code tags :slight_smile:

Thank you so much.

Video of what the project does: Dropbox - File Deleted

Oh and the BLE chip I have is a Adafruit Bluefruit LE UART Friend, and I was using their example code. All that works fine. Just when joining that sample code with my code s**t hits the fan. It compiles and runs, but like I said it makes my existing setup act crazy.

sketch_apr05a.zip (3.5 KB)

code.txt (10.7 KB)

Please tell us what a BLE library is, best if you can link to it. Also please post your code inside code tags, according to the forum guidelines. If it won't fit, please post it as a plain text file, not a zip file.