Like Tree2Likes

Hey , I need some help .

This is a discussion on Hey , I need some help . within the C++ Programming forums, part of the General Programming Boards category; But I'm sure that it's C++ programming ....

  1. #16
    Registered User
    Join Date
    Jan 2012
    Posts
    12
    But I'm sure that it's C++ programming .

  2. #17
    Registered User
    Join Date
    May 2010
    Posts
    2,917
    From the first link in a Google search of MCC18.
    MPLAB C Compiler for PIC18 MCUs
    You are using a C compiler, a C compiler does not compile C++ code.

    Jim

  3. #18
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,832
    > I'm only stuck with writing the part whereas the temperature sensor can give me the temperature or data for me to use it .
    Really?

    I mean, you can already do something like attach your motor to your MCU board, and have written some software which reads say switch RB0 to move the motor one way, and reads RB1 to move the motor the other way.

    I'm not so sure you can do that already, since I don't think you've ever written a program for it before.
    You need to just practice writing programs which do simple things just on the board.
    - light RD0
    - light RD0 to RD2 in sequence
    - light RD0 to RD2 in "traffic light" order.
    - light RD0 if RB0 is pressed

    It's all about getting familiar with the tools,
    - how you use the editor to write code
    - how to use the compiler / linker / loader
    - how to get your program onto the MCU to begin with
    - how to figure out where it went wrong (you have NO debugger to help you here, no printf to report progress or anything).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #19
    Registered User
    Join Date
    Jan 2012
    Posts
    12
    Quote Originally Posted by Salem View Post
    > I'm only stuck with writing the part whereas the temperature sensor can give me the temperature or data for me to use it .
    Really?

    I mean, you can already do something like attach your motor to your MCU board, and have written some software which reads say switch RB0 to move the motor one way, and reads RB1 to move the motor the other way.

    I'm not so sure you can do that already, since I don't think you've ever written a program for it before.
    You need to just practice writing programs which do simple things just on the board.
    - light RD0
    - light RD0 to RD2 in sequence
    - light RD0 to RD2 in "traffic light" order.
    - light RD0 if RB0 is pressed

    It's all about getting familiar with the tools,
    - how you use the editor to write code
    - how to use the compiler / linker / loader
    - how to get your program onto the MCU to begin with
    - how to figure out where it went wrong (you have NO debugger to help you here, no printf to report progress or anything).
    I have no trouble writing the part for motor cause mine is one way and I only need to send different voltage if the temperature is different . The light RD0 all , I've done it before . The only trouble I'm having is the AC to DC converter for the temperature sensor . I don't know how to get the figure out .

  5. #20
    Registered User
    Join Date
    Jan 2012
    Posts
    12
    Quote Originally Posted by jimblumberg View Post
    From the first link in a Google search of MCC18.

    You are using a C compiler, a C compiler does not compile C++ code.

    Jim
    Okay , I'm kinda confused . Now I don't know it's C programming or C++ programming .

  6. #21
    Registered User
    Join Date
    Oct 2006
    Posts
    2,588
    Quote Originally Posted by Jun Wei Foo View Post
    The only trouble I'm having is the AC to DC converter for the temperature sensor . I don't know how to get the figure out .
    are you sure it's AC to DC? it would make more sense to be converting analog to digital.

  7. #22
    Registered User
    Join Date
    May 2009
    Posts
    2,768
    The photo he posted for the sensor has an LM35 and what is likely an Op-amp on it.
    So, he likely needs to do analog to PWM.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  8. #23
    Registered User
    Join Date
    Jan 2012
    Posts
    12
    Quote Originally Posted by Elkvis View Post
    are you sure it's AC to DC? it would make more sense to be converting analog to digital.
    Sorry . I think it's converting analog to digital .

  9. #24
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,013
    Quote Originally Posted by Jun Wei Foo View Post
    Okay , I'm kinda confused . Now I don't know it's C programming or C++ programming .
    Either it's using C.
    Or it's using C++.
    Two different languages. Very easy to tell them apart.
    Considering this is a C compiler, you will obviously be using C, and not C++.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21