Mithya
Created September 4, 2024

Indoor Information Accessibility System

Indoor Information Accessibility System for Visually Impaired Individuals

18
Indoor Information Accessibility System

Things used in this project

Story

Read more

Code

nRF52840 DK Code

C/C++
#include <nRF52840.h>
#include <BluetoothSerial.h>

BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200);
  SerialBT.begin("nRF52840_TTS");
  Serial.println("Bluetooth TTS started");
}

void loop() {
  if (Serial.available()) {
    String receivedText = Serial.readStringUntil('\n');
    Serial.println("Received text: " + receivedText);
    
    // Send text to TTS module or smartphone app
    sendToTTS(receivedText);
  }
}

void sendToTTS(String text) {
  // Implement TTS sending logic here.
  SerialBT.print(text);
}

Notecard Initialization Code

C/C++
#include <Wire.h>
#include <Notecard.h>

const char *NOTECARD_I2C_ADDRESS = "0x55";  // I2C address for Notecard
Notecard note;

void setup() {
  Serial.begin(115200);
  Wire.begin();
  
  if (!note.begin(NOTECARD_I2C_ADDRESS)) {
    Serial.println("Failed to initialize Notecard");
    while (1);  // Halt if initialization fails
  }
  
  // Example: Configure Notecard for cellular communication
  note.sendCmd(Serial, "card.network");
  note.sendCmd(Serial, "card.location");
}

void loop() {
  // Example: Send text to a server
  sendText("Example Text: Welcome to the exhibit.");
  delay(10000);  // Send data every 10 seconds
}

void sendText(const char* text) {
  char cmd[256];
  snprintf(cmd, sizeof(cmd), "{\"type\":\"note\",\"body\":{\"text\":\"%s\"}}", text);
  note.sendCmd(Serial, cmd);
}

Credits

Mithya

Mithya

1 project • 0 followers

Comments