Main Menu

General Tutorial?

Started by bluestribute, June 28, 2016, 02:18:53 PM

bluestribute

I just got two Moteinos. As arduinos, they work flawlessly, but is there any sort of "general tutorial" out there to familiarize myself with the different functions, such as radio.sendWithRetry? I'm trying to measure sensor values with one moteino, and transfer those values to the other moteino.

Felix

There are a bunch of examples that illustrate how to use the radios.
Also throughout the forum and especially in the Projects forum there are many other examples posted by users.
If you google around, you will find some people have done videos on their projects with Moteino, some of which include code overview.

bluestribute

Right, I've seen all of them and have a few open now. But nothing has actually gone over what each thing does. How do I send data between boards? How can I read a certain value between board? Do both boards need the same exact code or can I have one just measuring specific things and have a completely different code on the second board using those values? I haven't found anything that goes over the basics like that.

Felix

The given samples are just that, examples. You are of course expected and encouraged to change them to fit your needs.

You ---> ~~~ *** !!! MUST !!! *** ~~~ <--- change/verify the radio settings in each sketch to match the hardware radio you have on the unit you load it, otherwise nothing will work correctly. Adjust settings like network/node ID and encryption key to your desire.

All what you mentioned is covered in one way or another by the examples. Please take another minute to look at the list, some sketches are for specific kits, others are general examples, naming self-explanatory, and each sketch has comments as to what it does, most have additional comments.

See the RandomNumbers example to see how to send dummy numbers.
The Node and Gateway are simple examples that show how to send strings continuosly (and ACKs) from between the node and gateway sketches.

Check the blinkTXRX sketch for an illustration of how to send and do something (with the onboard LED) when you press a button at either end.

bluestribute

Yeah I had blinky, send, and receive open, but they don't comment the different functions you can do with radio. Like what's radio.DATA? Is that how a variable is received? Can I set a variable as radio.DATA on the receiving end? Does it have to be a char, 'cause I'm trying to send int values? How can I make sure board 1 is sending to board 2?

I mean, look at this from Arduino: https://www.arduino.cc/en/Reference/If . You can go through, see how to use the command, and then see examples. I'm not looking for something that in depth (though that would be amazing), but I'm on my own not only deciphering with minimal comments, but then figuring out how to use the new commands, what parameters they use, etc.

Felix

I'm afraid there isn't a dedicated page to explain every variable and function in the library. I agree that would be amazing :)

Most vars and functions are given self-explanatory names. Looking at the source code of the header (.h) and the actual implementation (.cpp) would reveal functions descriptions, definitions, and also comments of what they do in some cases. Also the examples show how to use them. I know you'll say they don't explain every line in detail but its WYSIWYG.

IMHO I think having working examples that just work with minimal settings changes, is a great advantage over just having some documentation that explains in detail what a function does.

I'm afraid there is no fast-food drive through for these things. The only shortcut here is working examples and a great support forum where you will find a lot of answers and help, if you actually give it a try and a chance.

I will try to make more videos or writeups on getting started but each person is looking to do something different so it's hard to cover everything and make everyone happy with a common general set of tutorials.

bluestribute

I haven't looked within the .h and .cpp files, so I'll do that now.

Than with these examples, how exactly are they sharing? Do both boards, for instance on blinky, have the same code, and you just change whether you have board 1 or 2? So would I need to upload the same code to each board, despite wanting only one board to read sensor values and one to execute with those values?

Felix

#7
See ladyada do it, that will clear a few questions, she shows the wiring and explains what the code does:

https://youtu.be/n_fJoKhSk3g?t=21m50s