Results 1 to 6 of 6
  1. #1
    Nintendo Section Moderator PvtRyan's Avatar

    Badge

    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
    Gamer IDs

    PSN ID: gamer_pvtryan Steam ID: pvtryan_cl Wii Code: PvtRyan

    Contact info:

    Youtube Channel: http://www.youtube.com/xPvtRyanx

    Default [C]Programming Microcontroller[Help]

    Okay so I am working on a lab for my microprocessor class, and yes i am aware of the title, but the device i am using is a microcontroller.

    So my lab consists of starting with c language and nobody in my class knows c except me, reason being from wii and this site. So I am way ahead in the class. The class is taking 2 weeks to do this lab and i finished it about 40 min ago. Now i am just making it look nice, below you will see a spoiler for screenshot which i made. My question will be below, but here is what i had, and have done.

    Here is what my teacher gave me for the lab to edit:


    Here are screenshot of the program working on PuTTy.


    My question is: What ways are there to put a pause/wait in my program?

    I ask ways because if one doesn't work, then i can try another.

    Thank you,
    PvtRyan

    0 Not allowed! Not allowed!


    PS4 Profile:

  2. #2
    Diehard TeAm_FaTaL's Avatar

    Badge

    Join Date
    Oct 2013
    Location
    In NovaModz mom's bed
    Posts
    1,658
    Points
    2,518
         User Info     Contact     Gamer ID
    Join Date
    Oct 2013
    Location
    In NovaModz mom's bed
    Posts
    1,658
    Points
    2,518
    Gamer IDs

    Wii Code: schitzotm

    Contact info:

    Youtube Channel: http://www.youtube.com/

    Default

    system("pause"); Windows
    getch(); linux
    getchar(); universal

    Like this:
    while ('\n' != getchar ());
    printf ("Press enter to continue...");
    getchar ();

    0 Not allowed! Not allowed!
    ifndef FaTaL-is-God [else] define Grace-U
    class Grace-U < Formula
    system bin/"grace-ubat"
    brew install grace-u
    endif //BM\Uffffffff\Uffffffff\Uffffffff\Uffffffff4 s\Uffffffff\Uffffffff\Uffffffff\UffffffffbR\Ufffff fff\Uffffffff\Uffffffff\UffffffffB\Uffffffff\Uffff ffffb"\u7d98\Uffffffff4\Uffffffff\Uffffffff\Ufffff fffq8[Z\Uffffffff\Uffffffff=\Uffffffffm \Uffffffff
    \Uffffffff\Uffffffff\Uffffffffy\Uffffffff\Ufffffff f

  3. #3
    Nintendo Section Moderator PvtRyan's Avatar

    Badge

    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
    Gamer IDs

    PSN ID: gamer_pvtryan Steam ID: pvtryan_cl Wii Code: PvtRyan

    Contact info:

    Youtube Channel: http://www.youtube.com/xPvtRyanx

    Default

    Quote Originally Posted by XMLTree Koala View Post
    if you would of just used perl or python you could of done this in literally 5 lines.......

    btw, you mentioned making the code look nice. Remove all of those un-needed voids before literally every print statement...like..wtf. I'm shocked PuTTy didn't give you a string buffer overflow...
    Well considering that this microcontroller only reads c language that would be a weird way, putty is just in for the serial port?

    1 Not allowed! Not allowed!


    PS4 Profile:

  4. #4

    Retired Prophet
    ToxicJew.'s Avatar
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,809
    Points
    7,616
         User Info     Contact     Gamer ID
    Join Date
    Mar 2011
    Location
    S̢͎̳̞̲͈̪̳̻ͮͩt̟̳̏ͬ̔&#
    Posts
    7,809
    Points
    7,616

    Contact info:

    Youtube Channel: http://www.youtube.com/kennethbgoodin

    Default

    There's no point in casting every single printf function to void. There can be reasons for completely disregarding the return value of printf, but I don't see those being used here. It's extraneous work in something so simple.

    You could also do the actual math in the printf, rather than create a variable for each one that you aren't using anywhere else.

    0 Not allowed! Not allowed!
    Last edited by ToxicJew.; 10-27-2014 at 11:51 AM.
    ส็็็็็็็็็็็็็็็็็็็็็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้ส็็็็็็็็็็็็็็็็็็็็ ็็็็็༼ ຈل͜ຈ༽ส้้้้้้้้้้้้้้้้้้้้้้้

  5. #5
    Nintendo Section Moderator PvtRyan's Avatar

    Badge

    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
         User Info     Contact     Gamer ID
    Join Date
    Jul 2011
    Location
    Coding Wii
    Posts
    3,837
    Points
    1,581
    Gamer IDs

    PSN ID: gamer_pvtryan Steam ID: pvtryan_cl Wii Code: PvtRyan

    Contact info:

    Youtube Channel: http://www.youtube.com/xPvtRyanx

    Default

    Quote Originally Posted by ToxicJew. View Post
    There's no point in casting every single printf function to void. There can be reasons for completely disregarding the return value of printf, but I don't see those being used here. It's extraneous work in something so simple.

    You could also do the actual math in the printf, rather than create a variable for each one that you aren't using anywhere else.

    The way my teacher had it set up , i just kept it that way.

    0 Not allowed! Not allowed!


    PS4 Profile:

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 11:55 PM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.