### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Topics - Junkboy

Pages: [1]
1
##### mc-Innovations / Translate acceleration in G's to textual states.
« on: July 09, 2018, 03:10:42 pm »
Hello community of McThings, I am developing a project, in which I am using a module Mc120, which currently transmits via MQTT the angles of inclination and the acceleration of all its axes, all this information is sent every 3 seconds, since it is Very fast, a battery that in "theory" should last up to 5 years lasts no more than 2 weeks.

What is currently done is to receive the acceleration and tilt of the device in an MQTT server, the information is analyzed to translate the states to a person for example "Walking" or "Running" etc.

What I want to do to save battery is the following:

I think to use the function:
accel.ConfigureMotionInterrupt (1.15, 20.0)

This would cause an interruption when there is an acceleration equal to or greater than 1.15G for more than 2 ms, this is just an example in practice those parameters would change.

The idea would be to set the parameters so that when there is some acceleration the device wakes up and knows that there is movement, then it would have to verify in which case it is.

In my personal experience I know a lot more about the C ++ language so I can imagine it in this way in C ++:

if (accel> = 1.15)
{
state = ON;
}

if (accel> = 1.15 && accel <= 1.
{
printf ("Walking"),
}
if (accel> = 1.81 && accel <= 2.2)
{
printf ("Runing"),
}
if (accel <= 1.15)
{
printf ("Stopped"),
}

With these conditions I seek to make instead of every 3 seconds send me the acceleration etc, better the device stays off until there is some acceleration and send me the message that is what you are doing, in the case of "Stopped" is only to put it because in reality if there is no acceleration greater than 1.15 will not turn on, that's the idea and in fact I also have to do some condition or something so that as long as it is lower than 1.15 send the message "Stopped" but. I do not want them to repeat either, that is if the current state is "Stopped" that sends it only once, if it starts to walk then it sends "Walking" but if it kept walking 15 minutes, do not send me that message again until it change of state

I hope to be explaining, the truth is a bit complicated programming in McStudio for me, but I would like to know if someone can help me to translate this to the language used in McStudio because for example I do not know how to put a conditional with intervals, in the case of "if (accel > = 1.15 && accel <= 1." I do not know how to do it in McStudio, nor am I sure how to make the data not repeat.

I would really appreciate very much if someone could support me a little with this.

Beforehand thank you very much.

2
##### mc-Things General Discussion / How can I put an mcMod120 in sleep mode for 10 minutes and then run the program?
« on: June 25, 2018, 05:36:59 pm »
Basically what I want is to put the mcMod120 to send data 60 minutes, then put it in sleep mode for 20 minutes, then again 60 minutes sending and 20 minutes in sleep mode, and this is repeated infinitely.

I currently use this line to send data every 5 seconds:
Shared Event Publish() RaiseEvent Every 5 Seconds

What I'm going to do, is put in place of 5 seconds, 60 minutes, and I'm looking for a function to put:

Sleep (20 min)

And let this start again ..

3
##### mc-Platform General / Help with the accelerometer (mcMod120)
« on: May 28, 2018, 10:50:21 pm »
Hello, I just started using mcthings, I just bought my kit and the only example I could find that has served me is to take the temperature and voltage of the battery and send the data to Losant.

Now .. I am developing a project in which I need to obtain the accelerometer data, I need to know the inclination in all the axes, all this info I need to send it using MQTT, the continue using Losant could be a good option.

Therefore I would like someone to help me in my search for information since I really have 2 days looking for examples and I can not find anything about the accelerometer, I would even like to know how to use the reef sensor.

I would be infinitely grateful for the help because I am stopped because I do not know how to obtain this information from the sensor.

Beforehand thank you very much.

4
##### mc-Things General Discussion / Help with the accelerometer (mcMod120)
« on: May 28, 2018, 10:50:08 pm »
Hello, I just started using mcthings, I just bought my kit and the only example I could find that has served me is to take the temperature and voltage of the battery and send the data to Losant.

Now .. I am developing a project in which I need to obtain the accelerometer data, I need to know the inclination in all the axes, all this info I need to send it using MQTT, continue using Losant could be a good option.

Therefore I would like someone to help me in my search for information since I really have more than 2 days looking for examples and I can not find anything about the accelerometer, I would even like to know how to use the reef sensor.

I would be infinitely grateful for the help because I am stopped because I do not know how to obtain this information from the sensor.

Beforehand thank you very much.

5
##### FAQ's / Registering New Devices - Help, I'm new in Mcthings
« on: May 27, 2018, 12:50:37 pm »
I'm watching the "Getting started with mcThings" but in the second video the guy type the name of the new device then type the mcUID that I find out that number is in a label in the device but.. when he has to type the "mcREGKEY" he don't say where can I find that "key" so.. idk what number I have to type.

I hope you could understand my problem, and I'm sorry about my english it's not perfect but I thing that you could got my idea.
Thank you.

Pages: [1]