-
Posts
1,240 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by Lok24
-
hi, thanks. yes, got different examples using GATT. I'll have a closer look at those. The idea is to read the buttons of the handheld. + accelerates until you release the button - descending until you release the button And my programm does, if it doesnt fail for any reasons....
-
Yes, that's what I did with SBrick. just wrote a small routine to test, works fine, but only sending commands But how to send i.E. "000f" "0100" and get the output returned?
-
Hm. Now it works....same Hub, same program. Difference: I had removed the Dongle, and I resetted hci. Spooky. But thanks for your help!
-
?? I use gatttool -I as a background process and then send the commands But I fear that's not what you wanted to know.....
-
Hi, good idea! Logilink BT0015 or ASUS USB-BT400 Same with both Is the a method to clear something?
-
Hi, I'm just working on my small python-Script and I'm facing a stanage behavior of the PoweredUp-Hubs according to the documentation. I am sending commands every 0.2 sec to change speed. Works fine. But after app. 100 commands motor runs continuosly with last speed. Commands are sent, but not executed any more. This is the command: char-write-cmd 0x0e 0a00810016000xx0000, xx replaced by speed Any ideas?
-
could you please translate this for me into a command like char-write-req 0x0... nnnnnn Thanks.
-
Two Powered Up motors for the 60198 cargo train engine
Lok24 replied to legotownlinz's topic in LEGO Train Tech
Hi. I' running VB5! Yes. That's all possible. Normally you pair handheld and Hub. Now you pair Handheld with xxxx an pair hub with xxxx. xxxx might be some software on a win 10 PC, an App, or a standlone Rasberry Pi for 10 €. I tried this with my own python script on a raspberry and The Brick Automation Project by @Cosmik42 on WIN 10, both works fine. Look here: -
Hi Vincent, Does what it should do! New project, done in 10 minutes: Press + on Handheld, motor accelerates, release button: train continues with last speed I should spend some more time to make this more usable. Idea: Handheld A+ accelerate Handheld A- brake Handheld Astop Stop Same with B, another train Handheld Power: toggle to level 2, having six buttons for switches, signals, crossing ... Many thanks for sharing your work!
-
Seems that it doensn't work on a RaspberryPi A+ (as you tested with B) But many thanks for your support. I'll try later on another hardware (Win 10 did not work as well) Just an info: the first of dozens of errors: > usb@1.5.0 install /home/pi/LEGO/JSproject/node_modules/usb > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/tessel/node-usb/releases/download/1.5.0/usb_bindings-v1.5.0-node-v64-linux-arm.tar.gz node-pre-gyp WARN Pre-built binaries not found for usb@1.5.0 and node@10.15.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) make: Entering directory '/home/pi/LEGO/JSproject/node_modules/usb/build' CC(target) Release/obj.target/libusb/libusb/libusb/core.o CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o CC(target) Release/obj.target/libusb/libusb/libusb/io.o CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o CC(target) Release/obj.target/libusb/libusb/libusb/sync.o CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o ../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: Datei oder Verzeichnis nicht gefunden #include <libudev.h> ^ compilation terminated. libusb.target.mk:138: recipe for target 'Release/obj.target/libusb/libusb/libusb/os/linux_udev.o' failed make: *** [Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1 make: Leaving directory '/home/pi/LEGO/JSproject/node_modules/usb/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/nodejs/node-v10.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 4.1.18+ gyp ERR! command "/usr/local/lib/nodejs/node-v10.15.1/bin/node" "/usr/local/lib/nodejs/node-v10.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/LEGO/JSproject/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/pi/LEGO/JSproject/node_modules/usb/src/binding" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd /home/pi/LEGO/JSproject/node_modules/usb gyp ERR! node -v v10.15.1 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error
-
Hi, I just tried to get node-poweredUp running, but with my zero knowledge of Linux that's quite difficult. What I have: pi@raspberrypi:~ $ node -v v0.10.29 pi@raspberrypi:~ $ npm version { npm: '6.4.1', ares: '1.15.0', cldr: '33.1', http_parser: '2.8.0', icu: '62.1', modules: '64', napi: '3', nghttp2: '1.34.0', node: '10.15.1', openssl: '1.1.0j', tz: '2018e', unicode: '11.0', uv: '1.23.2', v8: '6.8.275.32-node.12', zlib: '1.2.11' } pi@raspberrypi:~ $ npx -v 6.4.1 Whatever that means ;-) And what I get is below, what is wrong with my installation? Is there a step by step tutorial how to get a .js running? pi@raspberrypi:~ $ node al.js /home/pi/al.js:20 /* This is vernie_remote.js let vernie = null; ^^^^^^ SyntaxError: Unexpected identifier at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 pi@raspberrypi:~ $ node cb.js /home/pi/cb.js:4 /* This is the "samle usage" poweredUP.on("discover", async (hub) => { // Wait to discover a Hub ^ SyntaxError: Unexpected token > at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 pi@raspberrypi:~ $
-
Sorry, I should have explained better... this is what I meant when I wrote "switch blade" I did not invent that, I think JopieK uses that too.
-
Here are two short videos (30sec.), one is showing how to get two motors in a train running in different directions second is how to toggle a switch or signal with only one(!) button each , so you could access seven accessories with one handheld (or use the power button to switch to train or next six switches...)
-
Hi, I'm doing something wrong. I tried now: Hub[0].SetLEDColor(Colors.BLUE); Compiling failed. Error (CS1502): The best match for the overloaded 'LegoTrainProject.Hub.SetLEDColor (LegoTrainProject.Port.Colors)' method has some invalid arguments. Error (CS1503): Argument '1': Unable to convert 'LegoTrainProject.DynamicCode.Colors' into 'LegoTrainProject.Port.Colors'. Global is: public enum Colors { BLACK = 0, PINK = 1, PURPLE = 2, BLUE = 3, LBLUE = 4, CYAN = 5, GREEN = 6, YELLOW = 7, ORANGE = 8, RED = 9, WHITE = 10 } And: public void async MyGlobalFunction() { // ..... } Compiling failed. Error (CS1002): ; erwartet. Compiling code ... Compiling failed. Error (CS1002): ; erwartet. ("erwarted = "expected")
-
Hi @Cosmik42 brilliant. As you see,here are some users who don't use a complete automatic, and therefore this would be useful. I'd like visitors to drive themselves on exhibitions..... I' going to post two very short videos today shwowing this usage if handset and train motors. (There are my two wustuions concernig Wiat() in global and SetLEDColor, if you find the time, thanks..:) Renaming your software: be aware the sometimes TLG is not amused when anyone else uses the brand "LEGO"
-
Hi Vincent & all, as you see my approach was quite different from yours. But works brilliant whe speed is not to high. Which is useful if the table is not longer than 1,80m Now I'm trying to do some funny things with the handheld, too. I'd like to run a motor as long as the button is pressed.... Two ways: There's an event "OnHub Butto X onPort Y is released" or in global: do { } while Hub[0].Button("XY"). IsPressed But what is if some event comes during loop? This would allow a brillant usage of LTP for the Control+ evacuator with two handhelds or even one with two levels!! And how to switch colors? I put the "enum colors" into global and then Hub[0].SetLEDColor(colors,3); That's pretty wrong, but SetLEDColor needs two argumenst, doesn't it?
-
Hi, here is the complete idea of implementig sounds which are called form the events i.e. with "CALL(bell);" : public static string [] sound = { // Filenames "xxx", "Bell", "Hupe", "bue", "Trillerpfeife", }; public const int bell = 1; public const int hupe = 2; public const int bue = 3; public const int pfeife = 4; public const string path = "E:\\Daten\\Lego\\Boost - PU - SBrick\\PoweredUp\\LegoTrainProject\\Sounds\\"; // ----play---------------------------- static void play(int so) { System.Media.SoundPlayer player = new System.Media.SoundPlayer(); string fn = path + sound[so] +".wav"; player.SoundLocation = fn; player.Play(); }
-
Not at all, it works like a guitar string...just turn the blue pin This wasn't implemented yet when I showed the complete thing here: https://www.eurobricks.com/forum/index.php?/forums/topic/91907-level-crossing-with-pf-motor/&tab=comments#comment-1814312 Yes! Yes!
-
Your question is the answer..... No, the springs are not removed. But if you switch to "straight" with it's lever(!) once(!) you have one direction, now you can easily pull the switch blade to the other direction and it swings back if realeased
-
Thanks, the "full layout" was shown last year at two exhibitions in Germany, but with two engines, and automatic decoupler, RaspberryPi, Reed-Contacts and SBrick. Now it's all LEGO.
-
Hi, I bought mine at Bricklink, app. 20 €, average last 6 Month: 17,5 € PF battery box: 14 € PF-IR-Rceiver : 17 € SBrick with 4 ports: app. 60 €
-
Here is the event for the RED(!) tiles on the track: LOG writes to console STOP stops the engine START(dir) starts the engine in desired direction PLAY(sound) plays a sound SETMOTOR(s,100) starts motor for s = Signal, waits a moment and stops IF (CHECK(2,1)) means: two red tiles in step 1 of the complete show. countevent(Hub[0],Hub[1]); if (check(2,1)) // Zurück auf 1 { log("Halt am Signal, Zurück auf Gleis 1"); Stop(); Wait(1000); setmotor(w,-100); Wait(mt);setmotor(w,0); Wait(1000); Start(1); } if (check(2,2)) // vowärts bis Signal { log("Halt auf Gleis 1, Vowärts bis Signal"); Stop(); Wait(2000); setmotor(k,100); Wait(mt*2);setmotor(k,0); play (pfeife); Wait(2000); Start(-1); setmotor(k,-100); Wait(mt*2);setmotor(k,0); } So it's only one routine doing that all and some global commands (There is one additional on the Handheld "Power" to start the whole thing)