Beispiel #1
0
static PyObject* get_motor_value_python(PyObject* self, PyObject* args){
	int ret,motor;
	PyObject* d;
	if (!PyArg_ParseTuple(args, "Oi", &d,&motor))
		return NULL;
	struct ms_control* data;
	data = (struct ms_control*)PyLong_AsVoidPtr(d);
	ret=get_motor_value(data,motor);
	return Py_BuildValue("i", ret);
}
Beispiel #2
0
Json::Value Moteur::ToJsonFormat()
{
    Json::Value led;
    led["sensor"] = "motor";
    int val = get_motor_value();

        led["value"] = val;

    led["location"] = room;

    return led;
}