Jump to content

GianCann

Eurobricks Citizen
  • Posts

    187
  • Joined

  • Last visited

Everything posted by GianCann

  1. The problem in not only in the motor, but also in the train ttack for 9v.
  2. Why not?...
  3. Sorry for the mistake: the correct value is x45 (Port Value)
  4. This command enable the "notification service" from the specific characteristics. Is related to BLE stack: https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial
  5. Ok, I don't use official App, but uPyCraft ;) They are the LWP command to enable the "Port value changes notification" , and the Hub properties from the Hub: https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#format-of-port-input-format-setup-single Enable this notification, the Hub, send a message every time a port change his value (button pressed, button released) and you obtain this message with the BLE callback function, without reading in a loop the port value.
  6. @Vinz1911 Have you used a USB cable to connect the Spike Hub to the PC?
  7. Good morning @Vinz1911 You can find here an example related to use a Spike Prime Hub as BLE Central Role, with notify subscription from the BLE Peripheral (in this case, the PU Remote Control): https://github.com/GianCann/SpikePrimeHub/tree/master/ble After download the code on the Spike, you can connect to a specific remote control with this command: bt.gap_connect(0,b'\xa4\x34\xf1\x9b\x07\x9e',2000) Where \xa4\x34\xf1\x9b\x07\x9e is the BLE Address of the device you want to connect (you can find with the command bt.gap_scan(10000, 30000, 30000) or with the app nRF Connect ) After connected with the remote, if you push a any button, you get a value in this format: \x05\x00\x0E\x00\x01 - The first byte (x05) is the lengh of the entire message (5 bytes) - The second byte (x00) is not used at this moment - The third byte (x0E) is related to "Button device" (you can ignore this) - The fourth byte can be 0x00 (Buttons A) or 0x01 (Buttons B) - The last byte can be: x01 = Button '+' pressed, xFF = Button '-' pressed, x7F = Button 'red' pressed, x00 = (any) Button released So, if you press (and hold pressed) the B+ button you receive the \x05\x00\x0E\x01\x01 data, and when released the button you receive \x05\x00\x0E\x01\x00 Or, if you press (and hold pressed) the A- button you receive the \x05\x00\x0E\x00\xFF data, and when released the button you receive \x05\x00\x0E\x00\x00 For the central green button you receive: \x05\x00\x08\x02\x01 when pressed \x05\x00\x08\x02\x00 when released Note: with my example you don't need to read the data in loop, because the code subcribe the notification from the remote, so you receive the datawith the _IRQ_GATTC_NOTIFY event. Tell me if you need other infos ;)
  8. Sorry @Vinz1911. You have to wait tomorrow, because I am still out of my home for now...
  9. Hi @Vinz1911, I get the Spike Prime Hub work with the PU Remote. Later, I send to you the code ;)
  10. I think that nControl is very, very, very good product with a lot of potential. I believe that @Lowa has already done a great job and that the next releases will be even more versatile, with additional features for even the most demanding AFOL maker. I suggest you check the 4DBrix forum https://www.4dbrix.com/forum/index.php and maybe test the software yourself.
  11. Amazon has finally delivered the sensor to me! I am very surprised: it is very small (and the size can be further reduced by removing the connector and cutting off the excess of the PCB not used). I plugged it directly into a UART adapter and opened a terminator session. He immediately started to send me the reading in mm of the detected distance. With simple commands you can set the transmission speed of the readings (with a minimum of 10ms) and also the maximum range that you want to monitor. Therefore, if it is set to the 100mm (10cm) range it will ignore anything beyond 10cm, even if it passes in front of the sensor.
  12. I have also buyed a small laser sensor: the TOF10120. It have a range up to 180cm and I2C and UART port https://www.amazon.it/gp/product/B0859YKHGB Amazon delivers the item to me today so I can test it later and tell you how it works
  13. I think a range of 10cm is an optimal solution to detect a train. I always prefer the smaller electronic solution ... it's my fixation: like that of using the ESP-03 instead of the more comfortable ESP-12F
  14. I have another small alternative to detect the presence of a train: the GP2Y0D810Z0F Is a very small IR sensor with a digital output (0 or 1) when an object is in a range 2-10 cm. See other details here: https://www.pololu.com/product/1134
  15. Even with a speeded train?
  16. Can you give me a picture or a video?
  17. Hi @aawsum , can you tell me which type of RFID reader you have used?
  18. Great work! The ATOM Matrix is a very useful board. I have 5 of this :)
  19. No. The ESP32 has a minor I/O respect to the Arduino 2560. I think, however, that you don't need so many I/O port. Note: there are many dev-board based on ESP32 chip. Start to explain how many (and the type of) trains/switch/sensor you want to be using.
  20. Sorry, for the lack of clarity due to my poor English. I meant that the best choice is to use an ESP32 instead of an HC-05 module.
  21. It's not simple to answer to your question because there are a lot of things to take in consideration. For example: why use a HC-05 when you use an ESP32 with a Legoino library?
  22. Hi @1963maniac, I made a search with "ncontrols eurobricks" on Google and I don't find so many interesting topic for advanced use of the software. I want to start a thread for sharing ideas and solution based on this software.
×
×
  • Create New...