Snapshot

Eurobricks Citizen
  • Content Count

    163
  • Joined

  • Last visited

About Snapshot

  • Birthday April 11

Spam Prevention

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

Profile Information

  • Gender
    Male
  • Location
    Wiltshire

Extra

  • Country
    England

Recent Profile Visitors

601 profile views
  1. Oh, I used to be and most of it was real-time stuff to do with telephone exchanges and data comms so using flags to control things takes me right back thirty years and more. It's just that C has never been part of my life before.
  2. Thanks, that's what I suspected about the colours. I was able to set up the code for a four-state hub state yellow this afternoon and it works. I had to do a bit of Googling to find the Return statement to stop the code dropping through the detected If statement and executing the one that the hub state had just changed to. I've never learned any version of C which is hampering me a bit.....
  3. Unfortunately, that doesn't change the stopping distance as what it does affect is the time between detections. If it's more than the configured time since the last detection then the sensor responds immediately to the next. But if it's less than that, the sensor will miss a second coloured plate that's too close to the first. I've taken it down to 800mS to make the loco slow down on one plate and stop on the second as @Lok24 suggested. This works very well. However, that throws up another problem of what colours the sensor will detect reliably. Red, white and yellow are fine but I need a fourth. Orange is detected as red. blue & green aren't detected at all and I haven't got any other colours without going out to the garage to hunt for something. Have you found any others that work?
  4. 1. Well, yes, obviously. 2. A better idea and one I was going to use with my NXT-controlled PF trains. However, there is definitely a delay in BAP compared with the same function in the PoweredUp app. I went back to the app and found what I wanted was very simple: And, at the same speed, this stops the loco within four or five studs. I wouldn't be at all surprised if it's Windows getting in the way and slowing everything down. Still, whichever device I use as the controller, I can now continue with the rest of the design of the GBC module.
  5. I have it working now so many thanks for the assistance. Everything looked fine but the sensor wasn't detecting the coloured plates on the track until I lowered it by one brick. My only disappointment now is how far the loco runs (about 12 studs) after the colour detection.
  6. I'm testing on a very short length of track so I've changed the first RampMotorSpeed to a simple Stop and adjusted the second to 0,20,500 and 0,-20,500. So the hub is detected by BAP when I turn it on, I Start Sensor Events and nothing happens. I can start the motor using the slider under Hubs but the sensor doesn't pick up the colour plates. What fundamental principle am I missing in how BAP works? From a programming POV what initialises the state variable? I'll be away for the rest of the day as I now have a 300km round trip to London to see my mother.
  7. I think it actually needs a comma inserted between the "A" and the 0, compared with the version in the first set of code, but I will check the syntax of the instruction. Thanks for spotting the faulty line.
  8. @Lok24 Many thanks for the fast response. It took me a while to work out but I finally got there and I pasted the appropriate bits of your code into each sensor event. When I try to run them from the code editor, White compiles correctly but Red gives the following syntax errors: Compiling code ... Compiling failed. Error (CS1026): ) expected Error (CS1002): ; expected Error (CS1525): Invalid expression term ',' Error (CS1002): ; expected Error (CS1525): Invalid expression term ',' Error (CS1002): ; expected Error (CS1002): ; expected Error (CS1525): Invalid expression term ')' There's probably a single character typo in there which I'll hunt down once I'm on a larger screen than this little 13" laptop. Thanks again Jonathan
  9. I'm having trouble grokking how to configure this software. All I want initially is my loco (PoweredUp hub, train motor, colour & distance sensor) to go forwards until it detects red,wait a few seconds, go backwards until it sees white, wait a few seconds, go forwards again, repeat..... What I'm after next is two trains in a layout with three stations but the central one is a passing point. I can write the pseudo-code for it easily enough as I've had it working using NXT and PF control so I'm hoping I can write this one myself once I see how the first one works. If someone would be kind enough to help an old man, I'd be very grateful.
  10. Snapshot

    Running PF Motors from the Power Grid

    Yes, ideal for GBC modules that run at full speed, leaving the train controllers for those that don't. The only downside is that it's not as easy to turn off as a train controller. I'll be buying some once they're in the European shop.
  11. Snapshot

    [GBC] Need some help please

    I could get the same effect by just slowing the belt down but it would drop below one ball per second which I need as I do collaborative displays. I think Great Ball Pit's suggestion of a splitter fails for the same reason but I'll look at it as it might be adaptable to drop one out of three. I thought about asymmetrically spacing the pins but decided it was a non-starter as there's not enough control over the starting position or, as you note, a ball not being picked up. I like the idea of a moving block, however, and will see what I can come up with.
  12. So I built this dropping-bucket module. It's not original but I think I've improved considerably on the one that inspired me. The buckets drop once they receive two balls and it works well as long as the ball delivery is slow enough. At the requisite one-ball-per-second the first bucket doesn't always have time to get back into position before the third ball arrives. That ball then might drop through into the second bucket or hit the edge of the first one and bounce out completely. It's not a friction or interference problem as I padded the structure out with liftarms so the swinging arms only touch at the pivot points. There's a certain amount that can be done by changing the balance of the arm but the total travel time seems to stay effectively the same. There are hard stops at each end of the travel. So what I think I need is something that will release two balls at a time, possibly in the ramp between conveyor belt and the buckets, and I'd greatly appreciate any suggestions. Front Back Showing maximum travel
  13. Snapshot

    [GBC] Cardan Lift

    I'm about to start my build of this. Wish me luck......
  14. Thanks. I'll add that module to my build list and investigate when it gets to the top.
  15. Does that (whatever it is) actually work or does the increased height require some re-engineering? I have some wheels that are the right diameter but are too tall to be direct replacements.