Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Check_VL6180XA1_ToF
Fork of X_NUCLEO_6180XA1 by
Diff: x_nucleo_6180xa1.h
- Revision:
- 7:2dc81120c917
- Parent:
- 4:a5abf7757947
- Child:
- 10:4954b09b72d8
diff -r 6a09fe77ad3c -r 2dc81120c917 x_nucleo_6180xa1.h
--- a/x_nucleo_6180xa1.h Fri Sep 18 13:19:50 2015 +0000
+++ b/x_nucleo_6180xa1.h Fri Sep 25 12:12:51 2015 +0200
@@ -54,26 +54,37 @@
protected:
public:
- X_NUCLEO_VL6180XA1(); // verificare se necessario passare come argomento un dev_i2c
- bool VL6180X_Init(); // controlla la presenza del sensore , chiamo Prepare() e setto ready
- // modificare l'indirizzo i2c dei sensori (slave address)
+ X_NUCLEO_VL6180XA1(DevI2C *i2c)): dev_i2c(i2c),
+ vl6180x_top(new VL6180X()),
+ vl6180x_left(new VL6180X()),
+ vl6180x_bottom(new VL6180X()),
+ vl6180x_right(new VL6180X()),
+ display(new Display(i2c)),
+ gpio_expander(i2c));
- VL6180X *vl6180x_sensor;
+ VL6180X *vl6180x_top;
+ VL6180X *vl6180x_left;
+ VL6180X *vl6180x_bottom;
+ VL6180X *vl6180x_right;
Display *display;
GPIO_expander *gpio_expander;
DevI2C *dev_i2c;
- //posso creare 4 puntatori a istanze di tipo VL6180X, con i nomi della board(S1, left, bottom, right)
- //oppure posso creare un vettore di VL6180X di dimensione 4 per contenere tutti i sensori
- //dopo tengo traccia di quali sensori sono presenti e funzionanti
+ X_NUCLEO_VL6180XA1 *Instance(DevI2C *i2c)
+ {
+ if(_instance==NULL)
+ _instance=new X_NUCLEO_6180XA1(i2c);
+ else
+ errore
+ }
private:
- static X_NUCLEO_IKS01A1 *instance;
+ static X_NUCLEO_6180XA1 *_instance;
}
*/
-#endif /* __X_NUCLEO_6180XA1_H */
\ No newline at end of file
+#endif /* __X_NUCLEO_6180XA1_H */
