Search:

Type: Posts; User: dcwang3

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    21
    Views
    4,091

    yeah so I checked this int setValue = 0;...

    yeah so I checked this



    int setValue = 0;
    int feedbackValue = 0;
    static int errorValue = 0;
    static int prevError = 0;
    static int integral = 0;
    int derivative = 0;
  2. Replies
    21
    Views
    4,091

    the max range that I need is from -20,000 to...

    the max range that I need is from -20,000 to 20,000. So obviously I don't need signed long. Do you think switching to a smaller type like int16_t would be better and have less problems? I modified a...
  3. Replies
    21
    Views
    4,091

    As far as compiler version, I think I have AVRGCC...

    As far as compiler version, I think I have AVRGCC 3.4.1.95 that has GCC 4.6.2 for 8-bit AVR microcontrollers.

    I am using Atmel Studio 6 for the IDE.
  4. Replies
    21
    Views
    4,091

    I tried the 255L and -255L but that didn't work....

    I tried the 255L and -255L but that didn't work.
    I also just printed out the signed long output = -255, and it prints out -255. So that looks fine
  5. Replies
    21
    Views
    4,091

    I'll try that on the hardware to see what happens

    I'll try that on the hardware to see what happens
  6. Replies
    21
    Views
    4,091

    Yeah I have checked that that statement is being...

    Yeah I have checked that that statement is being hit.

    I have also checked that errorValue becomes negative. Everything up to the output IF statement is correct, I made sure of that by printing...
  7. Replies
    21
    Views
    4,091

    thanks for the replies KP,KI, and KD are macro...

    thanks for the replies

    KP,KI, and KD are macro define statements, as shown below for right now.
    #define KP 5
    #define KI 0
    #define KD 0

    I don't know what compiler I am using, I guess GCC...
  8. Replies
    21
    Views
    4,091

    Here is the actual function. I have isolated...

    Here is the actual function.

    I have isolated the problem between

    output = (KP*errorValue) + .....

    and the IF statement that limits output between -255 and 255... It works when output is...
  9. Replies
    21
    Views
    4,091

    Signed Long comparison in IF Statement

    So I am writing C code for firmware on an 8-bit microcontroller.

    I am trying to determine why my code does not work for negative numbers.

    Below is a code snippet that is sort of an example:

    ...
  10. Replies
    7
    Views
    8,698

    So I read that tutorial and other articles about...

    So I read that tutorial and other articles about HTTP protocols....In my case, in the main program (easyweb.c), it essentially setups the ethernet controller, etc... Then it hits the main while loop...
  11. Replies
    7
    Views
    8,698

    well, I suppose that if a GET request from the...

    well, I suppose that if a GET request from the web browser occurs, how is it received by the ethernet controller? Does it automatically get transfer to the RXdatabuffer of the ethernet controller?
  12. Replies
    7
    Views
    8,698

    here are the rest of the attachments ...

    here are the rest of the attachments

    cs8900.c/.h --> contain the ethernet driver information
    webside.c --> webpage
    tcpip.h/.c --> the TCP/IP stack
    easyweb.c/.h --> contain the main program and...
  13. Replies
    7
    Views
    8,698

    HTTP Get request to C Program

    I am trying to modify code from the Olimex EasyWeb3 board. It uses an MSP430F149 and a crystal lan cs8900a ethernet controller. There is a sample code for a simple web server. I am interested in...
  14. oh so basically the original code changes only...

    oh so basically the original code changes only the bits you are interested in either using an OR operator to turn something on, and an AND operator to turn something off.

    Also, when they have the...
  15. Ok, here is my code. There is 1 warning and it...

    Ok, here is my code.

    There is 1 warning and it says, statement with no effect...It is for the for loop statement near the end in the main section. Do you know what the problem is?


    ...
  16. Is there another way to write it to have the same...

    Is there another way to write it to have the same function? I'm just sort of having a hard time visualizing it as that.

    Can it be like:




    _delay_ms(half_period);
    BUZZER_PORT = 0x01;...
  17. but what does the (1

    but what does the (1 << BUZZER_PIN) do? that's what I don't understand
  18. well, I guess I am looking for more of a general...

    well, I guess I am looking for more of a general answer.

    But here is what I am using. ATMEL ATMEGA324P, with AVR Studio 4 as my environment. And basically, I am going to have a piezo buzzer...
  19. Output music tone from piezo buzzer algorithm, NEED HELP!

    I am trying to figure out how to write a c program/algorithm that will output music tone (like middle C, C#, D, etc...). I am using an ATMEGA324P chip, and coding in C.

    I am trying not to use the...
  20. Replies
    15
    Views
    5,031

    I actually found out what the problem wrong...

    I actually found out what the problem wrong...
  21. Replies
    15
    Views
    5,031

    if(sort_input == 'n') //NAME SORT ...

    if(sort_input == 'n') //NAME SORT
    {
    for(i = 0; i...
  22. Replies
    15
    Views
    5,031

    when you have an array like this: ...

    when you have an array like this:

    entry[i].name

    Can you automatically assume that it is a pointer and you can assign it to 0 or \0 like this:

    entry[i].name = 0 or entry[i].name = '\0'

    I...
  23. Replies
    15
    Views
    5,031

    ok so here is part of the code I am working on,...

    ok so here is part of the code I am working on, it's sort of a manipulation of the code from above:



    if(sort_input == 'n') //NAME SORT ...
  24. Replies
    15
    Views
    5,031

    also, is folders[i].nfield[0] = '\0'; ...

    also, is



    folders[i].nfield[0] = '\0';

    is the same thing as this?
  25. Replies
    15
    Views
    5,031

    Adak: for(i = 0; i < k-1; i++) { ...

    Adak:



    for(i = 0; i < k-1; i++) {
    for(j = i+1; j < k; j++) {
    if(strcmp(folders[i].nfield, folders[j].nfield) > 0) {
    name = '\0';
    strcpy(name,...
Results 1 to 25 of 117
Page 1 of 5 1 2 3 4