Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
neOCampus-arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GIS-neOCampus
neOSensor
neOCampus-arduino
Commits
d2c512c9
Commit
d2c512c9
authored
2 years ago
by
Marie Bureau
Browse files
Options
Downloads
Patches
Plain Diff
add relay opening gate
parent
cc8ffca2
No related branches found
No related tags found
1 merge request
!4
My gates ble
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/myGates_BLE_Beacon_Scanner/myGates_BLE_Beacon_Scanner.ino
+13
-3
13 additions, 3 deletions
...myGates_BLE_Beacon_Scanner/myGates_BLE_Beacon_Scanner.ino
with
13 additions
and
3 deletions
tests/myGates_BLE_Beacon_Scanner/myGates_BLE_Beacon_Scanner.ino
+
13
−
3
View file @
d2c512c9
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00) >> 8) + (((x)&0xFF) << 8))
#define ENDIAN_CHANGE_U16(x) ((((x)&0xFF00) >> 8) + (((x)&0xFF) << 8))
#define HIGH2BITS_U16(x) (((x)&0b1100000000000000) >> 14)
#define HIGH2BITS_U16(x) (((x)&0b1100000000000000) >> 14)
#define RELAY1 32
#define NAVETTE_UUID "DEADDEAD-F88F-0042-F88F-010203040506" // same UUID for all vehicles
#define NAVETTE_UUID "DEADDEAD-F88F-0042-F88F-010203040506" // same UUID for all vehicles
#define FORCEGATEOPEN 0b01 // minor high bits = 0b01 => force gate to open
#define FORCEGATEOPEN 0b01 // minor high bits = 0b01 => force gate to open
#define CLEARGATECALIBRATION 0b11 // minor high bits = 0b11 => clear gate calibration
#define CLEARGATECALIBRATION 0b11 // minor high bits = 0b11 => clear gate calibration
...
@@ -112,6 +114,9 @@ class IBeaconAdvertised: public BLEAdvertisedDeviceCallbacks {
...
@@ -112,6 +114,9 @@ class IBeaconAdvertised: public BLEAdvertisedDeviceCallbacks {
// ***** open gate *****
// ***** open gate *****
void
openGate
()
{
void
openGate
()
{
Serial
.
println
(
" OPENING GATE"
);
Serial
.
println
(
" OPENING GATE"
);
digitalWrite
(
RELAY1
,
HIGH
);
delay
(
1000
);
digitalWrite
(
RELAY1
,
LOW
);
}
}
// ***** is frame iBeacon ? *****
// ***** is frame iBeacon ? *****
...
@@ -221,7 +226,11 @@ class IBeaconAdvertised: public BLEAdvertisedDeviceCallbacks {
...
@@ -221,7 +226,11 @@ class IBeaconAdvertised: public BLEAdvertisedDeviceCallbacks {
void
setup
()
{
void
setup
()
{
Serial
.
begin
(
115200
);
Serial
.
begin
(
115200
);
BLEDevice
::
init
(
""
);
pinMode
(
RELAY1
,
OUTPUT
);
//init state
STATE
=
STATE_SCAN
;
//init tabRSSI
//init tabRSSI
tabRSSI
[
0
].
val
=
-
100
;
tabRSSI
[
0
].
val
=
-
100
;
...
@@ -229,8 +238,9 @@ void setup() {
...
@@ -229,8 +238,9 @@ void setup() {
tabRSSI
[
0
].
time
=
0
;
tabRSSI
[
0
].
time
=
0
;
tabRSSI
[
1
].
time
=
0
;
tabRSSI
[
1
].
time
=
0
;
//init state
STATE
=
STATE_SCAN
;
BLEDevice
::
init
(
""
);
}
}
void
loop
()
{
void
loop
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment