-
Notifications
You must be signed in to change notification settings - Fork 55
STM32L475VG-DISCOVERY-IOT : add general demo #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/* Configure SPI3 for BLE | ||
MOSI: PC12 (44), MISO: PC11 (43), SCLK: PC10 (42) | ||
*/ | ||
SPIClass SPI_3(44, 43, 42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use PXn instead of pin numbering when higher than 15 (arduino header D0-D15).
/* Configure BTLE pins | ||
csPin = PD13 (50), spiIRQ = PE6 (57), reset = PA8 (31), led = LED4 | ||
*/ | ||
SPBTLERFClass BTLE(&SPI_3, 50, 57, 31, LED4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
VL53L0X *sensor_vl53l0x; | ||
|
||
TwoWire *dev_i2c; | ||
#define I2C2_SCL D33 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
This PR needs to have I2C using IT. See stm32duino/Arduino_Core_STM32#123 |
b66ee2c
to
3fd8773
Compare
@@ -0,0 +1,427 @@ | |||
/* | |||
|
|||
BTLE_sensors_tof_demo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what means tof ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time Of Flight.
Perhaps I need to rename the demo file. I can use BTLE_sensors_demo.ino as the Time Of Flight is "just" a sensor...
This sketch provides a default demo to be used on STMicroelectronics Discovery L475VG IoT board. | ||
It will use several components of the board : | ||
* Low energy Bluetooth (SPBTLE_RF) | ||
* temperature and pressure sensor (LPS22HB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use upper case or low case in a consistent way for all lines
http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html | ||
|
||
This sketch will launch 3 services on BLE : Acc, Environnemental and Time. | ||
For testing the sketch, you can download on the playstore the "BlueNRG" application provided by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can => you need to download BlueNRG application from playstore
For testing the sketch, you can download on the playstore the "BlueNRG" application provided by | ||
STMicroelectronics. (https://play.google.com/store/apps/details?id=com.st.blunrg for Android or | ||
https://itunes.apple.com/fr/app/bluenrg/id705873549?mt=8 for Apple) | ||
Enable Bluetooth and launch the application on your smartphone. Connect it to the BLueNRG device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIrst need to compile and download the example to the STM32 board right ?
No other action on the board before you can find the device in the application ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, need to compile and download... of course ;)
No other action needed on the board. (Except move in front of the vl53l0x sensor to move the cube.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just would be good to mention it to know what needs to be started first
#include <tof_gestures_TAP_1.h> | ||
|
||
/* Configure SPI3 for BLE | ||
MOSI: PC12 (44), MISO: PC11 (43), SCLK: PC10 (42) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think 42 / 43 /44 values are really useful
|
||
void loop() { | ||
|
||
BTLE.update(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does BTLE.update ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as official example.
} | ||
|
||
if(swipe_detected()){ | ||
count_swipe = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain this hard coded value of 20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just used to see an effect on the cube. On each swipe detected, we will perform 20 updates of the cube position.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but would be worth a comment in the code to explain what it does and what happens if user changes it
if(count_swipe > 0){ | ||
switch(axis_to_update){ | ||
case UPDATE_AXIS_X: | ||
p_axes->AXIS_X += 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain the 100 value choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arbitrary value to move the cube. Same as "official" BTLE example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again worth a comment .. I think if I ask questions, maybe other users will as well
@@ -1,2 +1,10 @@ | |||
# STM32Examples | |||
Provides several examples for the Arduino core for STM32 MCUs. | |||
For the complete description of each example, please refer to the comments at the beginning of each .ino file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the rational but can't we have as well a short description with picture in the example forlder of examples/STM32L475VG-DISCOVERY-IOT ?
Examples for STM32L475VG-DISCOVERY board : | ||
* BTLE_sensors_tof_demo.ino : | ||
* get environmental data and send it via BlueTooth to your smartphone. | ||
* use Time of Flight sensor to detect gestures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just understood tof means Time of Flight maybe put it here or in the example. Time of Flight (tof)
Or rename to BTLE_sensors_TimeofFligth_demo.ino
36c3298
to
af006b4
Compare
I2C IT mode available in this PR. |
af006b4
to
049f6f4
Compare
First demo on STM32L475VG-DISCOVERY-IOT board. Demo is using those components : * Low energy Bluetooth (SPBTLE_RF) * temperature and pressure sensor (LPS22HB) * temperature and humidity sensor (HTS221) * Time Of Flight sensor (VL53L0X)
049f6f4
to
a58216d
Compare
First demo on STM32L475VG-DISCOVERY-IOT board.
Demo is using those components :