|
May I know why I need to reformat my message with
tags. Is it HTML?
|
|
|
|
|
Please, read this[^]. Putting your code inside <pre></pre> tags will make it much more readable (now, your code is very hard to read).
|
|
|
|
|
I have put my code inside <pre></pre> tags =)
|
|
|
|
|
I think your own message have answered your question.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Are you referring to the code below?
char MESS4[21] = {"CellID | 15831-32\n\x1A"}; //Example of sending CellID
This code is set as the prefix value to simulate the sending of Cell ID via SMS. It does not simulate the retrieving of the Cell ID automatically.
|
|
|
|
|
No, I was referring to your question:
[quote]
May I know why I need to reformat my message with tags. Is it HTML?
[/quote]
And the answer is obviously... yes. Now your code in the original question is much more readable and the help you need will come easily. Just keep an eye to new answers hanging on your original message, that's the good point of the tree-view of the threads.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
modified on Wednesday, December 23, 2009 6:24 AM
|
|
|
|
|
On the other hand, I can not help you so much because I have not used that components, but I am going to make you some questions (and the answer to this points should be added in the original question) trying to isolate where the problem is:
- Have you tested your programm?
- You say want you want/need to have, but what are you actually getting?
- Is there any compiler errors? If yes, which ones and referred to which line?
- A short explanation about what each external component do and how it is supposed that C interact with them, would not be bad.
The point is: you are using very specifical components, that can be the source of your "not working" status, and this has not so much with C contents, so it may happen that the people that could help you with the C programm doesn't have the needed information about the extern components you are using.
This can be translated to: Your code may be "gramatically" correct, but the parameters for the interaction with the other components are not correct. So the program does not do what you want it to do.
I have found this places using google. Take a look, they may eventually help you:
http://www.microchip.com/forums/tm.aspx?m=382659&mpage=1&key=timer%2cdelay񝛃[^]
http://old.nabble.com/PIC18-for-the-clueless-td21283504.html[^]
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231118910[^]
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I have added new info for the question I posted. Thanks
|
|
|
|
|
You are welcome.
[quote]
It is able to send the fixed Cell ID out. However, there is something wrong with my codes. Firstly, it is still unable to detect the acceleration. Secondly, I still unable to write the code to get the Cell ID automatically. The iWOW module is only recognised AT command.
[/quote]
As I supposed, if you can send the Test-ID out, your problem is in the interaction with the external components.
Have you checked out the links I gave you? I think I have seen an #include in one of the posts that you don't have.
I don't have enough knowledge to tell you a solution, but I am going to tell you some points I have notized or I would make to find out where the error is.
- In your "InterruptHandlerHigh()" you have 2 nested IFs without any else. I would add the elses with a pulse to a not used output of the microchip or sendind a message with "Error_IF_x" where X is the code (you told sending a fixed mesage is working ok). Because as it is you dont know which conditions is failing (if they fail).
- I see no call to your function add_accelerometer. You declare it, you program it, but you don't call it anywhere.
- In your main function you have a endless loop with the "while (1)", so the first time you get into it the variable "ADCON0" is =0b00000001 and you get "X1", then you change it to "ADCON0=0b00000101;" and get "Y1" and then you change it to "ADCON0=0b00001001;" to get Z1, but as it is a loop the next time it starts again you are missing the needed "ADCON0=0b00000001;" to read X1 a second time.
That will make you unable to read X1 until your main function starts again.
- What are ADRESSH and ADRESSL and where do they come from? I haven't seen them in your code. I guess they are constants and they are defined in one of the included .h, but if not...
I hope it helps you.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Sorry, for the late reply.
Actually, for X, Y and Z (accelerometer part), I would like to read only once and store in the array. Whereas for the X1, Y1 and Z1 is to keep on reading it. If there is the changes of value >15 or <15 in any axis, it will trigger the accelerometer and send the signal to the PIC Controller. May I know how I could insert it inside my code?
For ADRESH and ADRESL, I did some researched on it. It is used to convert the analog signal to digital. If we used WATCH on the MPLAB, it will able to show the value there. However, I am not sure if I have to include any library (.h) file in my programming.
Merry X'mas and Happy New Year
|
|
|
|
|
[quote]
Sorry, for the late reply.
[/quote]
No problem, holidays are holidays
[quote]
Whereas for the X1, Y1 and Z1 is to keep on reading it
[/quote]
Ok, but did you check what I said you about "ADCON0"?? and about the endless loop / initialization of variables?
[quote]
If there is the changes of value >15 or <15
[/quote]
Not sure about what you mean... Changes bigger than 15 units in one or the other direction? or just a value different of 15?
If the first, then you can do (absolute value or module) |lastValue - actualValue| > 15
If the second, then actualValue != 15
Put the conditions in an IF and then call your function.
[quote]
For ADRESH and ADRESL, I did some researched on it. It is used to convert the analog signal to digital. If we used WATCH on the MPLAB, it will able to show the value there. However, I am not sure if I have to include any library (.h) file in my programming.
[/quote]
If you need to use specifical functions to interact with them (and it seems so), I am not sure but I think you will do have to include something, a library, a header, a dll or whatever the components need.
Sorry, but your program is very, very specifical and the extern components make it even harder to follow/understand what happens. I have no experience at all with them. I have given you some feedback about what I saw at the first sight, but I can not help you in a deeper way.
I hope you can solve it.
My last tip is:
Investigate a bit more, and reask in a future. But not just repeating the question: improve, change and make it more specific. Demostrate that you have done research and tried to solve it, but put a link to this thread in your new question, so the people can get the scenario and read all your comments / additional information.
I would make it in parts, first try to do a good structure for a C program. Puting pseudocode and a lot of comments where you need to do the external interactions, but in fact only doing tiny actions just to check if that part of code is executing as you want or not. Once you have your C program, continue with only one external component and get it to work, then the next one. If you try all at once, you will have a lot of potential error-factors and will be very, very difficult to isolate where the problem is.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hello everyone !
How to use SendMessage or PostMessage to send "ALT + A" event ?
SendMessage(hWnd,WM_KEYDOWN,VK_MENU,0);
SendMessage(hWnd,WM_KEYDOWN,'A',0);
SendMessage(hWnd,WM_KEYUP,'A',0);
SendMessage(hWnd,WM_KEYUP,VK_MEUN,0);
why not ?
|
|
|
|
|
wangningyu wrote: How to use SendMessage or PostMessage to send "ALT + A" event ?
SendMessage(hWnd,WM_KEYDOWN,VK_MENU,0);
SendMessage(hWnd,WM_KEYDOWN,'A',0);
SendMessage(hWnd,WM_KEYUP,'A',0);
SendMessage(hWnd,WM_KEYUP,VK_MEUN,0);
I think that when ALT is pressed, windows posts a WM_SYSKEYDOWN and not a WM_KEYDOWN . You should fireup spy++ and try pressing ALT+A on the said application to see what messages are actually posted (and in what sequence). You could try posting the same from your program.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
You can consider using SendInput() or keybd_event() function.
|
|
|
|
|
This function can used if only that the window be the first windows.
I want it behind.
|
|
|
|
|
So, you could use PostMessage as you rightly indicated in your original query. Did you try my suggestion of finding out the messages posted with spy++?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Then I think you can proceed with what Rajesh has suggested. Use Spy++.
|
|
|
|
|
HI,
I have a CString csPoints=_T("122/23/45/90");
how can i split the above string and need to get the numeric values from the above string..
|
|
|
|
|
kumar sanghvi wrote: have a CString csPoints=_T("122/23/45/90");
how can i split the above string and need to get the numeric values from the above string..
You might use AfxExtractSubstring()[^].
CString has three methods - Mid[^], Right[^], and Left[^]. You may use these functions. Sorry, brain fart.
And for converting a string to a number, you could use something like _ttoi[^]
“Follow your bliss.” – Joseph Campbell
modified on Wednesday, December 23, 2009 1:06 AM
|
|
|
|
|
Good finding
Величие не Бога может быть недооценена.
|
|
|
|
|
Well thank you.
But you've selected the "rant" icon (for your message type), which should be used while you're angry about or ranting about something.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|
Command line error D8016 : '/MTd' and '/clr' command-line options are incompatible
I got this error when i change my Common RUntimesupoort to \clr.
Because i want this option told by some article to use WPF and C#dll in my project.
How can i avoid this error?
I have coonvert vc6.0 to VC++2008.
Anu
|
|
|
|
|
|
I've got a problem trying to define / restrict function accessibility in C++ classes. I'm using the VS2008 compiler, since that does make a difference -- there's a solution using a friend helper class that worked prior to VS2005 but doesn't any more since MS fixed a bunch of conformity error in the later compilers.
I have a base class, an asynchronous callback coming from the OS, and a derived class. The async callback needs to manipulate some of the private variables in the base class. The derived class must NOT be allowed to manipulate those variables and, as such, cannot be allowed to call the function that does so.
My question is how do I modify the following code snippets to do what I want. Don't worry about re-entrancy issues with the callback - that's been removed for the sake of clarity.
baseclass.h
class BaseClass
{
public:
BaseClass ();
void BaseFuncA ();
private:
void CallbackFuncA ();
}; baseclass.cpp
void CALLBACK AsyncCallbackFunc (DWORD dwParam)
{
((BaseClass *) dwParam)->CallbackFuncA ();
}
void BaseClass::BaseClass ()
{
}
void BaseClass::CallbackFuncA ()
{
} derivedclass.h
#include "BaseClass.h"
class DrvClass : public BaseClass
{
public:
DrvClass ();
void DerivedFuncA ();
}; derivedclass.cpp
void DrvClass::DerivedFuncA ()
{
BaseFuncA ();
}
Thanks!!
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|