Strona producenta i dokumentacja techniczna płytki EduTar-Nano: link
Dokumentacja techniczna mikrokontrolera ATmega328P: link
Oprogramowanie Arduino z dodatkowymi bibliotekami: Arduino 1.8.19
Instrukcja kompilacji programu w Arduino do pliku HEX: instrukcja
Rozbudowany symulator Arduino online: https://wokwi.com/
Program do programowania mikrokontrolera (ustawić urządzenie na Nano(Atmega328) i prędkość transmisji na 115200): Xloader
Wyprowadzenia modułu Arduino NANO:
Obsługa LCD:
1 2 3 4 5 6 7 8 9 10 |
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); lcd.print("Hello!!!"); } |
Przykładowe programy:
- program demo – wyświetla na LCD napis, godzinę z układu RTC i temperature z układu DS8b20 (nalezy podłączyć pin ‘DS_conn’ do pinu D2 Arduino)
- lekcje 1 – przykładowe lekcje dla płytki edukacyjnej
Obsługa czytnika kart RFID:
Opis | Płytka EduTar | Moduł RFID-MFRC522 |
Zasilanie +3.3V | 3V3 | 3.3V |
Zasilanie GND | GND | GND |
MISO | D12 | MISO |
MOSI | D11 | MOSI |
SCK | D13 | SCK |
CS | D10 | SDA |
RST | D9 | RST |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
/* -------------------------------------------------------------------------------------------------------------------- Example sketch/program showing how to read new NUID from a PICC to serial. -------------------------------------------------------------------------------------------------------------------- This is a MFRC522 library example; for further details and other examples see: https://github.com/miguelbalboa/rfid Example sketch/program showing how to the read data from a PICC (that is: a RFID Tag or Card) using a MFRC522 based RFID Reader on the Arduino SPI interface. When the Arduino and the MFRC522 module are connected (see the pin layout below), load this sketch into Arduino IDE then verify/compile and upload it. To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M). When you present a PICC (that is: a RFID Tag or Card) at reading distance of the MFRC522 Reader/PCD, the serial output will show the type, and the NUID if a new card has been detected. Note: you may see "Timeout in communication" messages when removing the PICC from reading distance too early. @license Released into the public domain. Typical pin layout used: ----------------------------------------------------------------------------------------- MFRC522 Arduino Arduino Arduino Arduino Arduino Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro Signal Pin Pin Pin Pin Pin Pin ----------------------------------------------------------------------------------------- RST/Reset RST 9 5 D9 RESET/ICSP-5 RST SPI SS SDA(SS) 10 53 D10 10 10 SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14 SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15 More pin layouts for other boards can be found here: https://github.com/miguelbalboa/rfid#pin-layout */ #include <SPI.h> #include "MFRC522.h" #define SS_PIN 10 #define RST_PIN 9 MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class MFRC522::MIFARE_Key key; // Init array that will store new NUID byte nuidPICC[4]; void setup() { Serial.begin(9600); SPI.begin(); // Init SPI bus rfid.PCD_Init(); // Init MFRC522 } void loop() { // Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle. if ( ! rfid.PICC_IsNewCardPresent()) return; // Verify if the NUID has been readed if ( ! rfid.PICC_ReadCardSerial()) return; MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak); // Check is the PICC of Classic MIFARE type if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI && piccType != MFRC522::PICC_TYPE_MIFARE_1K && piccType != MFRC522::PICC_TYPE_MIFARE_4K) { Serial.println(F("Your tag is not of type MIFARE Classic.")); return; } Serial.print(F("The NUID tag is: ")); Serial.print(F("In hex: ")); printHex(rfid.uid.uidByte, rfid.uid.size); Serial.println(); // Halt PICC rfid.PICC_HaltA(); // Stop encryption on PCD rfid.PCD_StopCrypto1(); } /** Helper routine to dump a byte array as hex values to Serial. */ void printHex(byte *buffer, byte bufferSize) { for (byte i = 0; i < bufferSize; i++) { Serial.print(buffer[i] < 0x10 ? " 0" : " "); Serial.print(buffer[i], HEX); } } |