Cov txheej txheem:

Cov Ntawv Teev Npe "Smart Cities Hackathon Qualcomm17": 13 Kauj Ruam
Cov Ntawv Teev Npe "Smart Cities Hackathon Qualcomm17": 13 Kauj Ruam

Video: Cov Ntawv Teev Npe "Smart Cities Hackathon Qualcomm17": 13 Kauj Ruam

Video: Cov Ntawv Teev Npe
Video: Nco Txog Hmoob - Xf. Txawj Pes Vaj & Fishermen's Project (Live Session) [Lyric Video] 2024, Kaum ib hlis
Anonim
Cov khoom lag luam tub rau khoom
Cov khoom lag luam tub rau khoom

Hauv cov ntawv tom ntej, koj tuaj yeem pom cov txheej txheem ntawm kev tsim kho thiab kev tsim kho ntawm lub tub rau khoom ntse. Lub tub rau khoom no tau teeb tsa hauv Dragon Board 410c, nrog lub hom phiaj los txhim kho lub nroog kom zoo. Txoj haujlwm yog ib feem ntawm kev sib tw "lub nroog ntse hackathon Qualcomm 17".

Lub tswv yim ntawm txoj haujlwm no pib nrog teeb meem uas tsawg tus neeg pom, uas yog kev ploj thiab kev tswj tsis zoo ntawm cov cuab yeej thiab cov khoom siv uas tau muab los ntawm cov tuam txhab xws li cov chaw tsim khoom thiab txawm tias tsev kho mob. Hauv cov chaw no, qee cov ntaub ntawv thiab cov cuab yeej tau muab rau cov neeg ua haujlwm los ua cov haujlwm, cov khoom siv thiab cov cuab yeej no yuav tsum rov siv dua vim tias lawv kim heev lossis tsis muaj peev txheej kev lag luam los hloov lawv.

Hauv tsev kho mob, muaj cov neeg uas tswj hwm cov ntaub ntawv uas raug tshem tawm, tab sis thaum muaj tib neeg cuam tshuam muaj qhov yuam kev, uas tuaj yeem ua rau cov nuj nqis tsis tsim nyog. Qhov kev daws teeb meem zoo tshaj plaws yog lub tub rau khoom ntse uas muaj peev xwm tswj hwm cov khoom lag luam ntawm cov khoom uas tau qiv thiab xa rov qab thiab tib lub sijhawm paub leej twg yog tus muaj lub luag haujlwm.

Kauj ruam 1: Cov ntaub ntawv

Cov ntaub ntawv xav tau rau txoj haujlwm yog qhov txuas ntxiv: 1 x Dragon Board 410c

1 x Sensor Mezzanine 96 Boards rau Dragon Board 410c

1 x Breadboard

1 x MDF (Medium Density Fiberboard) ntawv 61 x 122 cm

5 x sensor CNY 70

1 X TIP31B

1 x electromagnet

Ib x7408

1 x Keyboard

1x screen ua

3 x vug

Kuj (ntau yam)

Cov xov tooj tooj liab

Kua nplaum

Laum

Kauj Ruam 2: Txiav daim rau lub tub rau khoom hauv MDF. (Kom Ua Tau Zoo dua Siv Laser Cutter)

Txiav daim rau lub tub rau khoom hauv MDF. (Kom Ua Tau Zoo dua Siv Laser Cutter)
Txiav daim rau lub tub rau khoom hauv MDF. (Kom Ua Tau Zoo dua Siv Laser Cutter)

Kauj Ruam 3: Muab txhua daim ua ke ua ib lub tub rau khoom nrog ob daim me me thiab ib qho loj

Kauj Ruam 4: Ntsia Cov Ntsia Hlau nyob Nruab Nrab ntawm Txhua Lub Tub rau khoom

Ntsia Cov Ntsia Hlau nyob hauv Nruab Nrab ntawm Txhua Lub Tub rau khoom
Ntsia Cov Ntsia Hlau nyob hauv Nruab Nrab ntawm Txhua Lub Tub rau khoom

Kauj Ruam 5: Nrog Kev Laum Ua Qhov Los Ntawm Tus Tub rau khoom hauv Sab Nrauv Sab, Lub Qhov Yuav Tsum Yog Qhov Loj ntawm Lub Sensor

Nrog Lub Laum Ua Qhov Los Ntawm Tus Tub rau khoom hauv Sab Nraud, Lub Qhov Yuav tsum yog Qhov Loj ntawm Lub Sensor
Nrog Lub Laum Ua Qhov Los Ntawm Tus Tub rau khoom hauv Sab Nraud, Lub Qhov Yuav tsum yog Qhov Loj ntawm Lub Sensor

Kauj Ruam 6: Weld Txhua Lub Sensor CNY 70 Nrog Cov Tooj Tooj. (rov ua dua 4 zaug ntxiv)

Weld Txhua Sensor CNY 70 Nrog Cov Tooj Tooj. (rov ua dua 4 zaug ntxiv)
Weld Txhua Sensor CNY 70 Nrog Cov Tooj Tooj. (rov ua dua 4 zaug ntxiv)

Kauj Ruam 7: Ib Qhov Tshwj Xeeb Circuit Court tau siv rau Sensor

Ib qho tshwj xeeb Circuit Court tau siv rau Sensor
Ib qho tshwj xeeb Circuit Court tau siv rau Sensor

Kauj Ruam 8: Txuas lub Sensor Mezzanine rau Dragon Board 410c. (siv nkag mus rau GPIO)

Txuas lub Sensor Mezzanine mus rau Dragon Board 410c. (siv nkag mus rau GPIO)
Txuas lub Sensor Mezzanine mus rau Dragon Board 410c. (siv nkag mus rau GPIO)

Nws yog ib qho tseem ceeb heev uas cov kauj ruam no yuav tsum tau ua los ntawm daim phiaj zaj, yog tias nws tsis tuaj yeem hlawv, ntxiv rau txhua tus lej PIN yuav tsum tau muab tso kom raug.

Kauj Ruam 9: Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine

Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine
Txuas lub Circuit Court los ntawm Breadboard mus rau Mezzanine

Kauj Ruam 10: Sau lossis Luam Txoj Cai

#suav nrog #suav nrog #suav nrog // #suav nrog

#suav nrog "libsoc_gpio.h"

#suav nrog "libsoc_debug.h" #suav nrog "libsoc_board.h"

/ * Qhov me ntsis ntawm cov lej hauv qab no ua piv txwv no ua haujlwm ntawm txhua 96Boards */

unsigned int LED_1; // electro nim

unsigned int BUTTON_1; // thawj sensor

unsigned int BUTTON_2; // sensor thib ob unsigned int BUTTON_3; // kaw unsigned int BUTTON_4; // sensor thib peb

struct Tus neeg siv {

char tus neeg siv lub npe [20]; tus password [20]; } Tus neeg siv;

struct Database {

tsab xov xwm_Name [20]; char Qhov chaw [20]; } Cov ntaub ntawv;

tus sensor 1;

tus sensor 2; tus sensor 3;

int sensor1_last_state;

int sensor2_last_state; int sensor3_last_state;

char tus neeg siv lub npe [50];

tus password [50];

Yog YesNo [40];

Cov ntaub ntawv *pFILE;

char Yog [20] = {"Yog"};

int ua = 1;

_attribute _ ((constructor)) zoo li qub tsis muaj dab tsi _init ()

{board_config *teeb tsa = libsoc_board_init (); BUTTON_1 = libsoc_board_gpio_id (teeb tsa, "GPIO-A"); // nrig nrig sensor BUTTON_2 = libsoc_board_gpio_id (teeb tsa, "GPIO-C"); // thib ob sensor BUTTON_3 = libsoc_board_gpio_id (teeb tsa, "GPIO-D"); // kaw khib BUTTON_4 = libsoc_board_gpio_id (teeb tsa, "GPIO-B"); // thib peb sensor // BUTTON_5 = libsoc_board_gpio_id (teeb tsa, "GPIO-E");

LED_1 = libsoc_board_gpio_id (teeb tsa, "GPIO-E"); // electro nim

libsoc_board_free (teeb tsa); } / * Xaus ntawm 96Boards tus lej tshwj xeeb * /

int lub ntsiab ()

{gpio *led_1, *button_1, *button_2, *button_3, *button_4; // int kov; struct Tus neeg siv Karina; struct Tus Thawj Tswj Tus Neeg Siv; strcpy (Karina.username, "Karina Valverde"); strcpy (Karina.password, "Taller Vertical"); strcpy (Manager.username, "Tus Thawj"); strcpy (Manager.password, "ITESM"); struct Database Tool; struct Database Cwjmem; struct Database Case; strcpy (Tool. Article_Name, "Tool"); struct Database Tool; struct Database Cwjmem; struct Database Case; strcpy (Tool. Article_Name, "Tool"); strcpy (Pen. Article_Name, "Cwj mem"); strcpy (Case. Article_Name, "Case"); libsoc_set_debug (0); led_1 = libsoc_gpio_request (LED_1, LS_SHARED); button_1 = libsoc_gpio_request (BUTTON_1, LS_SHARED); button_2 = libsoc_gpio_request (BUTTON_2, LS_SHARED); button_3 = libsoc_gpio_request (BUTTON_3, LS_SHARED); button_4 = libsoc_gpio_request (BUTTON_4, LS_SHARED); // button_5 = libsoc_gpio_request (BUTTON_5, LS_SHARED);

yog ((led_1 == NULL) || (button_1 == NULL) || (button_2 == NULL) || (button_3 == NULL) || (button_4 == NULL))

{mus tsis tau; } libsoc_gpio_set_direction (coj_1, OUTPUT); libsoc_gpio_set_direction (khawm_1, INPUT); libsoc_gpio_set_direction (khawm_2, INPUT); libsoc_gpio_set_direction (khawm _3, INPUT); libsoc_gpio_set_direction (khawm_4, INPUT); // libsoc_gpio_set_direction (khawm _5, INPUT);

yog ((libsoc_gpio_get_direction (led_1)! = OUTPUT)

|| (libsoc_gpio_get_direction (button_1)! = INPUT) || (libsoc_gpio_get_direction (button_2)! = INPUT) || (libsoc_gpio_get_direction (button_3)! = INPUT) || (libsoc_gpio_get_direction (button_4)! = INPUT)) {ua tsis tiav; } sensor1 = libsoc_gpio_get_level (khawm_1); sensor2 = libsoc_gpio_get_level (khawm_2); sensor3 = libsoc_gpio_get_level (button_4); sensor1_last_state = sensor1; sensor2_last_state = sensor2; sensor3_last_state = sensor3; yog (sensor1 == 1) {strcpy (Tool. Location, "Nyob ntawm Khib"); } lwm yog (sensor1 == 0) {strcpy (Tool. Location, "Tsis txhob muab tso rau hauv Khib no"); } yog (sensor2 == 1) {strcpy (Pen. Location, "Nyob ntawm Khib"); } lwm yog (sensor2 == 0) {strcpy (Pen. Location, "Tsis txhob muab tso rau hauv Khib no"); } yog (sensor3 == 1) {strcpy (Case. Location, "Nyob ntawm Khib"); } lwm yog (sensor3 == 0) {strcpy (Case. Location, "Tsis txhob muab tso rau hauv Khib no"); } thaum (khiav) {libsoc_gpio_set_level (led_1, HIGH); printf ("Thov nkag lub npe siv:"); scanf ("%s", lub npe siv); printf ("Thov nkag tus password:"); scanf ("%s", tus password); yog (strcmp (username, "Karina") == 0 && strcmp (password, "Taller") == 0) {libsoc_gpio_set_level (led_1, LOW); libsoc_gpio_set_level (led_1, LOW); thaum (libsoc_gpio_get_level (button_3)! = 1) {sensor1 = libsoc_gpio_get_level (button_1); sensor2 = libsoc_gpio_get_level (khawm_2); sensor3 = libsoc_gpio_get_level (button_4); } libsoc_gpio_set_level (led_1, HIGH); yog (sensor1 == 1 && sensor1! = sensor1_last_state) {strcpy (Tool. Location, Karina.username); } lwm yog (sensor1 == 0 && sensor1! = sensor1_last_state) {strcpy (Tool. Location, "Nyob ntawm Khib"); } yog (sensor2 == 1 && sensor2! = sensor2_last_state) {strcpy (Pen. Location, Karina.username); } lwm yog (sensor2 == 0 && sensor2! = sensor2_last_state) {strcpy (Pen. Location, "Nyob ntawm Khib"); }

yog (sensor3 == 1 && sensor3! = sensor3_last_state) {

strcpy (Case. Location, Karina.username); } lwm yog (sensor3 == 0 && sensor3! = sensor3_last_state) {strcpy (Case. Location, "Nyob ntawm Khib"); }} lwm tus yog (strcmp (username, "Boss") == 0 && strcmp (password, "ITESM") == 0) {printf ("Koj puas xav tsim cov ntawv sau nrog lub hauv paus? [Yog/Tsis yog] "); scanf ("%s", Yog lawm); yog ((strcmp (YesNo, Yog) == 0)) {// Manager_user (pFILE); pFILE = fopen ("Database.txt", "w"); fprintf (pFILE, "%s", "-------- Rack's Database ----- / n"); fprintf (pFILE, "%s", "Kab lus Lub Npe:"); fprintf (pFILE, "%s", Tool. Article_Name); fprintf (pFILE, "%s", "\ t"); fprintf (pFILE, "%s", "Kab lus Qhov Chaw:"); fprintf (pFILE, "%s", Tool. Location); fprintf (pFILE, "%s", "\ n"); fprintf (pFILE, "%s", "Kab lus Lub Npe:"); fprintf (pFILE, "%s", Pen. Article_Name); fprintf (pFILE, "%s", "\ t"); fprintf (pFILE, "%s", "Kab lus Qhov Chaw:"); fprintf (pFILE, "%s", Pen. Location); fprintf (pFILE, "%s", "\ n");

fprintf (pFILE, "%s", "Kab lus Lub Npe:");

fprintf (pFILE, "%s", Case. Article_Name); fprintf (pFILE, "%s", "\ t"); fprintf (pFILE, "%s", "Kab lus Qhov Chaw:"); fprintf (pFILE, "%s", Case. Location); fprintf (pFILE, "%s", "\ n");

fclose (pFILE);

}

printf ("Nkag Tsis Pub Nkag Mus / n");

}} ua tsis tiav: yog tias (coj_1_1 || khawm_1 || khawm_2 || khawm_3) {printf ("thov gpio pab tsis tau! / n"); libsoc_gpio_free (coj_1); libsoc_gpio_free (khawm_1); libsoc_gpio_free (khawm_2); libsoc_gpio_free (khawm_3); }

Kauj ruam 11: Khiav qhov program

Kauj Ruam 12: Cov lus xaus

Txoj haujlwm muaj kev cia siab yav tom ntej, txij li nws tuaj yeem txhim kho txoj hauv kev zoo, cov ntsuas tuaj yeem hloov pauv rau RFID´S cim npe thiab tib lub sijhawm nrog RFID tuaj yeem siv daim npav ID los saib xyuas tus neeg lub luag haujlwm ntawm cov khoom siv.

Pom zoo: