How can i measure the time between a pulse output and a pulse back on the input?

Llo,
I have a problem i use a ultrsonic sensor, and when i send a pulse out of 4V then a couple of ms i have a pulse back on the input, how can i exactly know how much time there is between the 2 ^pulse??

Use the output pulse to trigger a counter in period measuring mode and stop the counter on the return signal (if the input return signal is large enough to reliably trigger a logic circuit). If the signal is not large enough to trigger the counter directly, an external comparator can be used to generate the stop signal.
Another approach is to use two channels of analog input. Feed the output signal to one of them and the return signal to the other channel. The time between outgoing and return pulses can be determined from the sampling rate. If precise timing is required and your AI board does not have simultaneous sampling, you have to account for the inter-channel time as well.
Lynn

Similar Messages

  • Can I access a label inside of an MC and then go back to the main time line

    Here is my current set up.
    I have a labeled section on main time line which has icons of 12 different videos. Each icon acts as a button and brings a user to a labeled section with a FLV Video Playback component impemented to play the corresponding video. These labeled sections are located on the main time.
    This methog makes my main time line very long. Is there a way to make an additional MC which will hold all the video buttons and then have this MC separated into labeled sections.
    In other words can I access a label inside of an MC and then go back to the main time line?
    My present code for accessing the label located on the main timeline is:
    HowTo_maininfo_mc.theArrangement_btn.addEventListener(MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);
    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {
    gotoAndPlay("theArrangement");
    How would it look if my label "theArrangement" would be located inside of an MC?
    Is there any specific code if I want to have a close button located on the label inside of an MC and it needs to fire out to a label located on the main timeline?

    Oh, WOW! It is working perfectly now.
    My mistake was that I was specifiying the var sourceVar:String;
    for every single button. It was not clear to me from the first example that it has to be specified only once.
    I made a small test Flash file and everything works now. It still doesn't work on my big flash file, I guess some other code messes it up and I can' not figure what it is exactly.
    I would like to include the OUTPUT error message in hopes that you can spot right away what a mistake could be:
    VideoError: 1000: Unable to make connection to server or to find FLV on server
              at fl.video::VideoPlayer/stop()
              at fl.video::FLVPlayback/stop()
              at acolyteVideos_fla::mainsite_mc_2/stopF2()[acolyteVideos_fla.mainsite_mc_2::frame484:21]
              at flash.display::MovieClip/gotoAndPlay()
              at acolyteVideos_fla::mainsite_mc_2/onClick_GoBackToHowTo2()[acolyteVideos_fla.mainsite_mc_2 ::frame484:13]
    If there is no immediate cure for it, I will go through code line by line. Since it is working on the test it must be something wrong with my main file.
    Additiona question (please let me know if I should paste it as a new thread)
    I have similar set up with UILoader. Where different buttons set up to bring a user to individual labeled sections with individual UILoader. Should it be arranged in the same way that it is only one loader and "var sourceVar:String;" code is the one which brings up different content for each button?

  • HT204380 how can i use face time with my ipad 2 and my wifes ipad mini if we both got the same apple id

    how can i use face time on my ipad 2 with my wife on her ipad mini if we both got the same apple id info

    Add another email.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%201A/45059983711d586099 0cb799efad0bb8_zpsd520c0d4.jpg

  • How can I measure performance time?

    I need to performance tune all my reports. Is there a way to run a report and have it give me its processing time? I could not find a function or special field that would provide this info.

    Allison,
    If you go to the Report menu at the bottom there is an option Performance Information...Within there there is an option for Performance Timing. It will detail the time it takes to open a report, time to format a page, time to run the query etc...

  • How can I make Siri distinguish between calendar appointments (busy) and calendar events (free)?

    When I ask Siri "How does my day look tomorrow?" she tells me every appointment (busy) and task (free) I have scheduled. I'm trying to find a way to let her know that I'm only interested in seeing what appointments (busy) I have that day.
    Has anyone found a way to do this? I'm using iCloud calendars on all my devices.
    I've already used iCloud calendars to designate each individual event as either "free" or "busy," but she continues to display all calendar events when I ask for an overview of my day. I've tried to do this from my iPhone, Macbook, and iCloud website.
    Moving my tasks to my "Reminders" app won't help, because I need to be able to schedule time to work on specific tasks and also put important deadlines into my calendar. At the same time, when I ask Siri, "How does my day look," I am only interested in knowing what appointments I have that day.
    I've also tried asking specifically "What meetings do I have in my [work/personal/family etc. calendar]" but that doesn't work either.
    I've also tried asking "Can you show me when I'm busy today" and "Can you show me todays's appointments."
    It may be that Siri doesn't have this capability yet, but it would be nice to know if its in the works or if it exists.

    When I ask Siri "How does my day look tomorrow?" she tells me every appointment (busy) and task (free) I have scheduled. I'm trying to find a way to let her know that I'm only interested in seeing what appointments (busy) I have that day.
    Has anyone found a way to do this? I'm using iCloud calendars on all my devices.
    I've already used iCloud calendars to designate each individual event as either "free" or "busy," but she continues to display all calendar events when I ask for an overview of my day. I've tried to do this from my iPhone, Macbook, and iCloud website.
    Moving my tasks to my "Reminders" app won't help, because I need to be able to schedule time to work on specific tasks and also put important deadlines into my calendar. At the same time, when I ask Siri, "How does my day look," I am only interested in knowing what appointments I have that day.
    I've also tried asking specifically "What meetings do I have in my [work/personal/family etc. calendar]" but that doesn't work either.
    I've also tried asking "Can you show me when I'm busy today" and "Can you show me todays's appointments."
    It may be that Siri doesn't have this capability yet, but it would be nice to know if its in the works or if it exists.

  • How to save the time to a .txt file and retrive it back as time?

    I have to save the time [hour:minute:second] and the date [date:month:year] to a .txt file. I am using the Calendar API to set the time and date as below
    FileOutputStream fileStream = new FileOutputStream ("what.txt");
    PrintWriter pw=new PrintWriter(fileStream, true);
    Calendar curDate = Calendar.getInstance();
    System.out.print(curDate.get(Calendar.DATE)+":");
    System.out.print(months[curDate.get(Calendar.MONTH)]+":");
    System.out.print(curDate.get(Calendar.YEAR));
    pw.println(curDate);
    I'll have to retrive these data back to use it to set timer
    timer = new Timer();
    timer.schedule(new RemindTask(), time);
    I try to retrive the data and use the Calendar API to that data by using the below program.
    I get the error as :
    C:\t\Retrivedate.java:41: int cannot be dereferenced
    System.out.print(t.get(Calendar.DATE)+":");
    How can I solve this so that I can use Calendar API on my retrived data?
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    class Test {
    public static void main(String args[]) {
    try {
    File inputFile = new File("what.txt");
    FileReader in = new FileReader("what.txt");
    int t;
    char[] tmp = new char[100];
    int cnt = in.read(tmp);
    String tm="";
    for (int j=0;j<cnt;j++)
    { tm+=tmp[j];
    try {
    t=Integer.parseInt(tm,10);
    catch (NumberFormatException exception) {}
    System.out.println("jika "+tm);
    Calendar curDate = Calendar.getInstance();
    String months[]={
    "Jan","Feb","Mar","Apr",
    "May","June","July","Aug",
    "Sept","Oct","Nov","Dec"};
    Date time1 = curDate.getTime();
    System.out.print(" \n"+time1.getHours());
    System.out.print(":"+time1.getMinutes());
    System.out.println(":"+time1.getSeconds());
    System.out.print(t.get(Calendar.DATE)+":");
    System.out.print(months[t.get(Calendar.MONTH)]+":");
    System.out.print(t.get(Calendar.YEAR));
    in.close(); }
    catch (IOException ex) {
    System.out.println("IOException:"+ex.toString()); }

    These lines do not make sense:
    System.out.print(t.get(Calendar.DATE)+":");
    System.out.print(months[t.get(Calendar.MONTH)]+":");
    System.out.print(t.get(Calendar.YEAR));
    1. t is an integer, it does not have any methods.
    2. It's a bad idea to use char[] to retrive the date. You should use readLine() method to retrieve the whole date string, say "10/23/2001" (certainly you can have hours, minutes, seconds, etc.). Then you need to use SimpleDateFormat class to parse this string. SimpleDateFormat gives you everything to parse a date string in any format you want.
    PC

  • I have a Time Capsule with 2tb of storage, and an I-Mac with 500Gb. (which is at capacity) Can I use the Time Capsule to store data in addition to backing up the hard drive?

    I have a Time Capsule with 2tb of storage, and an I-Mac with 500Gb. (which is at capacity) Can I use the Time Capsule to store data from my hard drive that I want to access later in addition to backing up the hard drive?

    Can I use the Time Capsule to store data from my hard drive that I want to access later in addition to backing up the hard drive?
    Yes, but if you move the "original" data on your iMac to the Time Capsule....then the "original" data is now on the Time Capsule disk. 
    When...not if...the Time Capsule disk has a problem, you have no backups for this data.
    Perhaps a much safer plan might be to add an external hard drive attached directly to your iMac. Then, move the data to that drive from the iMac.
    Now, Time Machine will back up both your iMac and the external hard drive so you have "originals" on one drive and backups on another. Would that plan work for you?

  • Can't reset my time capsule using reset button and I don't have the password to get into reset it.

    I can't reset my time capsule b/c the reset button broke off when my time capsule fell off my shelf. I can't remember the password to the disk or time capsule to do a manual reset and I can't access the time capsule. Any suggestions around this?
    Thanks.

    Bob's suggestion is the best, as the old passwords should be stored on that computer.
    If you need to do it .. the hard way.. just open the TC.
    You need a heat gun (hair dryer on hottest setting works fine).. to heat the rubber mat up to very hot.. I usually take 5min or more just heating it, evenly as possible. Lift on one corner and keep heating whilst peeling off the rubber. I use a pair of leather garden gloves as it needs to be so hot you cannot hold it for long.
    Really hot the rubber easily peels off with all the glue on the rubber.
    Now undo the 10 small philips head screws and carefully lift up the aluminium base plate. There is a fan plugged into the board so don't pull. You can disconnect the plug carefully and lift it completely off.
    You can then press the reset switch with a small screwdriver or the like.. careful not to short anything if you use metal.
    The plastic lever should still be rolling around inside the TC.. when I look carefully at the plastic, the lever is inserted later.. not part of the one moulding.. there are two plastic stakes, which are heated and bent down like a rivet to hold the lever in place. You may be able to relocated the lever onto the plastic stakes with some glue.. use a good 5min epoxy rather than instant glue.. although on ABS plastic the instant glue works very well. Use the glue under and on top but a tiny amount, otherwise you will simply glue the lever to the body and it will never work again. You might be able to make it stay.. just be very gentle if you ever need to press it again.
    You can try a more permanent repair.
    Plastic flexing as hinges is not an engineering solution .. but you can get a scrap of metal, thin brass would be ideal... drill a hole in one end and use a small dia screw.. I would tap it and run a screw from the inside, using a short screw so only the end of the screw is visible. Coat the inside with silastic so it cannot short anything. Depends on your handyman type skills I guess.
    Strange that it would break.. Must have hit hard!!

  • TS1382 i have a new computer -- how can I get my music from my 2 ipods and my iphone on to the new computer.  I have downloaded itunes but can't get my music from the devices to load on the computer !!!! Help ????

    Need a little help.. New computer !!!  How do I get my music from my 2 Ipods and my Iphone to the newly installed and authorized computer?????

    This user tip provides the steps how to sync your iPhone to your new computer. It should also work for your iPods too.
    https://discussions.apple.com/docs/DOC-3141

  • How can I find my Imessages after I signed out and I sign back in

    How do I get my IMessages after I signed out , I sign in back and they are gone, help please

    Only by restoring from backup if you made the backup before you signed out.
    iOS: How to back up and restore your content

  • How can I keep Firefox from keeping my login name and password from being in the dialog boxes when I sign on on gmail? It allows anyone to log into my email account

    When signing on to my gmail account the two dialog boxes, one for account name and the other for the password are already filled in. The password box has dots for the password but anyone who clicks on the sign in box can read my mail. How do I change this? It appears to be a Firefox related issue because it doesn't happen if I sign in on Safari or Internet Explorer. I would appreciate your help.

    See [[Remembering passwords]], you can turn this feature off.
    You also can [[Remembering passwords#Viewing and deleting passwords|view or delete the saved passwords]].
    Please let us know whether that works for you.

  • How can I return my Curve, too many problems syncing and died on me with the last updates. no more patience, Canada Bell

    By the way your link for warranty do not work on your website....???
    Should I return it to Bell for General Failure ?

    Unfortunately, I'm in the same club, and also seeking a solution to the problem. I have approx 8000 songs and my ipod is a 3 mo. old 80 GB. I think I'm stuck working this out with Apple directly, which I'm dreading..and I'll be damned if I'm paying shipping charges for an IPOD that BEST BUY can't exchange beyond the 30 days post purchase, and can't do any more due to Apple's mandated service process. If a prompt resoluiotion with no further cost me is unavailable, I'd sooner throw the Ipod in the garbage, cancel my plans to by the Iphone, and live my life Apple free. Steven Jobs may know innovation and technology, but his knowledge of customer service could be his undoing one day.

  • How can i take my music from my ipod touch and put it back on my pc?

    I had just recently got my computer cleaned and i had to start over with reinstalling itunes.  I can get all my purchased music, but I can't find all my files of music that i have cut and put back onto itunes.  I cant even find the files on the computer.  Everything including my cut music is still on my IPOD TOUCH, but how do I transfer those songs back onto my itunes? Help! =]

    Music is moved from computer to iPod and not the other way.
    Allan

  • My iPod is not playing films. It plays music videos, but not films. When I press play on a film the play sign will come up and then change back to the pause sign. Is there anything I can do??????

    Please help me!

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync/delete all videos and then resync/redownload
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.

  • How can I store a File object into a Vector and get it back

    hi there
    I need to store a number of File object into a Vector first, and later on I need to get each File object out and work with it.
    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ..how do I get them back? i try to do this way
    for (i=0;i<mylist.size(); i++)
    File tempfile = mylist.get(i);
    ..work with tempfile. but I got java.lang.object error: imcompatible types. what can I do?

    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ok try this: i don't reall understand what your trying to do though...
    File[] files;
    // get files
    Vector fileList = new Vector();
    for (int i = 0; i < files.length; i++)
      fileList.add(files);
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    ((File)fileList.elementAt(i)).toString();
    // or
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    File temp = (File)fileList.elementAt(i);
    System.out.println(temp.toString);

Maybe you are looking for