Hi, Habr! My name is Serg Krivoblotsky and I’m an alcoholic iOS developer. I work in a small Kiev company that specializes in iOS development and design for our platform. “Love what you do and do what you love,” they say. We do. Love
The idea of monthly hackathons caught on in our team perfectly well. Once a month, on weekends, the team gathers for entertainment in the form of writing code, learning new technologies, simply generating ideas, or eating pizza. Tasks were different: from the virtual planning poker'a, to the recognition of the price on the check and convert to nat. currency. The main goal of all this is not to release the finished product, but rather to write a working prototype, aka MVP, as you wish. On one of the ideas and its implementation, I would like to tell you more.
Everyone who is in a co-working or a small office has come across this algorithm of his actions:
Coming to the toilet
Oops, busy
You go to the workplace.
Wait until it is free.
There is a problem - there must be a solution. It would be convenient if, while in the workplace, I already knew whether the toilet was currently occupied and whether I should go there. ')
What we need for this:
Light sensor. (Light on == the toilet is busy)
A device capable of reading its readings.
Some PHP and Objective C code.
It was purchased:
Pcduino
The most common analog light sensor
Many wires and several resistors
Working process: I will not write a lot of code, because it is understood as hello world. At the end of the article there will be links to Github.
Connect the sensor to pcduino: The sensor will return values in the range 0..4096. Empirically, it was determined that our light bulb in the toilet when turned on gives: > 3400 - darkness <3400 - light
Raise apache. (previously there was installed ubuntu).
We write php code to read the readings (at the end of the article there are links to GitHub):
... In general, this is all that is needed. Later we added a few buns in the form of a timer and the ability to disable pop-up notifications. Result of work: OSX: