This is an old revision of the document!
Sergiu Moga 332CB
SD Card Buddy este un proiect Arduino care are ca scop expunerea unui shell prin care un utilizator poate interactiona cu sistemul de fisiere de pe un SD Card. Ideea proiectului este de a avea ceva micut si la indemana cu care poti modifica continutul de pe un SD Card, ceea ce il poate face util in anumite cazuri.
Folosind o placuta compatibila Arduino, prin comunicare SPI cu 2 sclavi (un display si un modul de SD Card) o sa expun printr-un display un shell interactiv cu care utilizatorul poate naviga/citi/scrie intr-un sistem de fisiere de pe SD Card. Pentru interactionare se va folosi o tastatura improvizata (15-16 butoane legate la acelasi pin prin rezistente diferite pentru a le putea distinge cu ajutorul analogRead).
Componente:
Schematic:
Software utilizat:
Biblioteci utilizate:
Structuri de date utilizate:
int second_half = 0; // ranges = {{1000, 1050}, {950, 1000}, {850, 900}, {450, 550}, {50, 150}} int kbd_button_index[] = {4, 4, -1, -1, 3, 3, -1, -1, 2, 1, 0}; char kbd_buttons[2][4][5] = { { {'A', 'B', 'C', 'D', 'E'}, {'F', 'G', 'H', 'I'}, {'J', 'K', 'L', 'M'}, {' ', '0', '\n'} }, { {'N', 'O', 'P', 'Q', 'R'}, {'S', 'T', 'U', 'V'}, {'W', 'X', 'Y', 'Z'}, {'/', '0', '\n'} } };
char cmd[50]; char output[150]; int cmd_index, output_index;
Functii/Algoritmi:
void setupServer() { server.on("/", htmlIndex); server.begin(); } void htmlIndex() { int replyCode = 200; String contentType = "text/html"; memcpy(markdown + sizeof(head) - 1, message, sizeof(message)); server.send(replyCode, contentType, markdown); } void connectToWiFi() { WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) delay(500); } void setup() { mySerial.begin(4800); delay(1000); connectToWiFi(); setupServer(); }
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.