But I'm sure that it's C++ programming .
But I'm sure that it's C++ programming .
From the first link in a Google search of MCC18.
You are using a C compiler, a C compiler does not compile C++ code.MPLAB C Compiler for PIC18 MCUs
Jim
> 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 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 .
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.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson