This is an old revision of the document!
My project is a food device which dispenses a specified quantity of candies every time a certain melody is playing and when the sensor detects the presence of a hand.
The idea of the project started when my friend received a cat as a present and she was struggling to teach her cat when it is time to eat and when it is not. Of course, I adapted it to dispense candies, not cat food, given the fact that I don't have one.
The purpose of the project is to teach your cat when it is time for her to eat and when it is not. This will be a relieve for the owners, not having to worry that if they leave the cat at home, she will eat all the food at once.
I believe that this project is useful for others because you can control the amount of food and also the time when the device will dispense the food. The fact that you can control it from your phone is a big plus especially that you can't guess when the cat is in front of the device.
-~~~~~~~~~~~~~~~~~-
Pavlov's Cat
-~~~~~~~~~~~~~~~~~-
This is the block schema of the project
This is the scheme with all the components connected.
Code description
First of all, we include all the libraries needed for Arduino, but also for the wi-fi and telegram part. We set the portion to the default value of 1, we declare the servo object, we declare the buzzerPin (i used pin 6 on the Arduino board), we set the initial value of startDetecting as being false, the timer will be 0, also the oldchatid will be null. In the method setup() we are starting the connection at wi-fi, we declare the token of the telegram bot, we declare the emoji used at the telegram keyboard, initialize the rows of the keyboard, and also we make the buzzerPin an output. In the loop method we check if there are any updates in the chat and if there is an update, we will print the message (the codes used for the keyboard emoji). If the text is indicating melody and food, then we play a certain melody, we display a message, the detection begins, we display a message that the servo is moving and we also calculate the time that
Fişierele se încarcă pe wiki folosind facilitatea Add Images or other files. Namespace-ul în care se încarcă fişierele este de tipul :pm:prj20??:c? sau :pm:prj20??:c?:nume_student (dacă este cazul). Exemplu: Dumitru Alin, 331CC → :pm:prj2009:cc:dumitru_alin.