Survey Tool using XinaBox xChips

Build a survey tool with which you can define and administer questionnaire to test the effect of lux on human experience / perception,

BeginnerFull instructions provided1 hour250
Survey Tool using XinaBox xChips

Things used in this project

Hardware components

CS11
XinaBox CS11
×1
IP03
XinaBox IP03
×1
OD01
XinaBox OD01
×1
SL06
XinaBox SL06
×1
XC10
XinaBox XC10
×1
SD card
×1

Story

Read more

Code

Survey.ino

Arduino
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <xCore.h>
#include <xSL06.h>
#include <xOD01.h>
#include <xinabox_logo.h>

#define Serial SerialUSB
#define APP_NAME "SURVEYS"

#define MAX_QUESTIONS 50

xSL06 SL06;
xOD01 OD01;

char questions [30][50];
int scale_type [30];
int question_length = 0;
int total_questions = 0;
int question_count = 0;

char *likit_scale[5] = {"Dislike it a lot", "Dislike it", "Neutral", "Like it", "Like it a lot"};
char *agree_scale[5] = {"Disagree strongly", "Disagree", "Neutral", "Agree", "Agree strongly"};
char *boolean_scale[5] = {"Yes / True", "No / False", "Don't know", "Don't know", "Don't know"};
extern unsigned long timestamp[MAX_QUESTIONS] = {};
extern unsigned int lux[MAX_QUESTIONS] = {};
extern byte ques_no[MAX_QUESTIONS] = {};
extern byte scale_type2[MAX_QUESTIONS] = {};
extern char *answer[MAX_QUESTIONS] = {};
extern byte answer_no[MAX_QUESTIONS] = {};
int index_pos = -1;
unsigned long serial_no = 1;
unsigned long sum_lux = 0;
int count_lux = 0;
int avg_lux = 0;
int word_count = 0;
int scale_index = 0;
unsigned long start_timer = 0;
unsigned long start_timer_lux = 0;
boolean break_loop = false;

File myFile;

uint16_t ambient_light;

struct Config {
  char filename[64];
  uint8_t scale_type;
};
String datafile;
const char *filename = "config.txt";  // <- SD library uses 8.3 filenames
Config config;                         // <- global configuration object
struct sensor_ack
{
  uint8_t SL06_ack;
};

struct sensor_ack ack;

void loadConfiguration(const char *filename, Config &config) {

  int count = 0;
  String temp_str;
  String temp_ques;
  int temp_scale = 0;

  if (SD.exists(filename))
  {
    File file = SD.open(filename);
    do
    {
      temp_str = file.readStringUntil('\n');
      temp_ques = temp_str.substring(temp_str.indexOf(":") + 1);
      temp_scale = (temp_str.substring(0, temp_str.indexOf(":"))).toInt();
      strcpy(questions[count], (temp_ques.c_str()));
      scale_type[count] = temp_scale;
      Serial.println(temp_str);
      Serial.println(temp_ques);
      Serial.println(temp_scale);
      Serial.println("temp");
      Serial.println(questions[count]);
      Serial.println(scale_type[count]);
      count++;
      total_questions++;
      Serial.println("Total Questions");
      Serial.println(total_questions);
    } while (file.peek() != -1);
    file.close();
  }

}


void handleGesture() {

  if (SL06.isGestureAvailable()) {
    switch (SL06.getGesture()) {
      case DIR_UP:

        Serial.println("UP");
        //myFile = SD.open(datafile, FILE_WRITE);

        if (index_pos != -1)
        {

          // Confirm selection code start
          OD01.clear();

          boolean first_time = true;

          OD01.home();
          OD01.println("To confirm swipe up");
          OD01.println();
          OD01.println("To go back swipe left");

          OD01.println();
          OD01.println();

          delay(1000);

          start_timer_lux = -1;
          // Wait for darkness
          while (true)
          {

            if (SL06.isGestureAvailable()) {
              int gesture = SL06.getGesture();
              if (gesture == DIR_UP)
              {
                Serial.println("Up");
                break;
              } else if (gesture == DIR_LEFT) {
                Serial.println("Left");
                break_loop = true;
                break;
              }

            }
          }

          if (break_loop)
          {
            OD01.clear();
            OD01.home();
            if (scale_type[scale_index] == 1)
            {
              OD01.println(likit_scale[index_pos]);
            } else if (scale_type[scale_index] == 2) {
              OD01.println(agree_scale[index_pos]);
            } else if (scale_type[scale_index] == 3) {
              OD01.println(boolean_scale[index_pos]);
            }

            OD01.println();
            OD01.println();
            OD01.println("Swipe Left/Right\nto change");
            OD01.println();
            OD01.println("Swipe Up to select");

            break_loop = false;
            break;
          } else {


            // Confirm selection


            question_count++;

            timestamp[scale_index] = millis();
            lux[scale_index] = avg_lux;
            ques_no[scale_index] = serial_no++;
            scale_type2[scale_index] =  scale_type[scale_index];
            if (scale_type[scale_index] == 1)
            {
              answer[scale_index] = likit_scale[index_pos];
            } else if (scale_type[scale_index] == 2) {
              answer[scale_index] = agree_scale[index_pos];
            } else if (scale_type[scale_index] == 3) {
              answer[scale_index] = boolean_scale[index_pos];
            }
            answer_no[scale_index] = index_pos + 1;

            scale_index++;

            OD01.clear();
            OD01.home();


            delay(500);
            OD01.clear();
            OD01.home();
            OD01.set2X();
            OD01.println("RECORDED");
            OD01.set1X();

            delay(500);

            OD01.clear();
            OD01.home();

            int i = 0;

            word_count = 0;

            // Show Question
            do
            {
              OD01.print(questions[scale_index][i++]);
              word_count++;
              if (word_count > 20)
              {
                OD01.println();
                word_count = 0;
              }
            } while (questions[scale_index][i] != '\0');

            // Break Questions into lines (for > 20)
            if (word_count < 20)
            {
              OD01.println();
            }

            if (scale_type[scale_index] == 1)
            {
              for (int i = 0; i < 5; i++)
              {
                OD01.print(i + 1); OD01.print("."); OD01.println(likit_scale[i]);
              }
            } else if (scale_type[scale_index] == 2) {
              for (int i = 0; i < 5; i++)
              {
                OD01.print(i + 1); OD01.print("."); OD01.println(agree_scale[i]);
              }
            } else if (scale_type[scale_index] == 3) {
              for (int i = 0; i < 5; i++)
              {
                OD01.print(i + 1); OD01.print("."); OD01.println(boolean_scale[i]);
              }
            }

            delay(1000);
          }


          index_pos = -1;
        }

        break;
      case DIR_LEFT:
        Serial.println("LEFT");
        index_pos--;

        if (index_pos > 4)
        {
          index_pos = 4;
        } else if (index_pos < 0)
        {
          index_pos = 0;
        }

        Serial.println(index_pos);

        if (index_pos > -1)
        {
          OD01.clear();
          OD01.home();
          if (scale_type[scale_index] == 1)
          {
            OD01.println(likit_scale[index_pos]);
          } else if (scale_type[scale_index] == 2) {
            OD01.println(agree_scale[index_pos]);
          } else if (scale_type[scale_index] == 3) {
            OD01.println(boolean_scale[index_pos]);
          }
        }

        // Show instructions
        OD01.println();
        OD01.println();
        OD01.println("Swipe Left/Right\nto change");
        OD01.println();
        OD01.println("Swipe Up to select");
        break;

      case DIR_RIGHT:
        Serial.println("RIGHT");
        index_pos++;

        if (index_pos > 4)
        {
          index_pos = 4;
        } else if (index_pos < 0)
        {
          index_pos = 0;
        }

        Serial.println(index_pos);

        if (index_pos > -1)
        {
          OD01.clear();
          OD01.home();
          if (scale_type[scale_index] == 1)
          {
            OD01.println(likit_scale[index_pos]);
          } else if (scale_type[scale_index] == 2) {
            OD01.println(agree_scale[index_pos]);
          } else if (scale_type[scale_index] == 3) {
            OD01.println(boolean_scale[index_pos]);
          }
        }

        // Show instructions
        OD01.println();
        OD01.println();
        OD01.println("Swipe Left/Right\nto change");
        OD01.println();
        OD01.println("Swipe Up to select");
        break;
      default:
        Serial.println("NONE");
    }

  }
}


void setup() {

  Wire.begin();
  OD01.begin();
  logo.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  if (xCore.ping(0x39))
  {
    ack.SL06_ack = 0xFF;
    SL06.begin();
    SL06.enableGestureSensor(false);
    delay(1000);
  } else
  {
    ack.SL06_ack = 0x00;
    OD01.clear();
    OD01.println("SL06 not");
    OD01.println("connected");
    while (true);
  }
  Serial.begin(115200);

  draw_logo();

  delay(3000);

  OD01.clear();
  OD01.home();
  OD01.println(APP_NAME);

  delay(2000);

  OD01.clear();
  OD01.home();

  OD01.println("Initializing");
  OD01.println("SD card");

  delay(2000);

  if (!SD.begin(3)) {
    OD01.println();
    OD01.println();
    OD01.println("SD card FAILED!");
    while (1);
  }

  OD01.println();
  OD01.println();

  // SD card initialized
  OD01.println("SD card initialized");

  delay(2000);

}

void loop() {

  loadConfiguration("survey.txt", config);
  index_pos = -1;
  scale_index = 0;
  serial_no = 1;
  question_count = 0;

  // Welcome screen
  OD01.clear();
  OD01.home();
  OD01.println("Ready to start");
  OD01.println("questionnaire");
  OD01.println("Data will be saved to");
  OD01.println("data.csv");
  OD01.println("Swipe right to cont.");

  // Wait for right swipe
  while (SL06.getGesture() != DIR_RIGHT)
  {
    delay(100);
  }

  OD01.clear();
  delay(2000);

  // Hold for 15 seconds
  OD01.clear();
  OD01.println("Hold the instrument");
  OD01.println("horizontally near");
  OD01.println("your subject for");
  OD01.println("15 seconds");

  delay(11000);

  start_timer = millis();


  SL06.enableLightSensor(false);
  delay(1000);

  OD01.clear();
  OD01.home();
  OD01.println("Measuring Lux...");

  do
  {
    SL06.getAmbientLight(ambient_light);
    sum_lux +=  ambient_light;
    count_lux++;
    delay(100);
  } while ((millis() - start_timer) < 3000);

  avg_lux = sum_lux / count_lux;

  SL06.disableLightSensor();
  delay(1000);

  OD01.clear();
  OD01.home();
  question_length = strlen(questions[0]);

  int i = 0;

  word_count = 0;
  do
  {
    OD01.print(questions[0][i]);
    Serial.print(questions[0][i]);
    word_count++;
    if (word_count > 20)
    {
      OD01.println();
      word_count = 0;
    }
    i++;
  } while (questions[0][i] != '\0');

  if (word_count < 20)
  {
    OD01.println();
    Serial.println();
  }

  Serial.println("Finished");

  if (scale_type[0] == 1)
  {
    for (int i = 0; i < 5; i++)
    {
      OD01.print(i + 1); OD01.print(". "); OD01.println(likit_scale[i]);
    }
  } else if (scale_type[0] == 2) {
    for (int i = 0; i < 5; i++)
    {
      OD01.print(i + 1); OD01.print(". "); OD01.println(agree_scale[i]);
    }
  } else if (scale_type[0] == 3) {
    for (int i = 0; i < 5; i++)
    {
      OD01.print(i + 1); OD01.print(". "); OD01.println(boolean_scale[i]);
    }
  }

  while (true)

  {
    handleGesture();
    if (question_count == total_questions)
    {

      /*
         Write all survey data to SD card at once
      */

      myFile = SD.open(datafile);
      datafile = "data.csv";
      if (!SD.exists(datafile))
      {

        myFile = SD.open(datafile, FILE_WRITE);
        if (myFile) {
          myFile.print("Timestamp"); myFile.print(",");
          myFile.print("LUX"); myFile.print(",");
          myFile.print("Question #"); myFile.print(",");
          myFile.print("Scale type(1-3)"); myFile.print(",");
          myFile.print("Answer"); myFile.print(",");
          myFile.print("Answer(1-5)"); myFile.print(",");
          myFile.println();
          myFile.close();
        } else {
          OD01.clear();
          OD01.home();
          OD01.println("Error creating file");
          while (true);
        }
      }

      myFile = SD.open(datafile, FILE_WRITE);

      if (myFile)
      {
        for (int i = 0; i < total_questions; i++)
        {
          myFile.print(timestamp[i]); myFile.print(",");
          myFile.print(lux[i]); myFile.print(",");
          myFile.print(ques_no[i]); myFile.print(",");
          myFile.print(scale_type2[i]); myFile.print(",");
          myFile.print(answer[i]); myFile.print(",");
          myFile.print(answer_no[i]); myFile.print(",");
          myFile.println();
        }
        myFile.close();

        delay(1000);
      } else
      {
        OD01.clear();
        OD01.println("Error saving file");
        Serial.println("Error saving file");
        while (true);
      }

      question_count = 0;
      total_questions = 0;
      OD01.clear();
      OD01.home();
      OD01.set2X();
      OD01.println("Thank you");
      OD01.set1X();
      delay(2000);
      break;
    }
  }
}

Survey.uf2

Arduino
No preview (download only).

xinabox_logo.cpp

Arduino
//

xinabox_logo.h

Arduino
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define LOGO_HEIGHT   62
#define LOGO_WIDTH    128
#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)

Adafruit_SSD1306 logo(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// 'xinabox_logo', 128x62px
const unsigned char logo_xinabox [] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x31, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00,
  0x0f, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xc3, 0xc0, 0x71, 0x80, 0x70, 0x00, 0x38, 0x00, 0x00,
  0x0f, 0x87, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc3, 0xc0, 0x71, 0xc0, 0x70, 0x00, 0x38, 0x00, 0x00,
  0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc3, 0xc0, 0x71, 0xe0, 0x70, 0x00, 0x3c, 0x00, 0x00,
  0x0f, 0x81, 0xff, 0xff, 0xff, 0xfe, 0x07, 0xc3, 0xc0, 0x71, 0xf0, 0x70, 0x00, 0x7c, 0x00, 0x00,
  0x0f, 0xc0, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0xc3, 0xc0, 0x71, 0xf0, 0x70, 0x00, 0x7e, 0x00, 0x00,
  0x0f, 0xe0, 0x7f, 0xff, 0xff, 0xf8, 0x1f, 0xc3, 0xc0, 0x71, 0xf8, 0x70, 0x00, 0xfe, 0x00, 0x00,
  0x0f, 0xf0, 0x3f, 0xff, 0xff, 0xf0, 0x3f, 0xc3, 0xc0, 0x71, 0xfc, 0x70, 0x00, 0xee, 0x00, 0x00,
  0x0f, 0xf8, 0x1f, 0xff, 0xff, 0xe0, 0x7f, 0xc3, 0xc0, 0x71, 0xde, 0x70, 0x00, 0xef, 0x00, 0x00,
  0x0f, 0xfc, 0x0f, 0xff, 0xff, 0xc0, 0xff, 0xc3, 0xc0, 0x71, 0xcf, 0x70, 0x01, 0xff, 0x00, 0x00,
  0x0f, 0xfe, 0x07, 0xff, 0xff, 0x81, 0xff, 0xc3, 0xc0, 0x71, 0xc7, 0xf0, 0x01, 0xff, 0x80, 0x00,
  0x0f, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xc3, 0xc0, 0x71, 0xc3, 0xf0, 0x03, 0xff, 0x80, 0x00,
  0x0f, 0xff, 0x81, 0xff, 0xfe, 0x07, 0xff, 0xc3, 0xc0, 0x71, 0xc1, 0xf0, 0x03, 0x83, 0x80, 0x00,
  0x0f, 0xff, 0xc0, 0xff, 0xfc, 0x0f, 0xff, 0xc3, 0xc0, 0x71, 0xc1, 0xf0, 0x03, 0x83, 0xc0, 0x00,
  0x0f, 0xff, 0xe0, 0x7f, 0xf8, 0x1f, 0xff, 0xc3, 0xc0, 0x71, 0xc0, 0xf0, 0x07, 0x01, 0xc0, 0x00,
  0x0f, 0xff, 0xf0, 0x3f, 0xf0, 0x3f, 0xff, 0xc3, 0xc0, 0x71, 0xc0, 0x70, 0x07, 0x01, 0xe0, 0x00,
  0x0f, 0xff, 0xf8, 0x1f, 0xe0, 0x7f, 0xff, 0xc3, 0xc0, 0x71, 0xc0, 0x30, 0x0f, 0x00, 0xe0, 0x00,
  0x0f, 0xff, 0xfc, 0x0f, 0xc0, 0xff, 0xff, 0xc3, 0xc0, 0x71, 0xc0, 0x10, 0x0e, 0x00, 0xe0, 0x00,
  0x0f, 0xff, 0xfe, 0x07, 0x81, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0x03, 0x03, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xe0, 0x1f, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xc0, 0x0f, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0x80, 0x07, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0x03, 0x03, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xfe, 0x07, 0x81, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xfc, 0x0f, 0xc0, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xf8, 0x1f, 0xe0, 0x7f, 0xff, 0xc3, 0xc0, 0x7f, 0xe0, 0x0f, 0xc0, 0xc0, 0x03, 0x80,
  0x0f, 0xff, 0xf0, 0x3f, 0xf0, 0x3f, 0xff, 0xc3, 0xc0, 0x7f, 0xf0, 0x3f, 0xf1, 0xe0, 0x07, 0x80,
  0x0f, 0xff, 0xe0, 0x7f, 0xf8, 0x1f, 0xff, 0xc3, 0xc0, 0x7f, 0xf8, 0x7f, 0xf8, 0xf0, 0x0f, 0x80,
  0x0f, 0xff, 0xc0, 0xff, 0xfc, 0x0f, 0xff, 0xc3, 0xc0, 0x78, 0x38, 0xf8, 0x3c, 0x78, 0x1f, 0x00,
  0x0f, 0xff, 0x81, 0xff, 0xfe, 0x07, 0xff, 0xc3, 0xc0, 0x70, 0x38, 0xe0, 0x1e, 0x3c, 0x3e, 0x00,
  0x0f, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xc3, 0xc0, 0x70, 0x39, 0xc0, 0x0e, 0x1e, 0x7c, 0x00,
  0x0f, 0xfe, 0x07, 0xff, 0xff, 0x81, 0xff, 0xc3, 0xc0, 0x78, 0x79, 0xc0, 0x07, 0x0f, 0xf8, 0x00,
  0x0f, 0xfc, 0x0f, 0xff, 0xff, 0xc0, 0xff, 0xc3, 0xc0, 0x7f, 0xf1, 0xc0, 0x07, 0x07, 0xf0, 0x00,
  0x0f, 0xf8, 0x1f, 0xff, 0xff, 0xe0, 0x7f, 0xc3, 0xc0, 0x7f, 0xf1, 0xc0, 0x07, 0x03, 0xe0, 0x00,
  0x0f, 0xf0, 0x3f, 0xff, 0xff, 0xf0, 0x3f, 0xc3, 0xc0, 0x7f, 0xf9, 0xc0, 0x07, 0x07, 0xe0, 0x00,
  0x0f, 0xe0, 0x7f, 0xff, 0xff, 0xf8, 0x1f, 0xc3, 0xc0, 0x78, 0x39, 0xc0, 0x07, 0x0f, 0xf0, 0x00,
  0x0f, 0xc0, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0xc3, 0xc0, 0x70, 0x1d, 0xc0, 0x07, 0x1f, 0x78, 0x00,
  0x0f, 0x81, 0xff, 0xff, 0xff, 0xfe, 0x07, 0xc3, 0xc0, 0x70, 0x1c, 0xe0, 0x0e, 0x3e, 0x3c, 0x00,
  0x0f, 0x03, 0xff, 0xff, 0xff, 0xff, 0x03, 0xc3, 0xc0, 0x70, 0x38, 0xf0, 0x1e, 0x7c, 0x1e, 0x00,
  0x0f, 0x87, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc3, 0xc0, 0x7f, 0xf8, 0x7c, 0x7c, 0xf8, 0x0f, 0x00,
  0x0f, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xc3, 0xc0, 0x7f, 0xf0, 0x3f, 0xf9, 0xf0, 0x07, 0x80,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x7f, 0xe0, 0x1f, 0xe0, 0xe0, 0x03, 0x80,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x3f, 0x80, 0x01, 0x00, 0x40, 0x01, 0x00,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void draw_logo(void) {
  logo.clearDisplay();

  logo.drawBitmap(
    (logo.width()  - LOGO_WIDTH ) / 2,
    (logo.height() - LOGO_HEIGHT) / 2,
    logo_xinabox, LOGO_WIDTH, LOGO_HEIGHT, 1);
  logo.display();
  delay(1000);
}

Example survey.txt File

Arduino
An example of the survey.txt file that is needed
3:Do you like surveys?
1:How much do you like surveys?
2:Do you agree that surveys are fun?

Credits

Rachel Janse van Rensburg

Rachel Janse van Rensburg

8 projects • 2 followers
PragmaticPhil

PragmaticPhil

13 projects • 12 followers
Hobbyist: some of this I write from scratch, some I work with developers and test / edit. Java + micro:bit are my thing. Work at XinaBox.cc.
KalbeAbbas

KalbeAbbas

25 projects • 12 followers
An enthusiastic and dedicated Electronic engineer graduated from SSUET Karachi, Pakistan. Loves to discover Embedded electronics projects.

Comments