AJB2K3 Posted 6 hours ago Posted 6 hours ago 10 hours ago, Bliss said: @Wapata, I just added some code for the cybermaster. Could you please try it? You have to check the CM checkbox before clicking the Connect RCX. Press F12 in chrome to open the console so will see the errors while it tries to connect. You could copy paste and post the errors here or private message... It's reusing the same code I made for the RCX except it using a different header in commands and replies. Also, the start handshake with keyphrase has been added. BUT I cannot test unfortunately... So lets see how it goes, and I hope we'll be able to debug the problems as they arise... Good Luck! Version: 2026-04-07-1730 I also ran a test. While Both tower and chassis flash, IDE reports no response. Using CyberMaster: true DeviceLegoRcx.js:63 [CM null] Requesting serial port... 5Chooser dialog is not displaying a port blocked by the Serial blocklist: bluetoothServiceClassId=00001124-0000-1000-8000-00805f9b34fb, name='C0:44:42:C7:F1:B9' 5Chooser dialog is not displaying a port blocked by the Serial blocklist: bluetoothServiceClassId=00001200-0000-1000-8000-00805f9b34fb, name='C0:44:42:C7:F1:B9' 5Chooser dialog is not displaying a port blocked by the Serial blocklist: bluetoothServiceClassId=00001124-0000-1000-8000-00805f9b34fb, name='88:4D:7C:E9:50:F4' 5Chooser dialog is not displaying a port blocked by the Serial blocklist: bluetoothServiceClassId=00001200-0000-1000-8000-00805f9b34fb, name='88:4D:7C:E9:50:F4' DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 1) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 2) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 3) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:311 [CM null] Command failed after 3 attempts: a5 (anonymous) @ DeviceLegoRcx.js:311Understand this warning DeviceLegoRcx.js:63 [CM null] CM did not respond. Power it on. main.js:785 Using CyberMaster: false main.js:785 Using CyberMaster: true DeviceLegoRcx.js:63 [CM null] Requesting serial port... DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 1) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 2) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 3) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:311 [CM null] Command failed after 3 attempts: a5 (anonymous) @ DeviceLegoRcx.js:311Understand this warning DeviceLegoRcx.js:63 [CM null] CM did not respond. Power it on. DeviceLegoRcx.js:63 [CM null] Requesting serial port... DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 1) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 2) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 3) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:311 [CM null] Command failed after 3 attempts: a5 (anonymous) @ DeviceLegoRcx.js:311Understand this warning DeviceLegoRcx.js:63 [CM null] CM did not respond. Power it on. DeviceLegoRcx.js:63 [CM null] Requesting serial port... DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 1) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 2) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:300 [CM null] No reply for cmd a5 (attempt 3) (anonymous) @ DeviceLegoRcx.js:300Understand this warning DeviceLegoRcx.js:311 [CM null] Command failed after 3 attempts: a5 (anonymous) @ DeviceLegoRcx.js:311Understand this warning DeviceLegoRcx.js:63 [CM null] CM did not respond. Power it on. Quote
Toastie Posted 5 hours ago Posted 5 hours ago (edited) @Bliss, @evank, @Gunners TekZone, Back in October 2024, Evan an I had a discussion with Ethan Dicks, who is a further 9750 expert on the 9750 input circuitry and the light sensor internals. I had traced out the 9750 PCB before, as I struggled with understanding the available schematics (https://archive.org/details/9750-schematics) for the inputs. In that schematic, there is only a tiny little error: On page 4 of the PDF, sheet 3 "input circuit", C5 (C10) along with the 56Ohm and 1.2kOhm resistors is connected to +9V, otherwise the transistor can't work. Etan agreed on that. Here is the corrected version: Note that K2 is not on the PCB, the opto coupler outputs are going to the 20 pin connector. K1 is the sensor socket. Inside the sensor it looks like this: 9750 powers the sensor and detects small changes in the voltage it provides on the input. I did some measurements (oscilloscope and multimeter) to figure out how that circuitry works. At that time, Evan was building his Blocky Kong LEGO machine and struggled with using the 4.5V light change sensor as light sensor, but that is highly unreliable. The sensor is a Siemens SFH 900 IR emission/reflection sensor. It was pure luck, when I found the 1985 (and 500 pages long) "Siemens Optoelectronics Catalog", where the SFH 900 was introduced as "brand new": I believe (not more than that, as we never figured out how it really works), that the sensor produces a solid TTL compatible 1 for a white disc segment (right plot, the rising/falling slopes have a t1/2 of less than 10 us). At the analog side, upon reshaping the amplified changes in the small voltage change the light sensor is inducing (8.5 vs 7.8V), the slopes are much less defined and may reach 125 ms on both "edges". This naturally limits the resolution of the sensor input. As said, my Atari managed to see about 200 changes/s on a 4+4 segmented disc. But I need to check again. 4 hours ago, Bliss said: Also, is the counter resets some how? does it count from 0 to 15 and rollover to 0 again. No count down, only count up I guess? Yes, true. No reset, just overflow. If I recall correctly, TC Logo increments a corresponding 16 bit variable available for access by a user every ms, if a change was detected. It also records the time between the changes and thus one may calculate the frequency (or was that provided as well? Forgot, it is in the TC Logo programmer's manual). Best Thorsten P.S.: You find PDFs of the above in this folder: https://bricksafe.com/pages/Toastie/lego-interface-a---9750---9771---tclogo/9750-sensor-input-circuit Edited 4 hours ago by Toastie Quote
AJB2K3 Posted 5 hours ago Posted 5 hours ago This is interesting thanks, I was wondering about adding circuit diagrams to my book Quote
Gunners TekZone Posted 4 hours ago Posted 4 hours ago (edited) @Bliss OK... I wired up my Arduino Nano to an Interface-A, and it works quite well with Blockly. I however, do not... OK, let me clarify. This is a ME issue. Always has been with Block programming. I have tried, trust me... I really like working with PyBricks, but MUST ignore their blocks and use Python, else I go bonkers (well, more than normal). As a bit of a visual learner, I can truly appreciate these Block style programming methods, and I do admit they are particularly fun to manipulate with a high resolution touch screen like my Surface Tablet has. However, I find even a slightly meaningful program quickly gets beyond the immediately visible screen real estate. And in order to see enough of the flow, I need to reduce the scale to a point that I simply can't easily read anything and all I see is the confusing patterns of colours @Toastie clearly has better eyesight and appreciation of blocks... Koodos there! But I already said earlier in this topic, blocks are not my choice of programming, but that I can at least do some simple testing... So this is that. Aside from whatever is going on with your counters?!?!?... The binary style UpdateOutputs works very well, and I was able to do some robot arm movements with timers and Loop until Input type logic. Very nice! Up until I clicked on the wrong things a few times while zoomed out and broke my own code (as shown in the pic below). Even a few UNDO's didn't get it back to where I had a short routine successfully running. Oh well Unfortunately, even if I manage to make something meaningful, I no longer keep a YT page and do not have a reasonable way to share video here. And most pictures are only "short term" due my use of limited free space on Dropbox. And no, I do not plan on using other online storage options. Edited 2 hours ago by Gunners TekZone Quote
AJB2K3 Posted 4 hours ago Posted 4 hours ago You should be able to scroll the workspace to see more without zooming out Quote
Toastie Posted 4 hours ago Posted 4 hours ago 10 minutes ago, Gunners TekZone said: And in order to see enough of the flow, I need to reduce the "size" to a point that I simply can't read anything and all I see is the confusing patterns of colours Well, be rest assured, too many blocks do get me confused - as do too many lines. If you arrange the "enveloping" blocks (tasks, loops) such that you can collapse them without losing their meaning, it may become clearer? What also helps me: I am to a good extent color-blind . So I just see green and all shades of gray Best Thorsten Quote
Gunners TekZone Posted 4 hours ago Posted 4 hours ago (edited) 10 minutes ago, AJB2K3 said: You should be able to scroll the workspace to see more without zooming out Now why didn't I think of that... ... Hah. JK. Actually, my brain don't track well doing that. I need to see large chunks of code (or in this case blocks) to follow the flow. And I find I can get more use out of text that way. This is also why I don't enjoy programming as much on my VIC-20's as much as the C64 or even better C128 in 80 column mode. But Block programming just eludes me in the "enjoyment beyond the basics" category. It is a me thing Edited 4 hours ago by Gunners TekZone Quote
Wapata Posted 4 hours ago Posted 4 hours ago .. ... Take a bigger screen ? More easy: rotate yours, with Ctrl+alt+arrow Quote
Gunners TekZone Posted 4 hours ago Posted 4 hours ago (edited) 9 minutes ago, Wapata said: Take a bigger screen ? More easy: rotate yours, with Ctrl+alt+arrow Need Bigger $$$ And rotating my Surface will make the use of KB and mouse a bit tricky. Yes, it has a touch screen, but again, not natural for me to use when programming. GUI use is another thing though. Thanks all for trying to help. But no worries, I am not abandoning this topic's... well... topic. Outside of doing some simpler testing routines etc., I am simply not going to actually use Blockly as others may. Edited 4 hours ago by Gunners TekZone Quote
AJB2K3 Posted 4 hours ago Posted 4 hours ago (edited) 36 minutes ago, Wapata said: .. ... Take a bigger screen ? More easy: rotate yours, with Ctrl+alt+arrow I have not got space for a 100” screen otherwise I would Edited 3 hours ago by AJB2K3 Quote
Gunners TekZone Posted 4 hours ago Posted 4 hours ago (edited) @Bliss It may have already been mentioned in the details prior... But a simple Loop While/Until Input ON/OFF and a Loop While/Until Input toggle/trigger count = X (with automatic preset to 0 ) should be sufficient for a LEGO Lines type process. 1 hour ago, AJB2K3 said: I have got space for a 100” screen otherwise I would Ah... Space... The often impossible frontier in my current universe I am already maxing out the displays and computers I can put into place. I have more in storage. Edited 2 hours ago by Gunners TekZone Quote
AJB2K3 Posted 3 hours ago Posted 3 hours ago 24 minutes ago, Gunners TekZone said: @Bliss It may have already been mentioned in the details prior... But a simple Loop While/Until Input ON/OFF and a Loop While/Until Input toggle/trigger = X should be sufficient for a LEGO Lines type process. Ah... Space... The often impossible frontier in my current universe I am already maxing out the displays and computers I can put into place. I have more in storage. It was supposed to be have not got the space Quote
Bliss Posted 2 hours ago Author Posted 2 hours ago (edited) 5 hours ago, Gunners TekZone said: But I understand the inputs to detect simple continuity of an active (powered) circuit. I don't think there is enough sophistication to determine rising or falling edges? The touch switches just go HIGH when a switch is closed. I know that int.A itself does not count. But the software Lego Lines (LL) can. So How does LL count an Int.A Input when you turn the disk wheels (4 BK 4 WH and 8BK 8WH stripes)? Does LL count Inputs 7/6 on Raising edge (0->1) and count on Falling edge (1->0). Which would give the most resolution. I believe, the Rotation sensors in the 9V Int.B / Rcx does this. Does LL COUNT counts indefinitely with no reset? I doubt it. If there is no reset, then it must rollover? What is the count after a complete disk turn, say for 8B/8W disk. Is it 8 counts (Raising edge only) or 16 counts (Raising + Falling edges). If we keep turning the disk after one turn, does the count rollover and starts again with 0, 1, 2...? Not very practical but if there is no reset it might be the case. In @Gunners TekZone LL programs, I see max count to 15 and 10... Edited 1 hour ago by Bliss Quote
Toastie Posted 1 hour ago Posted 1 hour ago (edited) 19 minutes ago, Bliss said: Does LL count In 7/6 on Raising edge (0->1) and count on Falling edge (1->0). Which would give the most resolution. I believe, the Rotation sensors in the 9V Int.B / Rcx does this. I am not sure about LEGO Lines, but the reference guide for the successor of LL, LEGO Technic Control Logo (TC Logo) says this: Optosensors The optosensor detects sharp changes in the level of light. If the last sharp change was from light to dark, the sensor reports true. If the last sharp change was from dark to light, it reports false. Further down it says: You can also use an optosensor with a counting wheel, a special black/white LEGO disk. A counting wheel has black and white slices printed on it. There are four slices of each color on one side and eight slices of each color on the other side. Place the optosensor three millimeters from the counting wheel. When the surface across from the sensor changes from a white slice to a black slice, the sensor reports true. When the surface across from the sensor changes from a black slice to a white slice, the sensor reports false. And finally: A computer's counter automatically increases by one every time the sensor changes from false to true. If the sensor is next to a counting wheel, you can use the counter to calculate the number of times the counting wheel has turned. (I did change the font to bold) Again, this is for TC Logo. However, as shown above, the TTL pulse generated at 9750's sensor outputs are either L or H. TC Logo reads these with a 1kHz sampling rate throughout the time it is running. It thus sees bytes/bits changing. Best Thorsten Edited 1 hour ago by Toastie Quote
Bliss Posted 1 hour ago Author Posted 1 hour ago @Gunners TekZone, Thany you for your time testing. So can we say the POC for Int.A vs Arduino vs Blockly is a success ? (POC = Proof Of Concept). Does the Arduino and sketch do their Job. Is it fast enough. Any timing problems? Did the loop while until worked with the input 6? Did the Count "on change" of Input 7 did the same as the Lego Lines (LL)? Did you have to tweak the blockly code version of your LL code I provided to make your Arm work like it does with LL? Thanks Again! Quote
Bliss Posted 1 hour ago Author Posted 1 hour ago (edited) 19 minutes ago, Toastie said: A computer's counter automatically increases by one every time the sensor changes from false to true. Ok so for TC Logo, they count on Raising edge only which gives the lowest resolution... But maybe the COUNT I see from Gunner LL program is not a Count of the disk black/white sections but is a complete Turn Counts? We read directly the Input status in Blockly and have to make our own counter, So can make the counting as it suits our project the best... But since I wanted to simulate what does LL, I would have liked to know a bit more about how LL counts. I saw that @maehw did a python LL simulator, and I could probably check inside his code to see if he did implement the COUNT instruction... If I provide a counter built in the arduino, I would make it count the White and Black stripes, not only the white ones... Or I could provide 2 counters. Count1 (counts only Black, or if a touch sensor is pressed) and a Count2 (Counts Black and White sections of disks, not really meaningful for Touch sensor though)... Edited 1 hour ago by Bliss Quote
Bliss Posted 1 hour ago Author Posted 1 hour ago (edited) @AJB2K3 and @Wapata, thank you for testing... I will try to provide more debug console message to help... But according to what you reported, it just tells that it did not replied to cmd A5 which is the Unlocking with key phrase... So I will enable the console log of the whole byte stream it sends to the Serial port. I use the same baudrate as the RCX, 2400, 8, 1, Odd. Edited 1 hour ago by Bliss Quote
evank Posted 18 minutes ago Posted 18 minutes ago 6 hours ago, Gunners TekZone said: Hmm, I think @evank may be the expert here, if he understands electronics... Or at very least from experience with using the two primary 4.5v sensors that were meant for the Int-A. But I understand the inputs to detect simple continuity of an active (powered) circuit. I don't think there is enough sophistication to determine rising or falling edges? The touch switches just go HIGH when a switch is closed. The optical sensor seems to react to the reflectivity of the built in IR (or an external light source). With the wheel it "counts" at every change between the black and white fans. Thus 8 counts per revolution on the quad fan pattern. Of course that programmatic "count" can also depend on where in the geartrain the sensor sits. And accuracy may be questionable with higher speed. In my Robot arm program, I just manually triggered a motor to run for as long as I needed and counted the "triggered pulses" I saw on the inputs. That became my COUNT value. The Int-A input accuracy may be questionable with higher speed, but this bottleneck will still be inside the Interface, and an Arduino (or other MCU) will not improve that, unless you start using them AS a form of "upgraded" Interface-A... But I suspect that will concern LEGO purists. I don't understand electronics or programming at the level of you, Bliss, Toastie, etc., but I get by. :) I also don't use Lego Lines. I program almost exclusively in BASIC and sometimes in Lego LOGO. In Lego LOGO there is a SETPOWER command, 0-7, to let a motor or light gradually increase/decrease. There is no way to do that in BASIC. You can probably accomplish this in assembly code. But I never got beyond HELLO WORLD in that language. 5 hours ago, Toastie said: Back in October 2024, Evan an I had a discussion with Ethan Dicks, who is a further 9750 expert on the 9750 input circuitry and the light sensor internals. I had traced out the 9750 PCB before, as I struggled with understanding the available schematics (https://archive.org/details/9750-schematics) for the inputs. In that schematic, there is only a tiny little error: On page 4 of the PDF, sheet 3 "input circuit", C5 (C10) along with the 56Ohm and 1.2kOhm resistors is connected to +9V, otherwise the transistor can't work. Etan agreed on that. Here is the corrected version.... ..... I did some measurements (oscilloscope and multimeter) to figure out how that circuitry works. At that time, Evan was building his Blocky Kong LEGO machine and struggled with using the 4.5V light change sensor as light sensor, but that is highly unreliable. Ethan hangs out more on Facebook. If anyone wants to reach him, a good place to do so is my "Lego Interface A" group there. I need to update the schematic on my website. Still working on Blocky Kong and I never did solve that problem! I have the opto sensors working decently enough for collision detection between Mario and the barrels, using a little software trick. 4 hours ago, AJB2K3 said: This is interesting thanks, I was wondering about adding circuit diagrams to my book What book? Quote
Bliss Posted 4 minutes ago Author Posted 4 minutes ago (edited) I checked a bit the @maehw lego lines python emulator and from my understanding, might be wrong, when the Lego Lines runs and encounter the COUNT label, it first resets the count to 0 then it checks for changes in the selected input. check for changes = from 0->1 and also from 1 to 0 which gives max resolution for the Disk. For a touch sensor, counts start at 0, then when pressed, the count goes to 1 and when released, count goes to 2 etc... So my Blockly code version of @Gunners TekZone does that in theory... Edited 1 minute ago by Bliss Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.