Search:

Type: Posts; User: ak47

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    5,987

    Thanks Salem, I understand now :)

    Thanks Salem, I understand now :)
  2. Replies
    9
    Views
    5,987

    Also in your example, it is assumed that the...

    Also in your example, it is assumed that the motor first moves clockwise then it moves counter- clockwise, But that may not always be the case. What if the motor is instructed to rotate...
  3. Replies
    9
    Views
    5,987

    I see, so for the opposite direction i just need...

    I see, so for the opposite direction i just need to subtract?


    bool counterclockwise_crossed(uint16_t initial, uint16_t previous, uint16_t current)
    {
    if (initial > previous)
    {
    ...
  4. Replies
    9
    Views
    5,987

    Okay coming back to my logical bug, How do i...

    Okay coming back to my logical bug, How do i remove the first rotation bug? Any idea?
  5. Replies
    9
    Views
    5,987

    pMotor->ptrFCL->qep.MechTheta is a float. This is...

    pMotor->ptrFCL->qep.MechTheta is a float. This is a normalized value and varies from 0.0 to 1.0 only.
    0 being the 0th Mechanical degree and 1.0 being the 360th mechanical degree. To avoid the...
  6. Replies
    9
    Views
    5,987

    function to count number of rotations

    Hello Experts,
    I am trying to write a function that counts the number of rotations of a motor. The function calculates the number of rotations based on the mechanical angle. The mechanical angle is...
  7. Replies
    4
    Views
    1,790

    Thanks for the code , the controller which we am...

    Thanks for the code , the controller which we am using has a hardware floating point unit , so we am thinking the accumulated errors will not be much..
  8. Replies
    4
    Views
    1,790

    function to calculate RMS value

    Hello Experts,
    I am trying to write a quick function to calculate the RMS values, without using any blocking calls(mainly loops)
    This is what I have so far, it is not optimized for speed for which...
  9. Replies
    4
    Views
    1,359

    Thanks Salem, this is very elegant :) Will try...

    Thanks Salem, this is very elegant :)
    Will try it and let you know!
  10. Replies
    4
    Views
    1,359

    16618

    16618
  11. Replies
    4
    Views
    1,359

    Sequential state machine skeleton

    Hello Experts,
    I came up with this state machine for one of my embedded projects, looking at a few reference programs online. And was wondering if someone could verify it for me, I am not able to...
  12. Replies
    4
    Views
    1,196

    Hello Matt, I got an alternative to that. ...

    Hello Matt,
    I got an alternative to that.


    #include <stdio.h>
    #include <stdlib.h>
    int get_time_diff(int*,int*);
    int main()
    {
    int old_time[] = {22,00,00,15,7,2015}; ...
  13. Replies
    4
    Views
    1,196

    calculate time difference

    Hello Everyone,

    I need some help writing a function which calculates the difference between any two given times.

    I have made a rough skeleton of the function but need some help filling it. ...
  14. Replies
    1
    Views
    674

    double value incorrect,Pls help!

    Hello everyone,
    I am confused with formatting large decimal numbers.
    Please consider the following example


    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    #define pi...
  15. Replies
    2
    Views
    702

    non maskable global/local variables

    Hello Everyone :)

    Please bear with me if this sounds a bit silly.
    I would like to know if there is a way(piece of code/snippet in C) by which
    at any time during a program execution by pressing a...
  16. Replies
    6
    Views
    2,892

    Let me give you an example of the buffer array. ...

    Let me give you an example of the buffer array.


    buffer_array[] = "operation1 error code NULL \n operation2 error code 10 \n operation3 error code STOP";
    or
    buffer_array[] = "operation1 error...
  17. Replies
    6
    Views
    2,892

    Thanks for the quick reply Mr. grumpy. I see,yes...

    Thanks for the quick reply Mr. grumpy.
    I see,yes the %*s is much simpler to use rather than to use another array to store the discarded data (buffer_to_discard),however sscanf() is only useful if i...
  18. Replies
    6
    Views
    2,892

    understanding sscanf() function

    Hello every one,

    I was looking for ways to stop using scanf() as it has got the obvious bug when handling string data,
    and also sometimes it holds the inputs coming from stdin ,and i have to use...
  19. Replies
    5
    Views
    1,030

    Hey guys,i solved the issue,it was in my...

    Hey guys,i solved the issue,it was in my Writefile statement.


    if(!WriteFile(hSerial,cmd,strlen(cmd),&dwBytesRead, NULL))


    I removed the strlen() rightly pointed out by Salem and replaced it...
  20. Replies
    5
    Views
    1,030

    unsigned char cmd[10] = "\0"; unsigned char...

    unsigned char cmd[10] = "\0";
    unsigned char rzBuff[10] = "\0";


    i thought that ,that %d would effect the next byte too,but it did not.I confirmed it by changing it to %c(1 byte) and...
  21. Replies
    5
    Views
    1,030

    Actually my array is 10 bytes. unsigned char...

    Actually my array is 10 bytes.


    unsigned char cmd[10] = "\0";
    unsigned char rzBuff[10] = "\0";

    Originally cmd[] was 12 bytes long,i needed to confirm that data after cmd[9] was being looped...
  22. Replies
    5
    Views
    1,030

    unusual behaviour of my function

    Hello everyone,
    I have a function that creates a custom protocol for transmission of data to a serial port.
    The function is below:


    void calc()
    {
    /*cmd array and num integer are global*/
    ...
  23. Replies
    2
    Views
    2,319

    Hello Tim, Thank you for you reply. There did...

    Hello Tim,
    Thank you for you reply.

    There did make a mistake in my earlier post.
    I am passing just b not *b in my function.I realized i had made that mistake after reading your post.
    Anyway i...
  24. Replies
    2
    Views
    2,319

    Invalid File Handle error in my program

    Hello everyone,
    I am having trouble figuring out where the bug is in my code.
    I have two functions which are used to access a serial port.
    When i combine then it works correctly ,but when i split...
  25. Replies
    8
    Views
    9,992

    Hello Mr. grupmy, *'k',in this case is a simple...

    Hello Mr. grupmy,
    *'k',in this case is a simple counter with a range of 0 to 257,changed its name y the way :).
    *And i have been meaning to ask,when is it useful to use system() calls and when is...
Results 1 to 25 of 68
Page 1 of 3 1 2 3