Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SensorNode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Proof of Concept
SensorNode
Commits
9106b665
Commit
9106b665
authored
Nov 08, 2015
by
PhiBo
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Controll ESP8266 Module
parent
e78d9065
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
src/main.ino
src/main.ino
+21
-2
No files found.
src/main.ino
View file @
9106b665
...
...
@@ -9,8 +9,11 @@
#define RPC_NUM_HANDLERS 20
#define RPC_NUM_FUNCTIONS 0
SoftwareSerial
mySerial
(
10
,
11
);
#define PIN_ESP8266_SET 2
#define PIN_ESP8266_MODE 3
#define PIN_ESP8266_CH_PD 7
SoftwareSerial
mySerial
(
10
,
11
);
//ArduRPC rpc = ArduRPC(RPC_NUM_HANDLERS, RPC_NUM_FUNCTIONS);
//ArduRPC_Serial rpc_serial = ArduRPC_Serial(RPC_SERIAL_PORT, rpc);
...
...
@@ -19,11 +22,16 @@ SoftwareSerial mySerial(10, 11);
ArduRPCRequest
rpc_request
=
ArduRPCRequest
();
ArduRPCRequest_Serial
h
=
ArduRPCRequest_Serial
(
rpc_request
,
RPC_SERIAL_PORT
);
SensorWifiModuleRemote
sensor_remote
=
SensorWifiModuleRemote
(
rpc_request
,
0x
1
0
);
SensorWifiModuleRemote
sensor_remote
=
SensorWifiModuleRemote
(
rpc_request
,
0x
0
0
);
SensorNode
sensor_node
=
SensorNode
();
void
setup
()
{
pinMode
(
PIN_ESP8266_SET
,
OUTPUT
);
pinMode
(
PIN_ESP8266_MODE
,
OUTPUT
);
pinMode
(
PIN_ESP8266_CH_PD
,
OUTPUT
);
digitalWrite
(
PIN_ESP8266_CH_PD
,
LOW
);
RPC_SERIAL_PORT
.
begin
(
RPC_SERIAL_BAUD
);
/*sensor_dht = new DHT(6, DHT22);
sensor_dht->begin();*/
...
...
@@ -39,6 +47,17 @@ void loop() {
//rpc_serial.readData();
//sensor_dht->readTemperature();
sensor_node
.
run
();
digitalWrite
(
PIN_ESP8266_SET
,
HIGH
);
digitalWrite
(
PIN_ESP8266_MODE
,
HIGH
);
digitalWrite
(
PIN_ESP8266_CH_PD
,
HIGH
);
// Wait for bootloader
delay
(
250
);
digitalWrite
(
PIN_ESP8266_MODE
,
LOW
);
digitalWrite
(
PIN_ESP8266_SET
,
LOW
);
// Wait until boot
delay
(
250
);
sensor_node
.
submitValues
(
&
sensor_remote
);
digitalWrite
(
PIN_ESP8266_CH_PD
,
LOW
);
delay
(
5000
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment