This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "SerialPort.h" | |
using namespace std; | |
//String for getting the output from arduino | |
char output[MAX_DATA_LENGTH]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BAUD 9600 | |
void setup(){ | |
Serial.begin(BAUD); | |
} | |
void loop(){ | |
Serial.println("Hello From Arduino"); | |
delay(5000); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This code snippet will help you to read data from arduino | |
#include <iostream> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "SerialPort.h" | |
using std::cout; | |
using std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SerialPort.h" | |
SerialPort::SerialPort(char *portName) | |
{ | |
this->connected = false; | |
this->handler = CreateFileA(static_cast<LPCSTR>(portName), | |
GENERIC_READ | GENERIC_WRITE, | |
0, | |
NULL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SERIALPORT_H | |
#define SERIALPORT_H | |
#define ARDUINO_WAIT_TIME 2000 | |
#define MAX_DATA_LENGTH 255 | |
#include <windows.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
#define RX 10 | |
#define TX 11 | |
#define BAUD 9600 | |
#define L_DELAY 1000 | |
SoftwareSerial bt(RX , TX); | |
void setup() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "qmainwidget.h" | |
#include "ui_qmainwidget.h" | |
QMainWidget::QMainWidget(QWidget *parent) : | |
QWidget(parent), | |
ui(new Ui::QMainWidget) | |
{ | |
ui->setupUi(this); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef QMAINWIDGET_H | |
#define QMAINWIDGET_H | |
#include <QWidget> | |
#include <QListWidget> | |
#include <QListWidgetItem> | |
#include <QDebug> | |
#include "thewidgetitem.h" //Since we want to use the "TheWidgetItem" widget as the QListWidgetItem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ui version="4.0"> | |
<class>QMainWidget</class> | |
<widget class="QWidget" name="QMainWidget"> | |
<property name="geometry"> | |
<rect> | |
<x>0</x> | |
<y>0</y> | |
<width>459</width> | |
<height>329</height> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "thewidgetitem.h" | |
#include "ui_thewidgetitem.h" | |
TheWidgetItem::TheWidgetItem(QWidget *parent) : | |
QWidget(parent), | |
ui(new Ui::TheWidgetItem) | |
{ | |
ui->setupUi(this); | |
} |