Search:

Type: Posts; User: bivhitscar

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,711

    Does code::blocks detect infinite loops? Because...

    Does code::blocks detect infinite loops? Because that's what you've got there.


    for (i=1; i<num; i+=.1){
    j=j*i;
    }
  2. Replies
    5
    Views
    1,826

    Try %.8f ;) By default, %f only prints to 6...

    Try %.8f ;)

    By default, %f only prints to 6 decimal places.
  3. Replies
    97
    Views
    17,388

    The main problem is the logic, not specific...

    The main problem is the logic, not specific values. I think you can work it out though, just read the code and modify small things to see how they effect the whole system. If we give you all the...
  4. Replies
    97
    Views
    17,388

    Well, P2OUT and P2DIR are different statements....

    Well, P2OUT and P2DIR are different statements. Either way, the OP has a fairly considerable problem with the logic in the transmitter.
  5. Replies
    97
    Views
    17,388

    Pretty sure that's the buzzer.

    Pretty sure that's the buzzer.
  6. Replies
    97
    Views
    17,388

    I agree with tabstop, I'm pretty sure the problem...

    I agree with tabstop, I'm pretty sure the problem is in the transmitter side.
  7. Replies
    97
    Views
    17,388

    Yeah, I worked that out a bit later. Did you...

    Yeah, I worked that out a bit later.

    Did you try my code from post #29?
  8. Jannr, read common's code - you must initialise...

    Jannr, read common's code - you must initialise both max and min. If you don't initialise a variable before you use it, the behaviour will be undefined.
  9. What happens if someone enters in all positive...

    What happens if someone enters in all positive integers? ;)


    [EDIT]

    The second half of your statement is spot on though.

    [EDITEDIT]

    ...or all negative integers.
  10. One of the obvious issues is that you haven't...

    One of the obvious issues is that you haven't initialised min and max before using them in a comparison.


    if(a<min) //what is the value of min at this point?
  11. Replies
    97
    Views
    17,388

    Is all this code in one file...?

    Is all this code in one file...?
  12. Replies
    97
    Views
    17,388

    Can you try replacing all the code in here: ...

    Can you try replacing all the code in here:


    if(packet.frame[9]=='A')
    {

    }


    With this:
  13. Replies
    97
    Views
    17,388

    Can you explain what you mean by this? Does it...

    Can you explain what you mean by this? Does it rapidly flash 10, then 20, then 30 (or 30, then 20, then 10)?

    The only way this is possible, is if the transmitter isn't sending the expected...
  14. Replies
    15
    Views
    2,206

    At a guess, you need to post code. A second guess...

    At a guess, you need to post code. A second guess would be that as you are using cout, you should be posting that code in the C++ forum. :)
  15. Replies
    97
    Views
    17,388

    Ok, if you get 1 LED for 10cm and 2 LEDs for 20cm...

    Ok, if you get 1 LED for 10cm and 2 LEDs for 20cm - then we know the transmitter is sending the correct signal.

    This is just a guess but try deleting the following line from both the W and A if...
  16. Replies
    97
    Views
    17,388

    So I guess when 20cm is reached, two LEDs turn on...

    So I guess when 20cm is reached, two LEDs turn on and still nothing in the 7seg? Do you get anything in the 7seg at all, or completely blank?
  17. Replies
    97
    Views
    17,388

    So when the water level reaches 10cm, what...

    So when the water level reaches 10cm, what happens? Don't worry about anything else for now, just start with this question.
  18. Replies
    97
    Views
    17,388

    No, even in the land of microntrollers, mod is...

    No, even in the land of microntrollers, mod is mod and divide is divide. I just think the code we're seeing is a simplified version of a future, more complex, version.


    [EDIT]

    ...and our OPs...
  19. Replies
    97
    Views
    17,388

    I agree with everything quzah is saying - though...

    I agree with everything quzah is saying - though this is what I was referring to earlier. I was assuming that 20%10 would become 20%var. I was also assuming that you might think to create a function...
  20. Replies
    97
    Views
    17,388

    Could you paste the code where you try to make 10...

    Could you paste the code where you try to make 10 and 20 work?
  21. Replies
    97
    Views
    17,388

    If you wrote the code that is in your original...

    If you wrote the code that is in your original post, then you shouldn't have any trouble making the two 7-segs display 20 for W and 10 for A.
  22. Replies
    97
    Views
    17,388

    Nah, looks to me like it's just initialising a...

    Nah, looks to me like it's just initialising a receiver then reading off whatever it gets sent:


    void MRFI_RxCompleteISR()
    {
    mrfiPacket_t packet;
    MRFI_Receive(&packet);
    ...
  23. Replies
    10
    Views
    3,349

    Given that this is a microcontroller, it's pretty...

    Given that this is a microcontroller, it's pretty common to declare the return type as void - because if your main ever actually returns you've made a mistake and there's no one there listening.
  24. Replies
    97
    Views
    17,388

    While I have limited micro controller experience...

    While I have limited micro controller experience and my C is rusty (just getting back into the swing) - I think you'll find you need to analyse the code within the following block to find the answer:...
  25. Replies
    3
    Views
    1,664

    How could you do it without arithmetic operators;...

    How could you do it without arithmetic operators; surely that's impossible?

    Or are you meant to use bit-fiddling techniques?
Results 1 to 25 of 213
Page 1 of 9 1 2 3 4