Talaan ng mga Nilalaman:
2025 May -akda: John Day | [email protected]. Huling binago: 2025-01-13 06:58
Ginawa ang proyektong ito para sa pagbibilang ng tagasunod sa instagram at subscriber ng youtube..
ginagamit ang platform:
Sawa
Arduino
Hakbang 1: Mga Materyales / Tool:
- Arduino uno
- Lcd Shield
- Cable ng programa
- Windows PC
Hakbang 2: Lumikha ng Api Keys
Para sa instagram Api
PUMUNTA Sa Website na Ito:
at itulak ang makabuo ng token sa pag-access
Para sa youtube Api
Maaari mong Sundin ang Mga Hakbang Mula sa website na ito:
Hakbang 3: Mag-upload ng Sketch sa Arduino
Maaari kang Mag-download ng Code At Mga Programa Mula sa Aking Pahina ng Github:
github.com/ayberkeren/social-media-counter
Arduino Code:
# isama
String youtube_name = ""; // your youtube name String youtube_token = ""; // your youtube token String instagram_token = ""; // your instagram token unsigned long DELAY = 10; // antala sa pagitan ng screen (segundo) // set lcd screen pins const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7; LiquidCrystal lcd (rs, en, d4, d5, d6, d7); // create variables unsigned long tagasunod = 0, tagasunod2 = 0, subscriber = 0, subscriber2 = 0, x = millis (); // create bytes for logos byte instagram1 [8] = {0b00000, 0b01111, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b11111}; byte instagram2 [8] = {0b00000, 0b11111, 0b00000, 0b00000, 0b00000, 0b00000, 0b01110, 0b10001}; byte instagram3 [8] = {0b00000, 0b11110, 0b00001, 0b11001, 0b11001, 0b00001, 0b00001, 0b11111}; byte instagram4 [8] = {0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b01111}; byte instagram5 [8] = {0b10001, 0b10001, 0b01110, 0b00000, 0b00000, 0b00000, 0b00000, 0b11111}; byte instagram6 [8] = {0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b11110}; byte youtube1 [8] = {0b11111, 0b11100, 0b11000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000}; byte youtube2 [8] = {0b11111, 0b00000, 0b10000, 0b11000, 0b11100, 0b11110, 0b11111, 0b11111}; byte youtube3 [8] = {0b11111, 0b00111, 0b00011, 0b00001, 0b00001, 0b00001, 0b00001, 0b10001}; byte youtube4 [8] = {0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b11000, 0b11100, 0b11111}; byte youtube5 [8] = {0b11111, 0b11111, 0b11110, 0b11100, 0b11000, 0b10000, 0b00000, 0b11111}; byte youtube6 [8] = {0b10001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00011, 0b00111, 0b11111}; void setup () {lcd.begin (16, 2); // start lcd Serial.begin (9600); // start serial serial delay (2000); Serial.println (youtube_name); // say variable upang maantala ang programa (1000); Serial.println (youtube_token); // say variable sa pagkaantala ng programa (1000); Serial.println (instagram_token); // sabihin na mga variable sa programa}
void loop () {
kung (x <(TANGGULIN * 1000)) {drawinstagram (); lcd.setCursor (5, 1); lcd.print (tagasunod); habang (x0) {tagasunod2 = Serial.parseInt (); subscriber2 = Serial.parseInt (); } x = millis (); x = x% (PAG-ULIT * 2000); } subscriber = subscriber2; tagasunod = tagasunod2; }
iba pa {drawyoutube (); lcd.setCursor (5, 1); lcd.print (subscriber); habang (x> = (TANGGULIN * 1000) && subscriber2 == subscriber) {habang (Serial.available ()> 0) {tagasunod2 = Serial.parseInt (); subscriber2 = Serial.parseInt (); } x = millis (); x = x% (PAG-ULIT * 2000); } subscriber = subscriber2; tagasunod = tagasunod2; }}
// draw instagram logo
walang bisa drawinstagram () {lcd.createChar (0, instagram1); lcd.createChar (1, instagram2); lcd.createChar (2, instagram3); lcd.createChar (3, instagram4); lcd.createChar (4, instagram5); lcd.createChar (5, instagram6); lcd.clear (); lcd.setCursor (1, 0); lcd.write (byte (0)); lcd.write (byte (1)); lcd.write (byte (2)); lcd.setCursor (1, 1); lcd.write (byte (3)); lcd.write (byte (4)); lcd.write (byte (5)); lcd.setCursor (5, 0); lcd.print ("Mga Sumusunod"); }
// draw youtubelogo
walang bisa drawyoutube () {lcd.createChar (6, youtube1); lcd.createChar (7, youtube2); lcd.createChar (8, youtube3); lcd.createChar (9, youtube4); lcd.createChar (10, youtube5); lcd.createChar (11, youtube6); lcd.clear (); lcd.setCursor (1, 0); lcd.write (byte (6)); lcd.write (byte (7)); lcd.write (byte (8)); lcd.setCursor (1, 1); lcd.write (byte (9)); lcd.write (byte (10)); lcd.write (byte (11)); lcd.setCursor (5, 0); lcd.print ("Mga Subscriber"); }
Hakbang 4: Python
Gumawa ako ng 2 python program ang isa sa mga ito ay may isang graphic na interface ng gumagamit ang isa pa ay gumagana lamang sa bash
maaari mong gamitin ang pareho sa kanila talagang gumagawa sila ng parehong mga bagay.
dapat mong piliin kung aling port ang iyong naka-plug arduino mula sa listahan at itulak ang select button.
at Tapos ka na ….
Mag-download ng Mga Programa Mula sa Aking Github: