GianCann

Eurobricks Citizen
  • Content Count

    187
  • Joined

  • Last visited

1 Follower

About GianCann

Spam Prevention

  • What is favorite LEGO theme? (we need this info to prevent spam)
    LEGO City
  • Which LEGO set did you recently purchase or build?
    Ford Mustang

Profile Information

  • Gender
    Male

Extra

  • Country
    Italy

Recent Profile Visitors

1408 profile views
  1. GianCann

    New 9v motor

    The problem in not only in the motor, but also in the train ttack for 9v.
  2. GianCann

    New 9v motor

    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. GianCann

    New (Noob) Arduino Train automation project.

    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. GianCann

    New (Noob) Arduino Train automation project.

    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. GianCann

    New (Noob) Arduino Train automation project.

    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