Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1427 Posts: 7608
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 81 Posts: 350
I am writing this post to ask for some suggestions for a project involving the programming of the XDK.
What I would like to realize is a simple system able to keep track of how many times one of the two buttons is pressed during a day. The value should be then accessible 24/07 on internet.
My first question is if such application can be realized, and, if so, how much effort it would require. My knowledge in programming and network is unfortunately quite basic (I took an informatic lecture at the university, and I have some experience in programming in fortran and matlab). Therefore, I would like to ask you some advises on what would be the easier way to implement such application ( like how to structure the program, which protocol use, or suggestions like which reference use for lerning C,which functions may be helpful; to sum up everything which can be helpful for a complete beginner).
Other questions are:
Would it be possible to set up a connection between the XDK and the user so that the XDK will comunicate the values only when asked?
Suppose I have two XDKs, would it be possible to connect the two XDKs together, in order to obtain directly the sum of the two different values?
Thank you very much in advance for the help.
Hello Maicol, Welcome to the XDK community. I guess your application can be implemented relatively easy with medium effort for an experienced user. First my suggestions about the implementation, do not be afraid if anything is currently unclear. You can use the LedsAndButtons example as starting point to implement the counting of the button presses. In the example is the button functionality already included and you would have to implement the transmission of the current count (or only the event that the button is pressed) via MQTT (or LWM2M). I would recommend such a lightweight protocol to avoid overhead. Further you need a web server which takes the incoming data from the XDK, stores it and makes it available on any interface. With the server backend you can easily manage two XDK sending events. I assume you do not need to connect them directly. I assume this project will be a challenge for you since there are several parts to implement and understand. I would recommend to get some basic understanding about C, networking and MQTT, (e.g Programming in C online tutorials or books) since I assume this is very easy to understand. Further I would suggest to got through our "basic and beginner guides" to get familiar the XDK and according environment. Please tell me if this is helpful and do not hesitate to ask if you have further questions. Kind regards, Manuel
Do you wish to send commands to the XDK to post the number of clicks? If so, perhaps you can look into the bluetooh example too.
Or you can make it send HTTP posts to a google sheet every time a button is pressed.