Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // POV code 3.01 BETA BlinkM version
- // Completely untested on real hardware
- // CHANGELOG:
- // 3.01 BETA Oops, forgot to include some of the code! Fixed
- // Little more cleanup
- // Going to add serial support, probably in 3.10 or higher.
- // 3.00 BETA Now with support for saving up to 16 RGB color mixes
- // Support for up to 16 custom characters
- // Status LED added to design
- // 2.10 Cleaned up some more
- // 2.00 Ultra fix, POV should work properly, lot of bad code replaced
- // Also added BlinkM extra options and POV timing options
- // 1.20 Cleanup, still pretty crappy code in my opinion
- // 1.10 Fixed critical POV display bug
- // 1.00 Initial crappy release
- // TODO:
- // More cleanup
- // Incorporate serial programming methods
- // Test the code out on the real thing!
- /*
- You need:
- ATMega328 chip
- 16MHz crystal oscillator
- 8 LEDs
- 8-switch DIP switch
- 8 100-ohm resistors (for 3.2V forward voltage LED)
- 3 push buttons
- 3-way switch (on-on)
- 10k-ohm resistor (plus optional button for reset)
- TPIC6A595 or comparable shift register
- BlinkM
- Connect DIP switch to digital pins 5-8/Analog In 0-3 and ground
- Connect pushbuttons to digital pins 2-4 and ground
- Connect 3-way switch like this:
- 5V - SYS - GND
- Connect TPIC6A595 registers:
- dataPin (12) connects to SERIN
- clockPin (11) connects to SRCK
- latchPin (10) connects to RCK
- BlinkM should be connected to Analog In 4/5, 5V and GND.
- Refer to wiring diagram for wiring details.
- */
- // Let's include the libraries we'll need
- // This includes switch debouncing, EEPROM
- // read/write access, I2C library, and
- // specialized BlinkM functions
- #include <Bounce.h>
- #include <EEPROM.h>
- #include <Wire.h>
- #include <BlinkM_funcs.h>
- // Character set - A-Z, a-z, 0-9, some symbols
- const byte POVA[] ={
- 254, 25, 25, 254
- };
- const byte POVB[] ={
- 255, 153, 153, 118
- };
- const byte POVC[] ={
- 126, 129, 129, 66
- };
- const byte POVD[] ={
- 255, 129, 129, 126
- };
- const byte POVE[] ={
- 255, 137, 137, 137
- };
- const byte POVF[] ={
- 255, 9, 9, 9
- };
- const byte POVG[] ={
- 126, 129, 145, 241
- };
- const byte POVH[] ={
- 255, 24, 24, 255
- };
- const byte POVI[] ={
- 129, 255, 255, 129
- };
- const byte POVJ[] ={
- 24, 129, 129, 127
- };
- const byte POVK[] ={
- 255, 24, 24, 231
- };
- const byte POVL[] ={
- 255, 128, 128, 128
- };
- const byte POVM[] ={
- 255, 2, 12, 2, 255
- };
- const byte POVN[] ={
- 255, 6, 24, 96, 255
- };
- const byte POVO[] ={
- 126, 129, 129, 126
- };
- const byte POVP[] ={
- 255, 9, 9, 6
- };
- const byte POVQ[] ={
- 126, 129, 129, 255
- };
- const byte POVR[] ={
- 255, 9, 25, 230
- };
- const byte POVS[] ={
- 134, 137, 137, 131
- };
- const byte POVT[] ={
- 1, 255, 255, 1
- };
- const byte POVU[] ={
- 127, 128, 128, 127
- };
- const byte POVV[] ={
- 63, 192, 192, 63
- };
- const byte POVW[] ={
- 127, 128, 112, 128, 127
- };
- const byte POVX[] ={
- 231, 24, 24, 231
- };
- const byte POVY[] ={
- 15, 240, 240, 15
- };
- const byte POVZ[] ={
- 225, 145, 137, 135
- };
- const byte POVAL[] ={
- 64, 168, 168, 112
- };
- const byte POVBL[] ={
- 248, 160, 160, 64
- };
- const byte POVCL[] ={
- 112, 136, 136, 80
- };
- const byte POVDL[] ={
- 64,160,160,120
- };
- const byte POVEL[] ={
- 112,168,168,176
- };
- const byte POVFL[] ={
- 32,240,40,40
- };
- const byte POVGL[] ={
- 144,168,168,120
- };
- const byte POVHL[] ={
- 248,32,32,192
- };
- const byte POVIL[] ={
- 232,232
- };
- const byte POVJL[] ={
- 64,128,128,104
- };
- const byte POVKL[] ={
- 248,64,96,144
- };
- const byte POVLL[] ={
- 248,128
- };
- const byte POVML[] ={
- 240,8,48,8,240
- };
- const byte POVNL[] ={
- 248,8,8,240
- };
- const byte POVOL[] ={
- 112,136,136,112
- };
- const byte POVPL[] ={
- 248,40,40,16
- };
- const byte POVQL[] ={
- 16,40,40,248
- };
- const byte POVRL[] ={
- 248,16,8,8
- };
- const byte POVSL[] ={
- 144,168,168,72
- };
- const byte POVTL[] ={
- 16,120,144
- };
- const byte POVUL[] ={
- 120,128,128,248
- };
- const byte POVVL[] ={
- 120,192,120
- };
- const byte POVWL[] ={
- 120,128,96,128,120
- };
- const byte POVXL[] ={
- 216,32,216
- };
- const byte POVYL[] ={
- 152,160,120
- };
- const byte POVZL[] ={
- 136,200,168,152,136
- };
- const byte POV0[] ={
- 126,225,153,135,126
- };
- const byte POV1[] ={
- 132,130,255,128
- };
- const byte POV2[] ={
- 194,161,145,142
- };
- const byte POV3[] ={
- 137,137,137,118
- };
- const byte POV4[] ={
- 24,20,18,255
- };
- const byte POV5[] ={
- 79,137,137,113
- };
- const byte POV6[] ={
- 126,145,145,98
- };
- const byte POV7[] ={
- 193,49,9,7
- };
- const byte POV8[] ={
- 118,137,137,118
- };
- const byte POV9[] ={
- 78,145,145,126
- };
- const byte POVSP[] ={
- 0
- };
- const byte POVcolon[] ={
- 102, 102
- };
- const byte POVsemicolon[] ={
- 70, 54
- };
- const byte POVquestion[] ={
- 2, 177, 9, 6
- };
- const byte POVdash[] ={
- 24, 24, 24, 24
- };
- const byte POVperiod[] ={
- 192, 192
- };
- const byte POVexclamation[] ={
- 223, 223
- };
- byte *POVC0;
- byte *POVC1;
- byte *POVC2;
- byte *POVC3;
- byte *POVC4;
- byte *POVC5;
- byte *POVC6;
- byte *POVC7;
- byte *POVC8;
- byte *POVC9;
- byte *POVC10;
- byte *POVC11;
- byte *POVC12;
- byte *POVC13;
- byte *POVC14;
- byte *POVC15;
- // There's space for more characters in the future, up to 256.
- // Will eventually add support for custom characters.
- const char charTable[256] ={
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.?!:;- "
- // dash is charTable[67], custom characters are 68-83 for total of 16 custom characters
- };
- // Program default text before you input a message
- // Max 64 characters
- // A message is required.
- const char defaultText[] = {
- "POV Wand 1.0"
- };
- // Define constants here
- #define DATAPIN 12
- #define CLOCKPIN 11
- #define LATCHPIN 10
- // Note: 0x00 means general call in I2C
- // It will call ALL devices on the I2C bus
- #define BLINKM_ADDR 0x00
- // Connect pushbuttons to pins 2,3,4
- // No pullup/pulldown resistor
- byte textPOV[384]; // Max 64 characters
- byte charPOV[64];
- byte POVlength = 0;
- int POVBlength = 0;
- byte RGBState = 0;
- byte RGB[] = {
- 255,255,255
- };
- byte columnDelay = 2; // set delay between column flashes in ms
- byte wordDelay = 8; // set delay between words in ms
- Bounce button2 = Bounce( 2,5 );
- Bounce button3 = Bounce( 3,5 );
- Bounce button4 = Bounce( 4,5 );
- void setup() {
- byte temppov[] = {1,2,3,4,5};
- // For debugging purposes
- Serial.begin(9600);
- Serial.println("Setting up");
- // We set shift register pins to output for SPI communication
- pinMode(DATAPIN, OUTPUT);
- pinMode(CLOCKPIN, OUTPUT);
- pinMode(LATCHPIN, OUTPUT);
- // Set pins to input state and activate pullup resistors
- // This will allow us to read the DIP switch/pushbuttons
- for (int i = 2; i < 9; i++) {
- pinMode(i,INPUT);
- digitalWrite(i,HIGH);
- }
- for (int i = 14; i < 18; i++) {
- pinMode(i,INPUT);
- digitalWrite(i,HIGH);
- }
- writeTextToEEPROM(temppov,5);
- // Attempt to read saved POV text from EEPROM
- byte temp = readTextFromEEPROM();
- // If the EEPROM is empty, load the default text
- if (temp == 0) {
- temp = loadDefaultText();
- }
- POVlength = temp;
- // Update button states
- button2.update();
- button3.update();
- button4.update();
- // Initialize BlinkM
- BlinkM_begin();
- BlinkM_stopScript(0x00);
- BlinkM_fadeToRGB(0x00,0,0,0);
- for(int i = 0; i < 8; i++){
- writeToRegister(0);
- }
- // Set up custom character arrays
- // We read the custom character's size and allocate
- // the needed memory using malloc
- // We then store the character data into the arrays
- POVC0 = (byte *)malloc(readCharSize(1));
- POVC1 = (byte *)malloc(readCharSize(2));
- POVC2 = (byte *)malloc(readCharSize(3));
- POVC3 = (byte *)malloc(readCharSize(4));
- POVC4 = (byte *)malloc(readCharSize(5));
- POVC5 = (byte *)malloc(readCharSize(6));
- POVC6 = (byte *)malloc(readCharSize(7));
- POVC7 = (byte *)malloc(readCharSize(8));
- POVC8 = (byte *)malloc(readCharSize(9));
- POVC9 = (byte *)malloc(readCharSize(10));
- POVC10 = (byte *)malloc(readCharSize(11));
- POVC11 = (byte *)malloc(readCharSize(12));
- POVC12 = (byte *)malloc(readCharSize(13));
- POVC13 = (byte *)malloc(readCharSize(14));
- POVC14 = (byte *)malloc(readCharSize(15));
- byte *POVC0 = readCharData(1, POVC0);
- byte *POVC1 = readCharData(2, POVC1);
- byte *POVC2 = readCharData(3, POVC2);
- byte *POVC3 = readCharData(4, POVC3);
- byte *POVC4 = readCharData(5, POVC4);
- byte *POVC5 = readCharData(6, POVC5);
- byte *POVC6 = readCharData(7, POVC6);
- byte *POVC7 = readCharData(8, POVC7);
- byte *POVC8 = readCharData(9, POVC8);
- byte *POVC9 = readCharData(10, POVC9);
- byte *POVC10 = readCharData(11, POVC10);
- byte *POVC11 = readCharData(12, POVC11);
- byte *POVC12 = readCharData(13, POVC12);
- byte *POVC13 = readCharData(14, POVC13);
- byte *POVC14 = readCharData(15, POVC14);
- byte *POVC15 = readCharData(16, POVC15);
- delay(100);
- for(int i = 0; i < 256; i++) {
- Serial.println(i,DEC);
- writeToRegister(i);
- delay(100);
- }
- }
- void loop()
- {
- /* // Is a pushbutton pressed?
- button2.update();
- button3.update();
- button4.update();
- // Switch to programming mode
- if (button2.read() == LOW)
- programText();
- // Switch to BlinkM flashlight
- if (button3.read() == LOW)
- BlinkM();
- // Adjust delay speed
- if (button4.read() == LOW)
- delaySpeed();
- */
- Serial.println("Printing word");
- // If not, run POV
- //printWord(textPOV);
- writeToRegister(0);
- delay(5);
- //delay(wordDelay); //Wait a little bit between each display of the word
- }
- // Start BlinkM flashlight
- void BlinkM() {
- Serial.println("BlinkM mode");
- // Initialize variables
- unsigned long colordata = 0;
- // Turn off all the POV LEDs
- writeToRegister(0);
- // Set up BlinkM speed
- BlinkMSetSpeed();
- // Let's set up the BlinkM's color
- // Set script to default - no color
- byte scriptnum = 0;
- BlinkM_playScript(BLINKM_ADDR,scriptnum,0,0 );
- // Read color data from EEPROM
- colordata = readColorFromEEPROM(DIPInput() & B1111);
- RGB[0] = colordata & 16711680;
- RGB[1] = colordata & 65280;
- RGB[2] = colordata & 255;
- // Send it a 3 byte RGB color value
- BlinkM_fadeToRGB(BLINKM_ADDR,RGB[0],RGB[1],RGB[2]);
- // Wait for user to release the mode switch button
- while (button3.read() == LOW){
- button3.update();
- }
- // Main BlinkM loop
- // Executes until mode switch button is pressed
- // It will then return to the main POV loop
- do {
- // Update button states
- button2.update();
- button3.update();
- button4.update();
- // Are any buttons pressed?
- // Program button
- if (button2.read() == LOW)
- programRGB();
- // Light script switch button
- if (button4.read() == LOW) {
- BlinkMSetSpeed();
- BlinkM_playScript(BLINKM_ADDR,scriptnum,0,0);
- scriptnum++;
- if (scriptnum > 18)
- scriptnum = 0;
- }
- // Wait for button to be released
- while (button2.read() == LOW || button3.read() == LOW || button4.read() == LOW) {
- button2.update();
- button3.update();
- button4.update();
- }
- }
- // Keep looping until mode switch button is pressed
- while (button3.read() == HIGH);
- // Let's turn off the BlinkM
- BlinkM_stopScript(BLINKM_ADDR);
- BlinkM_changeRGB(0,0,0,false);
- // Return to POV code
- return;
- }
- // Program new text for POV
- // If mode switch button is pressed, read DIP switches and change text accordingly
- // Press programming button again to exit
- void programText() {
- // Initialize our variables
- byte num = 0;
- byte temp = 0;
- POVlength = 0;
- POVBlength = 0;
- // Clear the POV LEDs
- writeToRegister(0);
- // Let's clear the button state
- while (button2.read() == LOW){
- button2.update();
- }
- if (DIPInput() & B11110000 == 16) {
- byte temp2 = 0;
- byte temp3[8];
- num = DIPInput() & B1111 + 1;
- do {
- button3.update();
- if (button3.read() == LOW) {
- temp = DIPInput();
- // Show which character was saved
- writeToRegister(temp);
- temp3[temp2] = temp;
- temp2++;
- }
- }
- while (button4.read() == HIGH && temp2 < 8);
- writeCharData(num,temp3);
- return;
- }
- // wait for button press, then read DIP switch and save data
- do {
- button3.update();
- if (button3.read() == LOW) {
- temp = DIPInput();
- // Does the input exceed character database limits?
- // If so, fix it to a space
- if (temp > sizeof(charTable))
- temp = 0;
- // Lookup the character
- charPOV[POVlength] = charTable[temp];
- charLookup(charTable[temp]);
- POVlength++;
- // Show which character was saved
- writeToRegister(temp);
- }
- // Update the button state
- button2.update();
- }
- // Keep going until text length is 64 or user exits mode
- while (button2.read() == HIGH && POVlength < 64);
- // Write the data to EEPROM
- writeTextToEEPROM(charPOV,POVlength);
- return;
- }
- // Display the POV text
- void printWord(byte wordVar[]) {
- for(int i = 0; i < sizeof(wordVar); i++) {
- //writeToRegister(wordVar[i]);
- delay(5);
- //delay(columnDelay);
- Serial.println("printWord running");
- }
- }
- // Write POV data to EEPROM
- void writeTextToEEPROM(byte wordVar[], byte length) {
- // Save delay information
- EEPROM.write(0,wordDelay);
- EEPROM.write(1,columnDelay);
- length += 1;
- for(int i = 1; i < length; i++) {
- EEPROM.write(i+2,wordVar[i]);
- }
- // Save length information
- EEPROM.write(2,length);
- }
- // Read saved text from EEPROM
- byte readTextFromEEPROM() {
- // Initialize variables
- byte temp = 0;
- byte length = 0;
- byte size = 0;
- POVlength = 0;
- POVBlength = 0;
- // If length = 0, we'll load default text
- if (EEPROM.read(2) == 0)
- return 0;
- // Load delay/length information
- wordDelay = EEPROM.read(0);
- columnDelay = EEPROM.read(1);
- length = EEPROM.read(2);
- // Read and save data
- for (int i = 1; i < length; i++) {
- // Do we have enough space? If not, increase the size of textPOV
- if (sizeof(textPOV) < POVBlength + 9) {
- realloc(textPOV, sizeof(textPOV) + 9);
- }
- temp = EEPROM.read(i+2);
- charPOV[POVlength] = charTable[temp];
- charLookup(charTable[temp]);
- POVlength++;
- }
- return length;
- }
- // Get custom character size from EEPROM
- byte readCharSize(byte num) {
- return EEPROM.read(175 + num);
- }
- // Read custom character data from EEPROM
- byte *readCharData(byte num, byte cdata[]) {
- byte temp = readCharSize(num);
- for (int i = 0; i < temp; i++){
- cdata[i] = EEPROM.read(176 + 8 * num + i);
- }
- return cdata;
- }
- // Stores custom character data to EEPROM
- void writeCharData(byte num, byte cdata[]) {
- EEPROM.write(175 + num, sizeof(cdata));
- for (int i = 0; i < sizeof(cdata); i++) {
- EEPROM.write(176 + 8 * num + i, cdata[i]);
- }
- }
- // Uses SPI to clock in data, then latches to set LED on/off
- void writeToRegister(byte data) {
- Serial.println("writing");
- digitalWrite(LATCHPIN, LOW);
- shiftOut(DATAPIN, CLOCKPIN, MSBFIRST, data);
- digitalWrite(LATCHPIN, HIGH);
- }
- // If EEPROM is empty, load default text
- byte loadDefaultText() {
- // Initialize variables
- byte temp = 0;
- POVlength = 0;
- POVBlength = 0;
- // Let's copy defaultText into the POV buffer
- realloc(charPOV, sizeof(defaultText));
- memcpy(charPOV, defaultText, sizeof(defaultText));
- POVlength = sizeof(charPOV);
- // Convert the POV buffer into the binary LED states
- for(int i = 0; i < POVlength; i++) {
- if (sizeof(textPOV) < POVBlength + 6) {
- realloc(textPOV, sizeof(textPOV) + 6);
- }
- charLookup(charPOV[i]);
- }
- }
- // Change BlinkM's RGB color
- void programRGB() {
- do {
- // Update the button
- button3.update();
- // To completely change the color, you need to press the pushbutton 3 times
- // and adjust DIP switches 3 times
- // Wait for button press, if pressed then save + update color information
- if (button3.read() == LOW) {
- RGB[RGBState] = DIPInput();
- RGBState++;
- if (RGBState >= 3) {
- RGBState = 0;
- writeColorToEEPROM(RGB[0],RGB[1],RGB[2]);
- }
- BlinkM_changeRGB(RGB[0],RGB[1],RGB[2],true);
- }
- // Update button state
- button2.update();
- }
- // Keep looping until programming button pressed
- while (button2.read() == HIGH);
- return;
- }
- // Reads the DIP switch for 1 byte input
- byte DIPInput() {
- // Initialize variables
- byte readDIP = 0;
- // Every read, if on, add 1
- // Then bitshift left by 1
- for (int i = 5;i < 9; i++) {
- if (digitalRead(i) == LOW)
- readDIP += 1;
- readDIP = readDIP << 1;
- }
- for (int i = 14; i < 18; i++) {
- if (digitalRead(i) == LOW)
- readDIP += 1;
- readDIP = readDIP << 1;
- }
- return readDIP;
- }
- // Set POV delay speed
- void delaySpeed() {
- // Clear POV LEDs
- writeToRegister(0);
- // Wait for user to release button
- while (button4.read() == LOW){
- button4.update();
- }
- // Get input from switches and save
- byte temp = DIPInput();
- wordDelay = temp >> 4;
- columnDelay = temp & B00001111;
- // Save delay information to EEPROM
- EEPROM.write(0,wordDelay);
- EEPROM.write(1,columnDelay);
- }
- // This sets fade speed and time adjustment on the BlinkM
- void BlinkMSetSpeed() {
- // initialize our variables
- byte dip = 0;
- byte fade = 0;
- byte time = 0;
- // Read information from DIP switches
- dip = DIPInput();
- // Map our 4 bit inputs (0-127) to 8 bit values (0-255)
- fade = map((dip & B11110000) << 3, 0, 15, 0, 255);
- time = map((dip & B00001111) << 1, 0, 15, 0, 255);
- // Adjust fade speed and time adjustment
- BlinkM_setFadeSpeed(BLINKM_ADDR, fade);
- BlinkM_setTimeAdj(BLINKM_ADDR, time);
- }
- void BlinkM_changeRGB(byte red, byte blue, byte green, boolean fadeon) {
- if (fadeon == true) {
- BlinkM_fadeToRGB(BLINKM_ADDR,red,blue,green);
- }
- else {
- BlinkM_setRGB(BLINKM_ADDR,red,blue,green);
- }
- }
- unsigned long readColorFromEEPROM(byte num) {
- if (EEPROM.read(127)==0) {
- EEPROM.write(128,255);
- EEPROM.write(129,255);
- EEPROM.write(130,255);
- EEPROM.write(127,1);
- }
- if (num == 0) return EEPROM.read(127);
- if (EEPROM.read(127) < num) return (EEPROM.read(127)<<24)+16777216;
- return (EEPROM.read(127)<<24)|(EEPROM.read(125 + 3 * num)<<16)|(EEPROM.read(126 + 3 * num)<<8)|EEPROM.read(127 + 3 * num);
- }
- void writeColorToEEPROM(byte red, byte blue, byte green) {
- byte temp = EEPROM.read(127);
- if (temp == 16) temp--;
- for (int i = 15; i > 0; i--) {
- EEPROM.write(128 + 3 * i, EEPROM.read(125 + 3 * i));
- EEPROM.write(129 + 3 * i, EEPROM.read(126 + 3 * i));
- EEPROM.write(130 + 3 * i, EEPROM.read(127 + 3 * i));
- }
- EEPROM.write(128,red);
- EEPROM.write(129,blue);
- EEPROM.write(130,green);
- temp++;
- EEPROM.write(127,temp);
- }
- // Blink the status LED on pin 13
- void blinkLED(byte blinkDelay) {
- // The first time the function is called, blinkStatus will be set to 0
- static unsigned long blinkStatus;
- if (millis() > abs(blinkStatus) + blinkDelay) {
- if (blinkStatus < 0) {
- digitalWrite(13,LOW);
- blinkStatus = millis();
- }
- else {
- digitalWrite(13,HIGH);
- blinkStatus = -millis();
- }
- }
- }
- // Simply lookup the character and return the LED flash placement data
- void charLookup(char inputchar) {
- switch (inputchar) {
- case 'A':
- for (int i=0; i < sizeof(POVA); i++) {
- textPOV[POVBlength] = POVA[i];
- POVBlength++;
- }
- break;
- case 'B':
- for (int i=0; i < sizeof(POVB); i++) {
- textPOV[POVBlength] = POVB[i];
- POVBlength++;
- }
- break;
- case 'C':
- for (int i=0; i < sizeof(POVC); i++) {
- textPOV[POVBlength] = POVC[i];
- POVBlength++;
- }
- break;
- case 'D':
- for (int i=0; i < sizeof(POVD); i++) {
- textPOV[POVBlength] = POVD[i];
- POVBlength++;
- }
- break;
- case 'E':
- for (int i=0; i < sizeof(POVE); i++) {
- textPOV[POVBlength] = POVE[i];
- POVBlength++;
- }
- break;
- case 'F':
- for (int i=0; i < sizeof(POVF); i++) {
- textPOV[POVBlength] = POVF[i];
- POVBlength++;
- }
- break;
- case 'G':
- for (int i=0; i < sizeof(POVG); i++) {
- textPOV[POVBlength] = POVG[i];
- POVBlength++;
- }
- break;
- case 'H':
- for (int i=0; i < sizeof(POVH); i++) {
- textPOV[POVBlength] = POVH[i];
- POVBlength++;
- }
- break;
- case 'I':
- for (int i=0; i < sizeof(POVI); i++) {
- textPOV[POVBlength] = POVI[i];
- POVBlength++;
- }
- break;
- case 'J':
- for (int i=0; i < sizeof(POVJ); i++) {
- textPOV[POVBlength] = POVJ[i];
- POVBlength++;
- }
- break;
- case 'K':
- for (int i=0; i < sizeof(POVK); i++) {
- textPOV[POVBlength] = POVK[i];
- POVBlength++;
- }
- break;
- case 'L':
- for (int i=0; i < sizeof(POVL); i++) {
- textPOV[POVBlength] = POVL[i];
- POVBlength++;
- }
- break;
- case 'M':
- for (int i=0; i < sizeof(POVM); i++) {
- textPOV[POVBlength] = POVM[i];
- POVBlength++;
- }
- break;
- case 'N':
- for (int i=0; i < sizeof(POVN); i++) {
- textPOV[POVBlength] = POVN[i];
- POVBlength++;
- }
- break;
- case 'O':
- for (int i=0; i < sizeof(POVO); i++) {
- textPOV[POVBlength] = POVO[i];
- POVBlength++;
- }
- break;
- case 'P':
- for (int i=0; i < sizeof(POVP); i++) {
- textPOV[POVBlength] = POVP[i];
- POVBlength++;
- }
- break;
- case 'Q':
- for (int i=0; i < sizeof(POVQ); i++) {
- textPOV[POVBlength] = POVQ[i];
- POVBlength++;
- }
- break;
- case 'R':
- for (int i=0; i < sizeof(POVR); i++) {
- textPOV[POVBlength] = POVR[i];
- POVBlength++;
- }
- break;
- case 'S':
- for (int i=0; i < sizeof(POVS); i++) {
- textPOV[POVBlength] = POVS[i];
- POVBlength++;
- }
- break;
- case 'T':
- for (int i=0; i < sizeof(POVT); i++) {
- textPOV[POVBlength] = POVT[i];
- POVBlength++;
- }
- break;
- case 'U':
- for (int i=0; i < sizeof(POVU); i++) {
- textPOV[POVBlength] = POVU[i];
- POVBlength++;
- }
- break;
- case 'V':
- for (int i=0; i < sizeof(POVV); i++) {
- textPOV[POVBlength] = POVV[i];
- POVBlength++;
- }
- break;
- case 'W':
- for (int i=0; i < sizeof(POVW); i++) {
- textPOV[POVBlength] = POVW[i];
- POVBlength++;
- }
- break;
- case 'X':
- for (int i=0; i < sizeof(POVX); i++) {
- textPOV[POVBlength] = POVX[i];
- POVBlength++;
- }
- break;
- case 'Y':
- for (int i=0; i < sizeof(POVY); i++) {
- textPOV[POVBlength] = POVY[i];
- POVBlength++;
- }
- break;
- case 'Z':
- for (int i=0; i < sizeof(POVZ); i++) {
- textPOV[POVBlength] = POVZ[i];
- POVBlength++;
- }
- break;
- case 'a':
- for (int i=0; i < sizeof(POVAL); i++) {
- textPOV[POVBlength] = POVAL[i];
- POVBlength++;
- }
- break;
- case 'b':
- for (int i=0; i < sizeof(POVBL); i++) {
- textPOV[POVBlength] = POVBL[i];
- POVBlength++;
- }
- break;
- case 'c':
- for (int i=0; i < sizeof(POVCL); i++) {
- textPOV[POVBlength] = POVCL[i];
- POVBlength++;
- }
- break;
- case 'd':
- for (int i=0; i < sizeof(POVDL); i++) {
- textPOV[POVBlength] = POVDL[i];
- POVBlength++;
- }
- break;
- case 'e':
- for (int i=0; i < sizeof(POVEL); i++) {
- textPOV[POVBlength] = POVEL[i];
- POVBlength++;
- }
- break;
- case 'f':
- for (int i=0; i < sizeof(POVFL); i++) {
- textPOV[POVBlength] = POVFL[i];
- POVBlength++;
- }
- break;
- case 'g':
- for (int i=0; i < sizeof(POVGL); i++) {
- textPOV[POVBlength] = POVGL[i];
- POVBlength++;
- }
- break;
- case 'h':
- for (int i=0; i < sizeof(POVHL); i++) {
- textPOV[POVBlength] = POVHL[i];
- POVBlength++;
- }
- break;
- case 'i':
- for (int i=0; i < sizeof(POVIL); i++) {
- textPOV[POVBlength] = POVIL[i];
- POVBlength++;
- }
- break;
- case 'j':
- for (int i=0; i < sizeof(POVJL); i++) {
- textPOV[POVBlength] = POVJL[i];
- POVBlength++;
- }
- break;
- case 'k':
- for (int i=0; i < sizeof(POVKL); i++) {
- textPOV[POVBlength] = POVKL[i];
- POVBlength++;
- }
- break;
- case 'l':
- for (int i=0; i < sizeof(POVLL); i++) {
- textPOV[POVBlength] = POVLL[i];
- POVBlength++;
- }
- break;
- case 'm':
- for (int i=0; i < sizeof(POVML); i++) {
- textPOV[POVBlength] = POVML[i];
- POVBlength++;
- }
- break;
- case 'n':
- for (int i=0; i < sizeof(POVNL); i++) {
- textPOV[POVBlength] = POVNL[i];
- POVBlength++;
- }
- break;
- case 'o':
- for (int i=0; i < sizeof(POVOL); i++) {
- textPOV[POVBlength] = POVOL[i];
- POVBlength++;
- }
- break;
- case 'p':
- for (int i=0; i < sizeof(POVPL); i++) {
- textPOV[POVBlength] = POVPL[i];
- POVBlength++;
- }
- break;
- case 'q':
- for (int i=0; i < sizeof(POVQL); i++) {
- textPOV[POVBlength] = POVQL[i];
- POVBlength++;
- }
- break;
- case 'r':
- for (int i=0; i < sizeof(POVRL); i++) {
- textPOV[POVBlength] = POVRL[i];
- POVBlength++;
- }
- break;
- case 's':
- for (int i=0; i < sizeof(POVSL); i++) {
- textPOV[POVBlength] = POVSL[i];
- POVBlength++;
- }
- break;
- case 't':
- for (int i=0; i < sizeof(POVTL); i++) {
- textPOV[POVBlength] = POVTL[i];
- POVBlength++;
- }
- break;
- case 'u':
- for (int i=0; i < sizeof(POVUL); i++) {
- textPOV[POVBlength] = POVUL[i];
- POVBlength++;
- }
- break;
- case 'v':
- for (int i=0; i < sizeof(POVVL); i++) {
- textPOV[POVBlength] = POVVL[i];
- POVBlength++;
- }
- break;
- case 'w':
- for (int i=0; i < sizeof(POVWL); i++) {
- textPOV[POVBlength] = POVWL[i];
- POVBlength++;
- }
- break;
- case 'x':
- for (int i=0; i < sizeof(POVXL); i++) {
- textPOV[POVBlength] = POVXL[i];
- POVBlength++;
- }
- break;
- case 'y':
- for (int i=0; i < sizeof(POVYL); i++) {
- textPOV[POVBlength] = POVYL[i];
- POVBlength++;
- }
- break;
- case 'z':
- for (int i=0; i < sizeof(POVZL); i++) {
- textPOV[POVBlength] = POVZL[i];
- POVBlength++;
- }
- break;
- case '0':
- for (int i=0; i < sizeof(POV0); i++) {
- textPOV[POVBlength] = POV0[i];
- POVBlength++;
- }
- break;
- case '1':
- for (int i=0; i < sizeof(POV1); i++) {
- textPOV[POVBlength] = POV1[i];
- POVBlength++;
- }
- break;
- case '2':
- for (int i=0; i < sizeof(POV2); i++) {
- textPOV[POVBlength] = POV2[i];
- POVBlength++;
- }
- break;
- case '3':
- for (int i=0; i < sizeof(POV3); i++) {
- textPOV[POVBlength] = POV3[i];
- POVBlength++;
- }
- break;
- case '4':
- for (int i=0; i < sizeof(POV4); i++) {
- textPOV[POVBlength] = POV4[i];
- POVBlength++;
- }
- break;
- case '5':
- for (int i=0; i < sizeof(POV5); i++) {
- textPOV[POVBlength] = POV5[i];
- POVBlength++;
- }
- break;
- case '6':
- for (int i=0; i < sizeof(POV6); i++) {
- textPOV[POVBlength] = POV6[i];
- POVBlength++;
- }
- break;
- case '7':
- for (int i=0; i < sizeof(POV7); i++) {
- textPOV[POVBlength] = POV7[i];
- POVBlength++;
- }
- break;
- case '8':
- for (int i=0; i < sizeof(POV8); i++) {
- textPOV[POVBlength] = POV8[i];
- POVBlength++;
- }
- break;
- case '9':
- for (int i=0; i < sizeof(POV9); i++) {
- textPOV[POVBlength] = POV9[i];
- POVBlength++;
- }
- break;
- case '.':
- for (int i=0; i < sizeof(POVperiod); i++) {
- textPOV[POVBlength] = POVperiod[i];
- POVBlength++;
- }
- break;
- case '?':
- for (int i=0; i < sizeof(POVquestion); i++) {
- textPOV[POVBlength] = POVquestion[i];
- POVBlength++;
- }
- break;
- case '!':
- for (int i=0; i < sizeof(POVexclamation); i++) {
- textPOV[POVBlength] = POVexclamation[i];
- POVBlength++;
- }
- break;
- case ':':
- for (int i=0; i < sizeof(POVcolon); i++) {
- textPOV[POVBlength] = POVcolon[i];
- POVBlength++;
- }
- break;
- case ';':
- for (int i=0; i < sizeof(POVsemicolon); i++) {
- textPOV[POVBlength] = POVsemicolon[i];
- POVBlength++;
- }
- break;
- case '-':
- for (int i=0; i < sizeof(POVdash); i++) {
- textPOV[POVBlength] = POVdash[i];
- POVBlength++;
- }
- break;
- case 1:
- for (int i=0; i < sizeof(POVC0); i++) {
- textPOV[POVBlength] = POVC0[i];
- POVBlength++;
- }
- break;
- case 2:
- for (int i=0; i < sizeof(POVC1); i++) {
- textPOV[POVBlength] = POVC1[i];
- POVBlength++;
- }
- break;
- case 3:
- for (int i=0; i < sizeof(POVC2); i++) {
- textPOV[POVBlength] = POVC2[i];
- POVBlength++;
- }
- break;
- case 4:
- for (int i=0; i < sizeof(POVC3); i++) {
- textPOV[POVBlength] = POVC3[i];
- POVBlength++;
- }
- break;
- case 5:
- for (int i=0; i < sizeof(POVC4); i++) {
- textPOV[POVBlength] = POVC4[i];
- POVBlength++;
- }
- break;
- case 6:
- for (int i=0; i < sizeof(POVC5); i++) {
- textPOV[POVBlength] = POVC5[i];
- POVBlength++;
- }
- break;
- case 7:
- for (int i=0; i < sizeof(POVC6); i++) {
- textPOV[POVBlength] = POVC6[i];
- POVBlength++;
- }
- break;
- case 8:
- for (int i=0; i < sizeof(POVC7); i++) {
- textPOV[POVBlength] = POVC7[i];
- POVBlength++;
- }
- break;
- case 9:
- for (int i=0; i < sizeof(POVC8); i++) {
- textPOV[POVBlength] = POVC8[i];
- POVBlength++;
- }
- break;
- case 10:
- for (int i=0; i < sizeof(POVC9); i++) {
- textPOV[POVBlength] = POVC9[i];
- POVBlength++;
- }
- break;
- case 11:
- for (int i=0; i < sizeof(POVC10); i++) {
- textPOV[POVBlength] = POVC10[i];
- POVBlength++;
- }
- break;
- case 12:
- for (int i=0; i < sizeof(POVC11); i++) {
- textPOV[POVBlength] = POVC11[i];
- POVBlength++;
- }
- break;
- case 13:
- for (int i=0; i < sizeof(POVC12); i++) {
- textPOV[POVBlength] = POVC12[i];
- POVBlength++;
- }
- break;
- case 14:
- for (int i=0; i < sizeof(POVC13); i++) {
- textPOV[POVBlength] = POVC13[i];
- POVBlength++;
- }
- break;
- case 15:
- for (int i=0; i < sizeof(POVC14); i++) {
- textPOV[POVBlength] = POVC14[i];
- POVBlength++;
- }
- break;
- case 16:
- for (int i=0; i < sizeof(POVC15); i++) {
- textPOV[POVBlength] = POVC15[i];
- POVBlength++;
- }
- break;
- default:
- for (int i=0; i < sizeof(POVSP); i++) {
- textPOV[POVBlength] = POVSP[i];
- POVBlength++;
- }
- }
- textPOV[POVBlength] = 0;
- POVBlength++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement