Sisukord:

Jälgijate ja tellijate loendur: 5 sammu
Jälgijate ja tellijate loendur: 5 sammu

Video: Jälgijate ja tellijate loendur: 5 sammu

Video: Jälgijate ja tellijate loendur: 5 sammu
Video: 💐Лалафанфан 🌸Бумажные Сюрпризы🌸Сквиши🌸Пакетики-наклейки?😍🤕Марин-ка Д 2024, Juuni
Anonim
Jälgijate ja tellijate loendur
Jälgijate ja tellijate loendur
Jälgijate ja tellijate loendur
Jälgijate ja tellijate loendur

See projekt on mõeldud instagrami jälgijate ja YouTube'i tellijate lugemiseks.

platvormi kasutatakse:

Python

Arduino

Samm: materjalid / tööriistad:

Materjalid / tööriistad
Materjalid / tööriistad
Materjalid / tööriistad
Materjalid / tööriistad
  • Arduino uno
  • LCD kilp
  • Programmeerimiskaabel
  • Windowsi arvuti

Samm: looge Api -võtmed

Looge Api võtmed
Looge Api võtmed
Loo Api võtmed
Loo Api võtmed

Instagrami jaoks Api

Minge sellele veebisaidile:

ja push genereerige juurdepääsuluba

YouTube'i Api jaoks

Saate järgida samme sellel veebisaidil:

Samm: laadige eskiis Arduinosse üles

Laadige Sketch Arduinosse üles
Laadige Sketch Arduinosse üles
Laadige Sketch Arduinosse üles
Laadige Sketch Arduinosse üles

Koodi ja programme saate alla laadida minu Githubi lehelt:

github.com/ayberkeren/social-media-counter

Arduino kood:

#kaasake

String youtube_name = ""; // teie youtube'i nimi String youtube_token = ""; // sinu youtube'i märgike String instagram_token = ""; // teie instagrami märk on allkirjastamata pikk DELAY = 10; // viivitus ekraanile (sekundid) // seada lcd ekraani tihvtid const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7; LiquidCrystal LCD (rs, en, d4, d5, d6, d7); // luua muutujaid unsigned long järgija = 0, järgija2 = 0, tellija = 0, tellija2 = 0, x = millis (); // logi baitide loomine baitide jaoks instagram1 [8] = {0b00000, 0b01111, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b11111}; bait instagram2 [8] = {0b00000, 0b11111, 0b00000, 0b00000, 0b00000, 0b00000, 0b01110, 0b10001}; bait instagram3 [8] = {0b00000, 0b11110, 0b00001, 0b11001, 0b11001, 0b00001, 0b00001, 0b11111}; bait instagram4 [8] = {0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b01111}; bait instagram5 [8] = {0b10001, 0b10001, 0b01110, 0b00000, 0b00000, 0b00000, 0b00000, 0b11111}; bait instagram6 [8] = {0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00001, 0b11110}; bait youtube1 [8] = {0b11111, 0b11100, 0b11000, 0b10000, 0b10000, 0b10000, 0b10000, 0b10000}; bait youtube2 [8] = {0b11111, 0b00000, 0b10000, 0b11000, 0b11100, 0b11110, 0b11111, 0b11111}; bait youtube3 [8] = {0b11111, 0b00111, 0b00011, 0b00001, 0b00001, 0b00001, 0b00001, 0b10001}; bait youtube4 [8] = {0b10000, 0b10000, 0b10000, 0b10000, 0b10000, 0b11000, 0b11100, 0b11111}; bait youtube5 [8] = {0b11111, 0b11111, 0b11110, 0b11100, 0b11000, 0b10000, 0b00000, 0b11111}; bait youtube6 [8] = {0b10001, 0b00001, 0b00001, 0b00001, 0b00001, 0b00011, 0b00111, 0b11111}; void setup () {lcd.begin (16, 2); // start lcd Serial.begin (9600); // jadaühenduse viivitus (2000); Serial.println (youtube_name); // ütle muutujad programmi viivitusele (1000); Serial.println (youtube_token); // ütle muutujad programmi viivitusele (1000); Serial.println (instagram_token); // ütle programmile muutujad}

void loop () {

if (x <(DELAY*1000)) {drawinstagram (); lcd.setCursor (5, 1); lcd.print (järgija); while (x0) {järgija2 = Serial.parseInt (); abonent2 = Serial.parseInt (); } x = millis (); x = x%(DELAY*2000); } tellija = tellija2; järgija = järgija2; }

else {drawyoutube (); lcd.setCursor (5, 1); lcd.print (tellija); while (x> = (DELAY*1000) && abonent2 == tellija) {while (Serial.available ()> 0) {follower2 = Serial.parseInt (); abonent2 = Serial.parseInt (); } x = millis (); x = x%(DELAY*2000); } tellija = tellija2; järgija = järgija2; }}

// instagrami logo joonistamine

void 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 (bait (0)); lcd.write (bait (1)); lcd.write (bait (2)); lcd.setCursor (1, 1); lcd.write (bait (3)); lcd.write (bait (4)); lcd.write (bait (5)); lcd.setCursor (5, 0); lcd.print ("Jälgijad"); }

// joonista youtubelogo

void 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 (bait (6)); lcd.write (bait (7)); lcd.write (bait (8)); lcd.setCursor (1, 1); lcd.write (bait (9)); lcd.write (bait (10)); lcd.write (bait (11)); lcd.setCursor (5, 0); lcd.print ("Tellijad"); }

Samm: Python

Python
Python
Python
Python

Ma tegin 2 python programmi, millest ühel on graafiline kasutajaliides, teine töötab ainult bashil

saate mõlemat kasutada, tegelikult teevad nad samu asju.

peaksite loendist valima, millise pordi arduino ühendasite ja vajutage valimisnuppu.

ja sa oled VALMIS….

Laadige programmid alla minu Githubist:

ja koodid on allpool …

Samm: VALMIS…

Soovitan: