I cannot test, so you will have to. :-) This is likely to be something very simple. So, this code... change the SPIMode.. a parameter 0. Test, then change to 1. Test do same for 3 and 4. See the Help why this may help. I also changed the ISR but as you are not seeing the ISR active this is not the root cause issue. Evan #chip 16F877A, 4 #define USART_BAUD_RATE 9600 #define USART_TX_BLOCKING dir PORTB.7 in 'SS dir PORTC.5 out 'SDO dir PORTC.4 in 'SDI dir PORTC.3 in 'SCK SPIMode Slave // [,0|1|2|3]...
Hi Venn, I made the changes as you suggested. The ISR not being called during program execution. I added HserSend "." into ISR sub, not responding at serial monitor. I'm using Simulide software for simulation. I attached pin connection with this post, please inspect if I made any wrong. The complete code below. Thanks in advance! #chip 16F877A, 4 #define USART_BAUD_RATE 9600 #define USART_TX_BLOCKING dir PORTB.7 in 'SS dir PORTC.5 out 'SDO dir PORTC.4 in 'SDI dir PORTC.3 in 'SCK SPIMode Slave dim...
I would need to see your complete code. Question. ISR being called? Add Hsersend "." to the ISR. Is the "." shown? Also, change. if spidataready then HserPrint spidat ' Print to serial HSerPrintCRLF spidataready = false end if
Hi Venn, Thank you for the quick reply. I tried to figure out but I don't have luck. even the interrupt also not working in my case.
Hello, Your current code polls SPI transfers risks missed data. So, what is happening would be expectd. You need an interrupt handler. Why an Interrupt Handler Is Needed In SPI slave mode, the PIC16F877A relies on the Arduino to drive the Slave Select (SS) and clock (SCK) pins. Polling (SPITransfer) can miss data if unsynchronised, as the PIC’s SPI slave mode triggers an interrupt when the buffer (SSPBUF) is full. An interrupt handler ensures immediate data processing, boosting reliability. Modified...
Hello everyone, I'm seeking help to print simple byte data from Arduino Uno to PIC16F877A via SPI interface. Here is the code mentioned below. I cannot get the output on serial monitor. kindly mention where I'm missing. If I'm hook-up Arduino to Arduino, it is working. Also If the PIC selected as master, and the Arduino is slave, still working. The only issue if I selected PIC as Slave mode and Arduino as master. I searched the help topics and the community but mostly the examples related to master...
if searching in your emails proves fruitless, you could always try Oshonsoft PIC simulator; which IS still in active developement... https://www.oshonsoft.com/licenses.php there is a free trial version to take it for a spin before comitting to paying!
I normally keep Licence keys and registrations etc. in a Card file type index where I can recover in such cases as this, but for whatever reason it isn’t there! An Email from over nine years ago. I don’t think I can go that far back. I’ll give it try all the same. As I said I don’t mind paying for another licence key but there is no way of buying one.
That is unfortunate. Sorry for you. Did you replace the old computer? did you format the hard drive? Can you recover the license key from the old setup? Check your emails. He will have sent you an email with the license. Hopefully, you still have it in your email folders. I have contacted the developer many times over the past years. No response. This is never a good sign.
I have been using Real Pic Simulator for over nine years now. I have found it an invaluable development tool, simplistic in use - great for developing and testing switches and Timers. My problem is since upgrading my PC I have lost my Licence Key. No problems or so I thought, get hold of the Company and ask them. No such luck they don't reply.... Okay I thought, I'll but a new licence key. The buy licence button takes you to what looks like a Brazilian Online Gambling website. I say Brazilian but...
🚂 Hugh's Lego Train Control System A Techspace Learning Demonstrator Hugh has just released a fantastic interactive Lego train setup designed for Techspace Learning, a non-profit that inspires young minds with hands-on Arduino workshops. 🧠👾 This demonstrator brings coding and electronics to life, combining multiple Arduino clones, GCBASIC, and clever coordination to simulate a real-world train system. It’s been a hit at exhibitions and workshops—fun, educational, and a brilliant showcase of how tech...
Thank you.
No drawbacks just advantages. Data Block can be large, very large. Page on non-18f is not a limitation, just the amount of Free program memory.
Any drawbacks compared to using lookup tables?
C:\GCstudio\gcbasic\demos\Vendor_Boards\Great_Cow_Basic_Demo_Board\16F17126_chiprange_demonstrations Specifically, 250_pwm16bit_variable_modes This is the 16bit process as defined in many of the 16bit PWM solutions in the demo pack. Change your chip, change the PPS, change the Port Constants and give it a go. Evan // Setup all the registers. This is shown the demo with good documentation. // You must toggle PWM1CON to set the new paramaters // Create an alias to the PWM1 duty register Dim PWMval...
Hi Anobium, I was not able to locate that 16F171 demo folder but I would be very interested in taking a look if you have the time. Thank you!
Hello, my first assumption is for example you are setting on PortA IOC on both edges, you set IOCAP for positif edge, and IOCAN for negative edge. So, you can catch both event.
Say I'm using pic16f17126 How do you setup On Interrupt PORTChange to interrupt on both rising and falling edge? Back story if needed. I'm creating a quadrature encoder and I would like to read both rising and falling edge of both channels A and B to create x4 resolution.
You should try using the 16Bit PWM demo file as your starting point. There is a 16Bit PWM demo of a chip in the same family. Do a search in GCCODE, open the Demo folder and look for the 16F171 demo folder. I can look the actual demo tomorrow if you cannot find it.
Thank you so much! I totally missed that.
it seems as though there's only 10-bit PWM hardware on this chip range...sneaky!
Hi, I am just getting started with PIC/GCBASIC so forgive me if I am missing something here. When I attempt to use HPWM16 on a 16F17114 I receive the error Chip cannot support PWM16 commands. Either chip is not supported, or, not validated with this chip I checked and CHIPPWM16TYPE is not listed in the dat file at all but the Microchip website lists 2x 16-bit PWM with Dual Outputs under the features. Any help would be appreciated!
David, Blockly has full access to all the compilers capabilities. However, Blockly is a learning tool for STEM education and this means Blocks are created to expose specific GCBASIC capabilities. This means. You have the basics to compiler for any chip, you have many commands implemented in the Blockly toolbox but Blocks for I2C and SPI need to be added. In Blockly there would be totally simplification of the communication process. The Block woukd setup and manage the entire communication process,...
Thanks for all your hard work on this. As I dont use GCBASIC very much I was a bit reluctant to even have a look at this new development. I will give it a try over the next month or so. Do you have a SIMPLE LED BLINK example anywhere that I can try once Ive set up the basics? I like to do the LED, then LED and SWITCH and so on first so I can see if it all works. Are ALL of the devices available in standard GCBASIC also available in BLOCKLY GCBASIC (is that its proper name or do we call it something...
Many errors. I f you load the code below into GCCODE then all the errors and serious comments will be in RED. Evan ' ==== Pure Sine Wave Inverter (PIC16F72 - 16MHz) ==== ' Includes: Soft Start, 50Hz H-Bridge Logic, SPWM (RC2), Voltage Feedback, Protections #chip 16f887, 16 #option explicit ' ----- I/O Directions ----- Dir PORTC.0 Out ' L/H Enable Output (inverter active state) Dir PORTC.1 Out ' H-Bridge Logic A (50Hz) Dir PORTC.2 Out ' PWM output (SPWM) Dir PORTC.3 Out ' H-Bridge Logic B (50Hz) Dir...
Many errors. I f you load the code beliw into GCCODE then all the errors and serious comments will be in RED. Evan ' ==== Pure Sine Wave Inverter (PIC16F72 - 16MHz) ==== ' Includes: Soft Start, 50Hz H-Bridge Logic, SPWM (RC2), Voltage Feedback, Protections #chip 16f887, 16 #option explicit ' ----- I/O Directions ----- Dir PORTC.0 Out ' L/H Enable Output (inverter active state) Dir PORTC.1 Out ' H-Bridge Logic A (50Hz) Dir PORTC.2 Out ' PWM output (SPWM) Dir PORTC.3 Out ' H-Bridge Logic B (50Hz) Dir...
@anobium honestly i have checked down the link, i couldn't understand as a newbie in coding it seems more professional without commenting on them while the inverter full code i saw was using deep memory language not for beginners like me, if someone can easily correct my code i will be much happy. i even trying using updatepwm function which work on ccp1 without outputting frq, and control on it, please mr @anobium if you can help me out i will glad
thank you for respond , ok let me look into it and see what i can do then am running out off time
Extending GCBASIC for Blockly Made Easy I have written this guide to show just how simple it is to add custom blocks to GCBASIC for Blockly by editing a single file: custom_blocks.js. There is no need to modify the main HTML or deal with any complex setup. If you are familiar with a little bit of JavaScript or a bit of AI then you are good to go. The guide is available from the readme when you are using GCBASIC for Blockly. Step-by-step, I explain how to: - Define blocks using Blockly’s JavaScript...
Extending GCBASIC for Blockly Made Easy* I have written this guide to show just how simple it is to add custom blocks to GCBASIC for Blockly by editing a single file: custom_blocks.js. There is no need to modify the main HTML or deal with any complex setup. If you are familiar with a little bit of JavaScript or a bit of AI then you are good to go. The guide is available from the readme when you are using GCBASIC for Blockly. Step-by-step, I explain how to: - Define blocks using Blockly’s JavaScript...
https://github.com/GreatCowBASIC/Demonstration_Sources?search=1 A great place to start. Do a search for sine.
greetings! i m on my 2nd year project om do design inverter using pic16F, family microcontroller but am having a challenge here am trying to archive a sine wave trough cpp1 as the spwm signal and use C1 and C2 as complementary for pwm of 50hz to drive with HCF4081 quad gate to drive my h bridge but am still not getting any pulse at the pins here is my code so 'federal polytechnic nedede ' ' code 144, ' 'Soft Start, 50Hz H-Bridge Logic, SPWM (RC2), with Voltage Feedback' chip 16f887, 8 option explicit...
GCBASIC for Blockly Capabilities from a User's Perspective Key Points GCBASIC for Blockly provides a visual, drag-and-drop interface for programming microcontrollers such as PIC, AVR, and LGT, ideal for beginners. It supports over 1300 chips, with features for code generation, project management, and error handling. The tool includes logic blocks, loops, variables, and subroutines, enhancing programming flexibility. It is user-friendly, offering demonstrations, guides, and a customisable workspace...
My research. 🔧 UPDI Programmers with 12V Support I am avoiding Microchip's programmers, so to program AVR Series 0 & 1 chips via UPDI—including recovery when the UPDI pin has been reassigned (GPIO/RESET)—these are some options: 1. Kanda AVR UPDI Programmer PC-based tool supporting UPDI, ISP, TPI, and JTAG. Built-in 12V pulse generator—no need for extra circuits. Suitable for recovering disabled UPDI pins. 2. LeoNerd’s UPDI Programmer (Tindie) USB programmer built on the CP2105 chip. Manual switch...
I am not sure, I can ask Stuart Bury to look into this and then he can design and build one. Are we certain that none of the existing Programmers like USBTiny will not meet this specification?
only PICKit4 or 5 are microchip High-voltage UPDI capable programmers acording to this:- https://developerhelp.microchip.com/xwiki/bin/view/software-tools/programmers-and-debuggers/avr-updi-info/ (slightly out of date!) pinouts here:-
only PICKit4 or 5 are microchip High-voltage UPDI capable programmers acoording to this:- https://developerhelp.microchip.com/xwiki/bin/view/software-tools/programmers-and-debuggers/avr-updi-info/ pinouts here:-
Thanks Anobium. You have worked hard in supporting these microcontrollers. I see you programmed these AVR series 0 microcontrollers (that require UPDI programming) using the XNANO board. I'm asking for suggestions to locate a programmer to program both series 0 & series 1 AVR chips in boards that do not contain a USB connector? ie only a programming pin header is loaded onto the board. I see the Pickit5 is one option. Emulation is not a hard requirement. To remain flexible, the programmer should...
This is just an update for those who may be reading this thread at some time in the future. Evan Venn (Anobium), along with his co-associates, have worked very hard in supporting both the newer ATtiny & Atmega series 0 & series 1 AVR Atmel/Microchip microcontrollers. Most variants are now fully supported. My thanks go out to everyone involved with this project. The AVR series 0 & 1 are fantastic value offering great bang for your buck. Most are available in SOIC packages, or with a pin spacing of...
Very nice. :-)
To remind me when I'm searching for answers in the future, I'm currently using this code to select automagically use of either SAF or EeProm in the appropriate devices: Sub GetWEeprom (HiAddr As Byte, Out EePromWVal As Word) 'Takes the address of the High Byte and returns 'a Word made from the HiAddr and the adjacent 'byte in Eeprom #If ChipSAFMemWords <> 0 SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf #If ChipSAFMemWords = 0 EpRead (HiAddr+1, EePromWVal) EpRead (HiAddr, EePromWVal_H)...
Thanks for the clarification. I'll read up on #If.
New: Added support Rajguru Electronics Sh1106 13002-Series display you can can specify `GLCD_SubType 13002` to enable support.
They are different conditional tests. #IFDEF() ( or #IF DEF()) .. does something exist. #IF CONSTANT} =|>|<|<> {value} tests a value. These are high level summaries, and, the Help has more tests like OneOf() etc.
To clarify what you are saying. Does #If work as a conditional compile option with additional parameters, as an alternative form of IfDef which has no parameters? I had thought your: #IF ChipSAFMemWords <> 0 SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf was a typo, and you'd intended to write: #IfDef ChipSAFMemWords SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf
To clarify what you are saying. Does #If work as a conditional compile option with additional parameters, as an alternative form of IfDef which has no parameters? I had thought your: #IF ChipSAFMemWords <> 0 SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf was a typo, and you'd intended to write: #IfDef ChipSAFMemWords SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf
I have just looked at this again. Have a look in the CDF file. This is created by the compiler if you have turned this on in the Preferences. This does show the conditional compilation outcome. As you correctly say the the CDF shows that #ifdef ChipSAFMemWords <> 0 does fail, where #if ChipSAFMemWords <> 0 does work. I think the CDF file has the debug we require.
Well done. I really should add a lot more debug to conditional compilation. I will if I find time later this year.
Many thanks. I'd looked in PicInfo, and I'd seen SAFEN (and tried it) I then found SAF_ROWSIZE_BYTES (and tried it too) but hadn't spotted ChipSAFMemWords and so hadn't tried it. Mind you, by then I'd thought I was going in the wrong direction. This seems to be working: #IfDef ChipSAFMemWords SAFRead (HiAddr+1, EePromWVal) SAFRead (HiAddr, EePromWVal_H) #EndIf As is the case with "#IfDef" if the "<> 0" is present at the end of the line, the comparison will always fail.
Hi, Look at PICINFO for the available constants for the chip(s). The ChipData tab in PICInfo show the exposed chip specific constants. Here is an analysis and recommendation to resolve. /* GCBASIC source generated by BLOCKLY. An Open source code generator. A GCBASIC source program */ // Date: 06/14/2025 // Version: 0.9b // Author: Evan #chip 16F15244 #option explicit Dim EePromWVal, HiAddr as Word // #IfDef CHIP_16F15244 // GOOD // #IfDef Bit(SAFEN) // SAFEN is CONFIG BIT and not exposed. // #IfDef...
I was trying to use a cheaper device for a design I'm making 50 of. I thought I would replace a 16F18xx with a 16F152xx. It's only a small program so I don't need much program storage. I get an error that there is no EeProm capability on the 152xx devices, which is correct, there isn't. I changed all references to SAFRead/SAFWrite and the program compiled. No problem. I thought I'd get clever and use some 'IfDef' statements to conditionally compile for devices with either SAF or EeProm but I can't...
I was trying to use a cheaper device for a design I'm making 50 of. I thought I would replace a 16F18xx with a 16F152xx. It's only a small program so I don't need much program storage. I get an error that there is no EeProm capability on the 152xx devices, which is correct, there isn't. I changed all references to SAFRead/SAFWrite and the program compiled. No problem. I thought I'd get clever and use some 'IfDef' statements to conditionally compile for devices with either SAF or EeProm but I can't...
Build update number only. No functional change.
Fix for bug on AVR when bit test in interrupt handler occurs in the middle of a bit test in the main code.
GCBASIC for Blockly updated Explore the new demo GCBASIC for Blockly projects. See https://www.gcbasic.com/GCBASIC_Blockly_Examples.html for the new Robot Controller. The GCBSASIC for Blocky tool has new features: You can set a port constant state to On or Off You can use a number constant in logic statements You can use a port constant in logic statements All very logical. Evan
The logic will need testing and validating. It may, or it may not work. :-)
Many thanks for the prompt support and example. I have a hardware setup on the bench and should be able to take a look-see tomorrow. I will report back. However, power outages here are not helping anything, hopeully they will be cleared up overnight.
Here is an untested implementation of USI I2C Slave GCBASIC library for USI TWI (I2C) Slave driver on ATtiny84A Implements TWI slave functionality using USI module Based on Atmel AVR312: Using the USI module as an I2C slave Created for ATtiny84A with SDA on PA6 and SCL on PA4 What Does it Do? The main loop in the the example GCBASIC program that demonstrates how to use the USI library functions to configure an ATtiny84A microcontroller as an I2C slave device. Functionality Initializes the ATtiny84A...
https://github.com/rambo/TinyWire/tree/master/TinyWireS There are plenty of Master libraries to choose from. There are also Atmel Application Notes: 310 and 312 covering using the USI as TWI. Covering Master and Slave modes respectively.
GCBASIC for Blockly Demos Explore the collection of GCBASIC for Blockly projects in XML format. See https://www.gcbasic.com/GCBASIC_Blockly_Examples.html All the demos are now listed automatically. Just clck to open. Enjoy... with the corrected URL
:-) Post what source is out there.
If that is the case. Do you want a link for a good library, or do you have some notes to port and I'll take a bash?
If the C libraries are published then porting is a relatively easy task. The datasheet was vague on how to use USI.
GCBASIC for Blockly - Demo Guide Introduction: Sharing Blockly Solutions Welcome to GCBASIC for Blockly, where programming meets visual simplicity and modular design. This guide introduces how to create, refine, and share Blockly-based solutions, making collaboration effortless. Instead of writing complex manual code, Blockly allows developers to drag-and-drop logical blocks, simplifying embedded programming. By sharing structured solutions, users can reuse, refine, and optimise existing logic, accelerating...
Anobium, Thank you for your reply. I had worked out that theT84 (and a range of other Atmel devices) used different hardware for I2C. It is a shame that the USI hardware is not supported by GCB currently. Although I'm well versed with BASIC, sadly I'm not in a position to write the required GCB code to support I2C via USI at this time. For this project, I shall return to using C/C++, where the relevant hardware libraries already exist. The project timelines do not have resources to code and test...
GCBASIC Blockly Project Guide Introduction This guide provides a straightforward, local installation of GCBASIC for Blockly, allowing you to run it seamlessly on your system. By using Python’s built-in http.server, you can create a lightweight web server to host Blockly files without any complex setup. The process is simple: 1. Install Python. 2. Copy Blockly files to a directory. 3. Start a local web server with a single command. Follow this guide to quickly set up your GCBASIC_Blockly.html project...
GCBASIC Blockly Project Guide Introduction This guide provides a straightforward, local installation of GCBASIC for Blockly, allowing you to run it seamlessly on your system. By using Python’s built-in http.server, you can create a lightweight web server to host Blockly files without any complex setup. The process is simple: 1. Install Python. 2. Copy Blockly files to a directory. 3. Start a local web server with a single command. Follow this guide to quickly set up your GCBASIC_Blockly.html project...
News. Table definition and ReadTable added. Not may reviewers to date. :-( Was it all worth it?
Hello Adam, These chips use USI for TWI and the GCBASIC library assume the TWI registers not the USI. You can implement the USI will some ease but it may be a lot easier to use software I2C for your solution.
New to GCB and the first few test projects I created have worked OK. So I appologise if I paosted incorrectly. I did do some searches for a similar issue, but pinned nothing down. Moved onto something more complicated with being an I2C Slave on an ATTiny84a. I have attached a ZIP of the files that I think are relevant. Let me know if you need anything else. GCB version: 1.76.2 Release: 23074 Basically the code appears to referance TW (Twin Wire) hardware, but the 84a uses a USI (Universal Serial...
No you do not need a GitHub account to see the GitHub URL... I spotted that I had made the repository Private.. it is not Public
🌟 Bringing GCBASIC to Blockly – A New Era for Embedded Programming GCBASIC for Blockly brings a powerful, visual programming interface to microcontroller development, replacing the previous Graphical User Interface (GUI) with an intuitive drag-and-drop approach. Originally developed by Google, Blockly was inspired by work from MIT, making coding more accessible through block-based programming. This integration enhances GCBASIC’s structured language, providing: Syntax-free programming, reducing errors....
🌟 Bringing GCBASIC to Blockly – A New Era for Embedded Programming GCBASIC for Blockly brings a powerful, visual programming interface to microcontroller development, replacing the previous Graphical User Interface (GUI) with an intuitive drag-and-drop approach. Originally developed by Google, Blockly was inspired by work from MIT, making coding more accessible through block-based programming. This integration enhances GCBASIC’s structured language, providing: Syntax-free programming, reducing errors....
News Lots more added but this is the baseline functionality. This needs someone to want to use this to drive the overall solution. Version 06.10.2025.01 Add Create SubRoutine and call Subroutine Change layout to use 90% of browser Reduced banner font size to give more real estate for Blockly Add GCBASIC logo to workspace Set Grid to off by default New default project now has subroutine capability Now looks pretty cool.
News Lots more added but this is the baseline functionality. This needs someone to want to use this to drive the overall solution. Version 06.10.2025.01 Add Create SubRoutine and call Subroutine Change layout to use 90% of browser Reduced banner font size to give more real estate for Blockly Add GCBASIC logo to workspace Set Grid to off by default New default project now has subroutine capability Now looks pretty cool.
News Just added For-Next loop. I can add For-Conditional Exit For-Next if required. Tables and Functions support will be very comprehensive implementation. Any other commands can be added as required. Evan
You need a GitHub account.
the github 'discussion' link is 404'ed
News The latest build has Logic blocks, plus many Maths blocks from the last few days. Blockly Diagram Description for GCBASIC Blockly - Build 06092025 11:45 Hello fellow GCBASIC enthusiasts! Sharing a snapshot of the current Blockly workspace from the GCBASIC Blockly project (build 06092025 11:45). This picture showcases a well-constructed program designed for a PIC microcontroller, leveraging the visual block-based interface to generate GCBASIC code. Let me break it down: Workspace Overview Interface:...
News The latest build has Logic blocks, plus many Maths blocks from the last few days. Blockly Diagram Description for GCBASIC Blockly - Build 06092025 11:45 Hello fellow GCBASIC enthusiasts! Sharing a snapshot of the current Blockly workspace from the GCBASIC Blockly project (build 06092025 11:45). This picture showcases a well-constructed program designed for a PIC microcontroller, leveraging the visual block-based interface to generate GCBASIC code. Let me break it down: Workspace Overview Interface:...
So if there is a variable (enabled) use its value instead. Ok. Needs explaining, but practical, yes. Good thing. I think the interface is pretty easy to follow now. The black borders and the end repeat / loop at the end of the loops, made a big difference. Thumbs up!
So if there is a variable (enabled) use its value instead. Ok. Needs explaining, but practical, yes. Good thing. I think the interfaces is pretty easy to follow now. The black borders and the end repeat / loop at the end of the loops, made a big difference. Thumbs up!
Try here https://gcbasic.com/GCBASIC_Blockly.html?dl=1 Play and generate the code - you can always reset the page by reloading the page. Wait [1 or mytimer] s Is not actual code, is it? Wait [1 or mytimer] s would generate Wait 1 s or Wait mytimer s. Very clever. Lots of the functionality works, some of the functionality is not yet implemented. But, this really shows what is possible!
I would definitely choose case #2. Wait [mytimer] s or Wait 1 s -Makes perfect sense. Easy to follow and understand. Wait [1 or mytimer] s Is not actual code, is it?
Here is a different Block for the Wait. So, great feedback from you. Case #1. The left field will take any number value. or Case #2. The right field will take any variable, calc etc. Note the left field is not read-only. This an a much better approach.
Here is a different Block for the Wait. So, great feedback from you. Case #1. The left field will take any number value. or Case #2. The right field will take any variable, calc etc. This an a much better approach.
Much better. The border is a very good workaround and the loop command at the end of the loop makes it easier to understand the code. I don't understand what mytimer does inserted to the right of wait in the repeats, why on the side? I agree it is a good idea following the standard. Still, a little less cute and a little more clarity (more linear) would have been nice, but it is probably not easy to convince MIT/Google of that.
I am sure you can write a Fortran version!!! The process is relatively simple. You need to know the output expect. You define the Blocks, you define the output from the Blocks and it works. It is way more complex in reality but this is the high level process.
The Do-Loop implement in the latest build has a simpler construct in the latest build. A DO-LOOP is a block that makes the program repeat a task, like replaying a game level. The Shape of a Simple DO-LOOP Block. It’s a tall rectangle with a tab on top and a slot below: +------------------+ | Do | <- Tab to connect above | [open space] | <- For your actions | Loop | <- Slot to connect below +------------------+ Colour: Green for "Loops". Repeats actions inside it, e.g., saying "Hi!" multiple times....
One thing that strikes me is the blocks nearly melting into each other making it hard to follow the logic. Visually the code more or less just continues downwards, without looping. I guess this design for good looks, but for readability (less confusing for a newbie too) a much clearer gap around individual loops would help see into it. I think. Why mainloopvar?
Cute, fun. Even though I'm an old (actually very old) school programmer. So old school that I once programmed in Fortran on a Digital PDP11-84. I like playing with these things, I'll play with it a bit...
Want to try the build, try it https://gcbasic.com/GCBASIC_Blockly.html?dl=1
News: I have updated the host solution to auto-load an example project. This means you can select the Generate Code button and you can experience the code generation - no blank workspace to start with..... You can create you projects, save, re-open and import existing blocks. The initial project is a LCD project. This is alpha development. If someone wants to change to automatically compile and program that is doable. Your feedback is important. Enjoy.
News: I have updated the host solution to auto-load an example project. This means you can select the Generate Code button and you can experience the code generation - no blank workspace to start with..... You can create you projects, save, re-open and import existing blocks. The initial project is a LCD project. This is alpha development. If someone wants to change to automatically compile and program that is doable. Your feedback is important. Enjoy.