Gunners TekZone Posted 7 hours ago Posted 7 hours ago (edited) 30 minutes ago, Bliss said: I didn't recall you had a Int.A but I'm not surprised either ;-) Hah... Yes, I have one on my Commodore 128. But I recently got a 2nd for use on an Apple IIe Clone I repaired and "fixed" a DIY Rebooted 9767 interface card for it. 30 minutes ago, Bliss said: The Arduino Mega should work too since it has more PWM pins. And the pins used in the Arduino sketch I provide in my github are also available on the MEGA as I can see. The MEGA uses different OUT pins (8-13)as they are all PWM capable on it, and some of the ones used on the UNO are used for the LCD shield. 30 minutes ago, Bliss said: Did you use the sketch I provide? I did not only changed the baud rate to 19200 (not 192000 as you put in your post). I had to tweak the main sketch a bit to aquire more speed and stability. Aside from the BAUD typo in my post (more zeros better, No?)... I did load it on an Arduino Nano (AFAIK same pins as UNO), but Blockly tries to connect (I see LEDs on the nano flashing) however, it refuses to acknowledge it. So I gave up for the moment and been playing with the MEGA, with a couple of LEDs representing a couple of Int-A ports (Still too lazy to make up a proper cable ). 30 minutes ago, Bliss said: I don't own an Int.A myself @evank offered you one a couple of times... I recommend you don't turn down such a generous offer from a fellow enthusiast! Edited 7 hours ago by Gunners TekZone Quote
Bliss Posted 7 hours ago Author Posted 7 hours ago (edited) @Gunners TekZone, Something though I have not figured out as I'm not an Arduino expert, is about the serial com port of the UNO shared between the USB and pin 0 and 1. I can upload the sketch through the virtual com port created when I plug the USB com port of the UNO to the PC. But I cannot use the same com port to commect to blockly! I have to use a separate FTDI on Pin 0 and 1 which create a different COM port and then it works with blockly with this COM port. But not the USB COM port... Edited 7 hours ago by Bliss Quote
Gunners TekZone Posted 6 hours ago Posted 6 hours ago (edited) I was wondering what your program was doing with just the UART (USB) Serial command in play. The UNO (and Nano I am using) only has the single UART/USB/Serial port. You would need to use Software Serial if you needed to talk to a device and show data on a terminal program. Or use a MEGA that actually has multiple hardware serial ports (pins 14-19), aside from the primary UART/USB one. I just plugged the Nano, via USB, into my computer that is running Blockly, then tried to Connect Int.A via that COM port... Is that not how it is supposed to go? Oh, I just read your edited post... Yup, it must be using SoftSerial in the Lego9750.h library?? Hmm... No?? Edited 6 hours ago by Gunners TekZone Quote
Bliss Posted 6 hours ago Author Posted 6 hours ago (edited) 5 minutes ago, Gunners TekZone said: I was wondering what your program was doing with just the UART (USB) Serial command in play. The UNO (and Nano I am using) only has the single UART/USB/Serial port. You would need to use Software Serial if you needed to talk to a device and show data on a terminal program. I just plugged the Nano, via USB, into my computer that is running Blockly, then tried to Connect Int.A via that COM port... Is that not how it is supposed to go? Well, the exact same way of doing things with the UNO did not work for me. I had to use an external FTDI where FTDI TX goes on UNO RX (Pin 0), FTDI RX -> UNO TX (Pin 1). Then it works... Edited 6 hours ago by Bliss Quote
Gunners TekZone Posted 6 hours ago Posted 6 hours ago (edited) 8 minutes ago, Bliss said: I had to use an external FTDI where FTDI TX goes on UNO RX (Pin 0), FTDI RX -> UNO TX (Pin 1). Hmmm... I haven't messed with Arduinos in awhile, but I am sure that pins 0/1 are the same Serial connection as if plugging into the USB connection (but the COM port will change depending on what TTL-Serial device you are using, the external or the one built into the Arduino) Edited 6 hours ago by Gunners TekZone Quote
Bliss Posted 6 hours ago Author Posted 6 hours ago (edited) 13 minutes ago, Gunners TekZone said: Hmmm... I haven't messed with Arduinos in awhile, but I am sure that pins 0/1 are the same Serial connection as if plugging into the USB connection (but the COM port will change depending on what TTL-Serial device you are using, the external or the one built into the Arduino) I know. If I want to upload the sketch, I have to disconnect the pin 0 which I use for the FTDI... But still, you will not be able to use the built in USB port for some reason... Might be that the USB port of UNO is forced to a certain speed when used? EDIT: I think I found why... I used termite to check what is going on. With termite, I'm able to communicate using the USB port! But when I open the port, the arduino send immediately a string which I do not receive when I use an External FTDI... So I will make some changes and let you know when it works with the USB port Edited 6 hours ago by Bliss Quote
Gunners TekZone Posted 6 hours ago Posted 6 hours ago 8 minutes ago, Bliss said: Might be that the USB port of UNO is forced to a certain speed when used? No, That is set by Serial.begin() and must match with the speed you are using in Blockly. I dunno??... I can't seem to get my Nano (running your simple sketch and associated libraries) to connect, either via USB or external TTL-Serial and their respective COM ports... The connection LEDs flicker then Blockly says Connection Canceled or device not responding. Quote
Bliss Posted 6 hours ago Author Posted 6 hours ago @Gunners TekZone, thank you, I'll get back to you when I managed to make it work using the USB port. Quote
Gunners TekZone Posted 6 hours ago Posted 6 hours ago (edited) @Bliss I am a little foggy headed at the moment... and will be heading to bed anyway But as I skimmed through the Lego9750.h and Lego9750.cpp It seems that these libraries are using the primary Serial port to communicate with a Serial Monitor (IDE or terminal program)... So it CAN'T also use that port to communicate with Blockly! Or at least when the sketch is set to Verbose mode?? I dunno... I would have to be much clearer headed to follow the code properly. What I think you need to do is find a way to add in a Software Serial port to communicate with Blockly while keeping the existing Serial Monitor option for diagnostics... Or vice versa... Whatever works best to also control the LEDs and monitor inputs as needed to "emulate" an Int-A Edited 6 hours ago by Gunners TekZone Quote
Bliss Posted 6 hours ago Author Posted 6 hours ago @Gunners TekZone, it is working for me with an external FTDI with no change to the code. (Rx -> Tx, Tx -> Rx, Gnd->Gnd). But not with USB Com port of the UNO... Which make me think It could also be a driver incompatibility with the Chrome WEBSERIAL API... I'll dig more... Quote
Gunners TekZone Posted 6 hours ago Posted 6 hours ago Ya, I think Verbose mode is off by default. Strange that I can't get it to work via FTDI on my nano. It tries, but no go. Anyhow, I am off to bed (it is 5am after all... a few hours later than usual for me ) so will try again later. Quote
Toastie Posted 4 hours ago Posted 4 hours ago @Bliss, @Gunners TekZone Hmmm, I cannot add much to the discussion. However, when I made my lill' Nano serial2parallel adapter, I noticed that the Nano never shows up as a COM port in device manager (but somewhere else as something else in the manager, I forgot where/what that was) So for programming the Nano, I am using the built-in mini-USB connector as usual (which routes to Nano pins 0 and 1). For actual serial2parallel conversion, I am using a Ser2TTL (or USBB2TTL) adapter, connected to pins 0 and 1 as well. I do have a little on/off switch between the TX line of the Nano and the Ser2TTL adapter, shown in this picture: https://www.eurobricks.com/forum/forums/topic/192941-lego-interface-a-97509771-–-lego-technic-control-1-tc1-referenceideas-thread/#findComment-3580886 When programming the Nano, I switch off the Nano's TX connection to the Ser2TTL adapter, when running in plain serial2parallel conversion, the switch is connecting both. But this is not even what you are talking about, is it? Best Thorsten Quote
Bliss Posted 1 hour ago Author Posted 1 hour ago (edited) @Gunners TekZone Please update Lego Blockly to the latest version : Version: 2026-04-06-1230 My Arduino is a Clone from Aliexpress. And yours is probably a clone too... So it is using the not so good CH340 Uart ... After some testing, I found out that after connecting to the COM port, it takes some time before we can write/read anything to it... So I started to add a delay, at first, 1 sec but was still not working then I put 2 sec delay and now it appears to work fine. Also, by default, the Sketch for the arduine was setting VERBOSE ON so changed that too but it should work even if you do not update the sketch... Because, when I connect, to make sure it is really connected, after the 2 sec connect delay, I send VERBOSE ON and THEN VERBOSE OFF and wait to receive VERBOSE OFF feedback. So now for me it works directly with the Arduino UNO USB port. NO NEED FOR AN EXTERNAL FTDI. (Anyway, if the external FTDI happens to be a CH340, it will probably fail) Anyway, try this version and let me know. Thank you! EDIT: AI ANSWER Why using the Arduino USB port to connect takes time: When you open a serial connection to an Arduino UNO (or any board using CH340/ATmega16U2), the USB‑serial chip does something that FTDI chips do not do: ⭐ It toggles the DTR line → which resets the microcontroller This is the key. Opening the serial port triggers: DTR goes LOW The ATmega328P resets The bootloader starts The bootloader waits ~1–2 seconds for a sketch upload Only after that does your sketch begin running Only after that does the board respond to commands Edited 57 minutes ago by Bliss Quote
evank Posted 1 hour ago Posted 1 hour ago 6 hours ago, Gunners TekZone said: @evank offered you one a couple of times... I recommend you don't turn down such a generous offer from a fellow enthusiast! I have plenty of them and will happily share with anyone who is pushing the boundaries + doesn't necessarily have the cash to buy one retail. Quote
Toastie Posted 1 hour ago Posted 1 hour ago @Bliss Now I got it (timer wise for Interface B): Quick question: When the program runs and a button block has not the focus (or what ever it is called, when there is this yellow outline around the block), it mostly needs two clicks to activate the button action. Sometimes one click is enough. That would be the case in Task1, when I clicked the upper button twice, which turns output C on. After that, only 1 click is required to trigger the action. When I then go back to the main loop and click to end the program, I first need to have the focus on the button, the next click will end the program. This is what it is, right? It is absolutely not a big deal, I am just asking, because generally, it is my fault when it does not work as (I) expected. Best Thorsten Quote
Bliss Posted 1 hour ago Author Posted 1 hour ago @Toastie, Yes for the two clicks bug... I tried to use copilot to help with this. Copilot is always very positive in his replies but sometimes what he proposes just does not work and then we are good for dozens of iteration ask / reply and I was fed up at some point because beween each copilot suggestions, often his suggestions break something... However, I might try to ask other AI for a solution on this if there is one... Quote
Bliss Posted 17 minutes ago Author Posted 17 minutes ago @Gunners TekZone, Please update the sketch on your arduino you use to test blockly. I added a Println("READY") in the setup of the Arduino. Then when we connect with blockly to the arduino, it is going to reboot it and I wait until I receive the "READY" string... 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.