Loading...
  Show Posts
Pages: 1 ... 10 11 [12] 13
166  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 29, 2012, 03:44:45 pm
I don't use threads in my applications that communicate with my Arduino. However, it would be an optimization and an option to do so, my programs work very well and I can rely on them without using threads.
167  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 28, 2012, 06:05:57 pm
sorry i cannot help you with that
there is much information on the internet about it

Good Luck!
168  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 28, 2012, 05:05:06 pm
I don't know much about C++ expect of that I use for Arduino language, however I think there can be created GUI applications, too. Have you never created a GUI with C++? You better ask in some C++ forums because this is not Arduino concerning directly even if there might be many members who know C++ programming, if your question is just how to make a GUI with C++ then here is not the right place, I guess.
169  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 27, 2012, 05:19:25 pm
Some example code (untested)
Quote
/*
 KARLOK, 28/7/2012
*/

void setup()
{
  Serial.begin(9600);
  Serial.println("\n[Arduino-Motor] started with 9600 baud ...");
}

void loop() {
  byte rx_data;

  if (Serial.available()) {

    // read the most recent byte (which will be from 0 to 255):
    rx_data = Serial.read();

    Serial.print("Received command: ");
    Serial.println(rx_data, DEC);

    switch(rx_data){  // intentionally omitted 0 because it should be the "set idle mode" command, see below
    case 1: // move motor left
    case 2: // move motor right
    case 3: // move blablabla      
    case 4: // move whatever      
    case 5: // arbitrary commands...
    }
    
    // Clean up last received command.
    // Otherwise you would have a non-stop run of your command after sent once!
    rx_data = 0;  // 0 (zero) is the "set idle mode" command
  }
}




170  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 27, 2012, 05:10:10 pm
Hello.

Quote
control means, if i press right arrow key from keyboard the motors should rotate in one direction and vice virsa [...]
by holding arrow key the motor should keep rotaion unless the key is release
Hint:
First) define a time how long the motor should move when pressed a key once (e.g. 1sec).
Then the code is like the following (pseude code):
rightarrowkey_onkeydown:
if (Gettickcount-a) > 1000  {
send_command();
a=gettickcount;
}
Otherwise the command would be always sent if the rightarrowkey is pressed, that would result in a buffer overflow, I guess. So avoid it. With this code you also include your wish that the signal is sent once when you press short on rightarrowkey .
a is a Dword variable, you  could also use integer for it, both are working.
---
second) you have to write the  Arduino sketch, As far as I understood, you already have one working. Then it will be simple.
Just use Serial.begin(9600); at the beginning or some arbitrary other baud rate for initialization. Then with Serial.read(); you read the data sent to your Arduino via serial communication (datatype should be byte because it's 256bit and thats a char, and chars are sent via serial comm.).

---
third) finish your computer code that controls your arduino "robot motor". I will post an example later...

-------

IMPORTANT question: What programming language are you familiar with? You need one to conrol your Arduino.
171  Using Arduino / Programming Questions / Re: RF12.h: Why is there not definition of 315MHz on: July 27, 2012, 03:55:38 am
Hello.

I have read the datasheet and looked into the corresponding position in the sourcecode of "RF12.cpp".
Additionally, and the really helpful source!!!, I received great help from a electronic engineer.

More detailed:
Look the definition of "uint8_t rf12_initialize (uint8_t id, uint8_t band, uint8_t g)" in RF12.cpp, this function is used to initialize teh RFM12(B) module.
Then, I want to know what paramter has to be changed, of course it was "band" (uint8_t), it was only used once in the function rf12_initialize. That means that this position is the corresponding one to be examined:
Quote
    rf12_xfer(0x80C7 | (band << 4));
(RF12.cpp, l.404)
Look here:
"|" is the logical AND operator, << is a bitshift operator (shifts 4 to the left, that means a hexadecimal unit (2^4=16))
Now consider binary:
1000 0000 1100 0111
Now I need the datasheet ( hoperf : RFM12.pdf ) , see the bottom left table on page 12.
Back to the binary code:
I said << is the bitshift operator, lets apply it on the code, e.g. we use "2" as given in the definition (#define RF12_868MHZ   2) for 868MHz band. Then it is
0000 0010 << 4 ("shift" the 10 ,which is 2 in binary, 4 bits left) = 0010 0000 .
Now do the addition:
0000 0000 0010 0000   +   1000 0000 1100 0111 = 1000 0000 1110 0111
The important binary parts were highlighted.
In the datasheet's table there is written:
315MHz band: b0=0; b1=0. That means we need a zero for both b0 and b1.
That is   1000 0000 1100 0111 .

And it is a lot of fun!

Feel free to ask if there are any questions (maybe explanation was unclear because quickly written).

Regards.
172  Using Arduino / Programming Questions / Re: RF12.h: Why is there not definition of 315MHz on: July 26, 2012, 04:28:26 pm
Problem solved.
It is
Code:
#define RF12_315MHZ     0
.
173  Using Arduino / Programming Questions / Re: RF12.h: Why is there not definition of 315MHz on: July 26, 2012, 09:50:11 am
That would be useless, I think.
These definitions are used in the library to help the user. So, Ican simply write "RF12_433MHZ" instead of the "1". That is more logic for the user but the program translates it into "1" that is understood by the RFM12 module.

But I want the module to understand 315MHz!
174  Using Arduino / Programming Questions / [solved] RF12.h: Why is there not definition of 315MHz on: July 26, 2012, 08:59:20 am
Hello,

in the file RF12.h (RF12 library) ,there is no definition of 315MHz , but the RFM12 module supports this frequency according to its datasheet-.

The lines around (l.28-30) are:
Code:
#define RF12_433MHZ     1
#define RF12_868MHZ     2
#define RF12_915MHZ     3

I want to initialize my module with 315MHz but HOW ?

Thank you
175  Using Arduino / Interfacing w/ Software on the Computer / Re: Sniffing RAW wireless data (433MHz, 868MHz; FSK/ASK) on: July 26, 2012, 07:02:58 am
Perhaps I'm wrong, but I'd expect a FSK receiver to only operate with a FSK transmitter, and a ASK receiver to only operate with a ASK transmitter.
No, that's what I meant, too. Knowing the modulation meant for me to have the ability to demodulate the signal modulated with this type of modulation.

It seems to me that you are looking for receiver that can receiver transmissions from either type of transmitter. No idea whether such a critter exists.
Concerning this, I thought too. And I finally decided to use two devices for this issue. That means one receiver only works with FSK, the other one with ASK. So, I think you're right. It's difficult to find one. The only one, I found, is the ATA5811 - however it seems to be very sophisticated. That doesn't mean I have decided not to want to work with it.

So I will look for one ASK receiver and a FSK receiver separately. Can you recommend one that supports (only)one of these modulations?

They should be as simple as possible, the received data should be given directly at a pin output without trying to decode it.
176  Using Arduino / Interfacing w/ Software on the Computer / Re: Sniffing RAW wireless data (433MHz, 868MHz; FSK/ASK) on: July 26, 2012, 06:14:22 am
Thank you for the fast answer.
As far as I know, the receiver has to "know" in what type of modulation the signal was sent. And I know that the data can be sent via different types of modulation. At home, I have many devices that work with this properties (frequency and modulation type). For me, it is important to get the data they sent, at first the data, not necessarily the actual information. Then, I will try to work with it (what will get the harder part). If there are any questions left, feel free to ask.
177  Using Arduino / Interfacing w/ Software on the Computer / Sniffing RAW wireless data (433MHz, 868MHz; FSK/ASK) on: July 26, 2012, 05:49:27 am
Hello,

as the title suggests, I am interested into sniffing RAW data sent with 433MHz or 868MHz (i.e. ISM band). Modulation is either FSK or ASK.
Can you recommend any receiver to handle this issue, of course with Arduino!

Thank you very much.
178  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 26, 2012, 05:46:30 am
I think you already succeeded in controlling the motors from your Arduino board?
If you did that, the rest will be easy. If not, I think I cannot help you.
Can you show the source code for it? Zhis might help.

Quote
i have to control two DC motors each for X & Y direction motion.
You mean both can move in x and y direction? Or do you mean one motor for x direction, the other one for y?


and also want to know which programming software can i use to create GUI that can communicate with Arduino.

for those issues, I use Lazarus. Lazarus is the IDE, FreePascal its language which is like Delphi.
There is a library called Synapse and you need the synaser unit and its TBlockSerial.
http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html

Then, if you are able to program with Delphi like languages, you can use Mouse.CursorPos.X and Mouse.CursorPos.Y ...
179  Using Arduino / Interfacing w/ Software on the Computer / Re: Program a GUI in C/C++ for arduino and mouse cursor control on: July 23, 2012, 10:22:51 am
Hello,

for those issues, I use Lazarus. Lazarus is the IDE, FreePascal its language which is like Delphi.
There is a library called Synapse and you need the synaser unit and its TBlockSerial.
http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html

Then, if you are able to program with Delphi like languages, you can use Mouse.CursorPos.X and Mouse.CursorPos.Y ...
If you need help, I think I can help you.

Additionally, to be mentioned, that I already controlled my DC motor (connected to my Arduino) via this method. I also wrote a GUI (graphical user interface) for it !

Good luck !

Greetings
180  Using Arduino / Project Guidance / Re: Using RF1100 (CC1100) with Arduino Uno on: July 23, 2012, 08:01:37 am
Can anyone answer the question if the RF1100 will work with the Arduino ?
Pages: 1 ... 10 11 [12] 13