Pages: [1]   Go Down
Author Topic: Question with coding?  (Read 462 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have this http://www.goodluckbuy.com/apc220-wireless-communication-module-for-arduinousb-converter.html

I'm really lost as how to program it. I have found no tutorial or guide in any way to interface with it. I'm really an Arduino newbie, so it may be something really obvious that I'm overlooking.

Any tutorials or advice? Do I use the Serial.read() methods?

Even other tutorials or advice on any other type of Arduino to Arduino communication would be helpful. I can tweak the code if I have a foundation, but I really don't even know where to begin.

Thanks! smiley I appreciate any help!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46240
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You didn't really knock yourself out searching, did you?
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272560465
Connect the wires and use Serial.print(), Serial.write(), or Serial.println() to send data to it.

Use Serial.available() and Serial.read() to get data from it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I actually did. I've searched and searched, but I have not found anything plausible.
Thanks for the link, I'll check it out and get back to you.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12483
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The APC220 is manufactured by DFrobot

- http://www.robotshop.com/content/PDF/dfrobot-apc220-manual.pdf -

Connect the device just to the hardware Serial  and you can use

if (Serial.available()) { c = Serial.Read(); }

etc
Baudrate should be 9600 according to manual  - not 19200 as in the link you gave ..

your turn smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And I assume c would represent either an int or a String, correct?

Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24449
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
or a String,
Incorrect.
"c" would be an "int", the return type of "Serial.read ()".
The only reason it is an "int", is so that the function can return -1 (0xffff, not to be confused with 0x00ff) in the case where "read" is called, but the receive buffer is empty.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I could just assign different ints to the different inputs I would have? Like if button 1 is pressed, c = 1. If button 2 is pressed, c is 2... etc.? Or is that just really bad design?

I'm asking this because one of the Arduinos will be linked to a controller through BlueTooth... I want the Arduino to actually do things when the controller tells it too... smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 43
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've also seen that maybe Virtual Wire would be useful.

Also, would there be a *slightly* similar setup to the Master Reader/Slave Receiver setup?
Logged

Pages: [1]   Go Up
Jump to: