Simple Reconstruct Persian/Arabic letters to be used in Arduino IDE and OLED/LCD display. This script is compatible to all Arduino family boards such as Arduboy, ESP8266/ESP32, Particle Photon, ....
All displays and libraries that can be set to
writepixel(x, y, color) can be used and there is no limit.
Persian/Arabic script is very special with two essential features:
The code attempts to resolve the problem of displaying letters and numbers in Persian/Arabic with a 8x8 font.
See more screenshots here.
First you need to install the Adafruit GFX library (for drawing shapes, lines, ...) of course this is optional, then according to the type of display, install the library you need. Here I used the 128x64 display with SSD1306 chip driver so I installed the Adafruit SSD1306 library.
Download/Clone repository, change the following lines according to the library you are using:
//This section should be modified according to your display type and library #define setpixel(x, y, color) display.writePixel(x, y, color) #define LCDWidth display.width() //If you use SPI display, change the following lines according to your display type (I used the Arduboy) #define OLED_DC 4 #define OLED_CS 12 #define OLED_RESET 6 Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS); //If you use i2c display, uncomment this part. /* #define OLED_RESET 4 Adafruit_SSD1306 display(OLED_RESET); */
Finally, change the following lines and then upload on the Arduino board:
char txt = "فارسی نویسی در آردوینو"; PutCharPE(txt,ALINE_CENTER(txt),8,1,BLACK); char NUM = "0123456789"; //For correct representation, the numbers must be reversed. PutCharPE(strreverse(NUM),ALINE_CENTER(NUM),30,1,BLACK);
If this project help you reduce time to develop, you can give me a cup of coffee :)
💧 Monitoring water tanker level using NodeMCU ESP8266 and HC-SR04P Ultrasonic Sensor and broadcasting it using a simple HTTP server inside NodeMCU ESP8266 and show data in an Android App
📍 Live tracking on OpenStreetMap with GPS over LoRa
🇮🇷 Persian reshaper for use in the u8g2 library
Processing of audio signals and showing in RGB LED Stripe as equalizer ( or spectrum )
RadioHead Packet Radio library for embedded microprocessors