Colour Maximite 2 - 3D BASIC Engine
Robert Atkinson 2 | 08/12/2020 15:30:25 |
![]() 1891 forum posts 37 photos | Well there any many versions of BASIC. SOD said " Compared with C, BASIC takes up more memory, runs slowly and has weak system programming features." and Bazyle said " Basic is interpreted.." Neitherof these is strictly true. For starters there any complied BASICs. I use one, PBP3 (Pic Basic Pro 3.)This as you might expect runs on a PIC. I'm no programmer but have used PBP for hobby and commercial applications. I once wrote PBP code to drive a prototype machine that had two DC motors, a stepper and a serial interface. Fitted easily into a 8 bit 2K PIC 16F. So with prototyping done it was handed to the "proper" programmers some ime later they came back asking for more memory! They were using a C compiler costing a lot more than PBP bu, amonst other issues, were not accessing the hardware features of the chip. Were I'd used a internal UART They were bit banging the serial! Long story short the production units used my code. It is also not fair to compare languages for the change wheel program unless they were all run on the same hardware. Python on a RPi4 will be faster than Basic on a 4MHz PIC! As others have said Horsees for courses. Do look at PBP3 though, there is a free verson for hobbyists and you are not tied to specific hardware (the free version only works with a limited, but useful selection of PICs) http://www.pbp3.com Robert G8RPI (the RPI was issued at random back in 1978, nothing to do wth Raspberrys)
|
Squint | 08/12/2020 15:54:21 |
14 forum posts 27 photos | Another useful programing language/aid is Excel. It already has the output screen built. And by using Visual Basic for Applications one can write a programme, see the results and get an automatic CAD output. (Not sure what CAD means nowadays, in my days it meant Computer aided Drawing/Draughting but I think that now it means Computer Aided Design, hey ho). Micromite backpacks are very useful and make a lot of projects very easy https://geoffg.net/micromite.html Edited By Squint on 08/12/2020 15:56:42 Edited By Squint on 08/12/2020 16:00:14 |
IanT | 08/12/2020 16:45:47 |
2147 forum posts 222 photos | As usual it's about context Dave. Everyone who visits this Forum is different - they have different skills, interests, available time and funds. In the past year or two, I've dived into 3D Printing, learned a little Open SCAD, spent time working on Solid Edge 3D CAD, finished a few workshop projects and (even) progressed some of my Gauge '3' locos (and finally built a rolling road too). I have an old house (in a large garden) that also needs a lot of my attention. So my "context" is that I'm of an age where I've started to think a lot more carefully about what new things I begin and even if I can keep up with everything I've already started. It would be nice to have the time to explore new tech and I have been tempted. If my Grandson continues with his interest in 'Robots', then I might dive into Python and ROS and help him (although the 'Black Boxes' he'd be talking to will have a 'Mite' inside them). But clearly something else would have to give. I have tried other 'tech' and discovered that within my 'context' - e.g. an ageing brain, no professional 'coding' background and many other demands on my time - the Micromite has been a very good solution for my particular needs. As Kiwi commented "It makes the physical and intellectual interfaces easier than anything else I've come across." In other words, you don't need to be a Computer Scientist to use them and that's the key thing for me. Regards, IanT |
SillyOldDuffer | 08/12/2020 19:42:54 |
10668 forum posts 2415 photos | Here's a simple Xmas programming challenge for programmers using any language. It is possible in BASIC. Psuedo-code Input an integer EXAMPLES Example 1: input: 27 Example 2: input 28 loop because 110 is not a palindrome reverse = 011 Example 3: Then try input 196. Silver star awarded to all working programs. Gold stars for elegfant code. Execution speed and code size don't matter. What's the biggest non-palindromic number generated from 196 before your program malfunctions? To set the bar, my Python program for this one is 13 lines long. Dave
|
Gerard O'Toole | 15/12/2020 09:38:37 |
159 forum posts 13 photos | Sorry if it a bit off topic, but i haven't seen any mention of Forth. I remember a small computer, similar in every way, except colour, to the Sinclair. I think it was called the Jupiter Ace. My reason for mentioning is that it would seem an ideal language for CNC etc and for a lot of what we do in workshop. Just wonder if anyone here uses it or has any up to date information? |
SillyOldDuffer | 15/12/2020 10:47:21 |
10668 forum posts 2415 photos | Posted by Gerard O'Toole on 15/12/2020 09:38:37:
Sorry if it a bit off topic, but i haven't seen any mention of Forth. ...Just wonder if anyone here uses it or has any up to date information? Not in modern times, but I used Fig-Forth on my Nascom-1, an early Z80 microcomputer. By modern standards the Z80 is a slow CPU, and memory was tiny and gob-smacklingly expensive. Off the shelf, the Nascom was programmed manually in HEX, so developing the smallest program took forever. Then a 2kB ROM TinyBASIC appeared, which was much easier to use, but had severe restrictions. Fitting 16kB of RAM opened the door to an Assembler (Zeap), and after a year or two, a Microsoft-like BASIC appeared. Zeap did most of what I wanted, but writing Assembly Language is hard work so I was always looking for a decent small compiler. C and PASCAL were too big for the machine (it needed 32kB RAM and a disc), but Forth met the bill. Lots of nice things about Forth - moderately high-level, compact, extensible, and fast. I believe it was used control the cameras and other special equipment that created special effects for the original Star Wars films, which led to it being used today to control astronomical telescopes, and for some embedded applications. My main problem with Forth is the need to think in Reverse Polish Notation. The programmer has to push & pop commands and data on and off a stack, which isn't how I think. For example:
From this tutorial, most languages do IF condition like this: IF \ Decide flag value of 'cold'. cold \ Formulate flag THEN \ Leave construct when flag=false coat-on \ Conditionally executed code ENDIF \ End In Forth this is written: ( cold? \ flag on stack ) IF \ On 'false', jump to THEN coat-on \ Conditionally executed code THEN \ End; could be named ENDIF Later, when home computers became powerful enough to run C, PASCAL, editors and IDE's etc, I abandoned Forth. C is 'better' for low-level stuff, and high-level languages like BASIC are easier to write. Forth is still used, but it's not generally popular. Dave Edited By SillyOldDuffer on 15/12/2020 10:49:28 |
Michael Gilligan | 15/12/2020 11:02:52 |
![]() 23121 forum posts 1360 photos | Posted by Gerard O'Toole on 15/12/2020 09:38:37:
Sorry if it a bit off topic, but i haven't seen any mention of Forth. […] Just wonder if anyone here uses it or has any up to date information? . There’s an App for that ^^^ https://apps.apple.com/gb/app/retro-forth/id1170943580 MichaelG. |
IanT | 15/12/2020 11:25:36 |
2147 forum posts 222 photos | We seem to have a lot of common background SoD All this talk of Nascom, Zeap and now Forth. It took me forever to type Fig-Forth into my Nascom system and to then find all my typos and get it working - but it was really the only way to get my graphics card (based on a TI chip) running in a usable way. I've managed not to mention Forth here (thus far) but for control/embedded uses, I would suggest that folk look at MeCrisp & MeCrisp-Stellaris by Matthias Koch. I have it running on STM "Blue Pill" boards which may have been replaced by newer products these days but could be had for about £3 - very reasonable for a complete RTR STM32 board. Forth is a threaded (stack-based) language and RPN is one of the side effects of using a stack to perform everything. I think the simplest (& maybe best way) to describe Forth - is that it is extremely useful to write other 'application-specific' languages with. So if you need a robot-control language, a plain-language to G-code parser, a telescope user interface - Forth will let you write a programme that uses application appropriate wording/commands - e.g. "Left Arm 22 mm Up" or " Traverse Head To Home" or "Track X Y Z Co-Ord From Set Time" where each 'word' (Left, Arm, Head, Set) can be thought of as a sub-routine that is executed. I won't bother to further explain it here (like BASIC most programmers seem to hate Forth btw!) but if you would like to know more about MeCrisp (Forth) then have a browse here... MeCrisp (unofficial) Doumentation Regards, IanT |
Another JohnS | 15/12/2020 11:37:50 |
842 forum posts 56 photos | Dear SOD; Sure, Python's great, I use it a bit at work. However, I have to use C99; Shader work and OpenCL Kernels require this. (have to run on older code platforms sometimes, sticking to OpenCL, OpenGL for the moment) Your request is tailored to using a language like Python; if I reworded it to something like "find ALL the palindromes in the set [0->2,147,483,647] and return a flag indicating which one is set" then I'd win hands-down, especially with a good graphics card. BR - JohnS.
|
IanT | 15/12/2020 11:54:32 |
2147 forum posts 222 photos | SoD - having said I wasn't a Computer Science bod - you went ahead and set what I suspect would be an exercise for first year Computer Science Grads - who presumably have been introduced to "SoDs Algorithm" or some such as part of their course ! Your problem is clearly not a simple as it might first appear but by 'Trial and Error' I did manage to get a "Bucket" approach working (no bounds checking or anything) but clearly this wouldn't scale for the problem you described. This programme took me about 30-40 minutes (the next day) over coffee and whilst it might not impress a programmer - I was quite pleased getting this far from scratch. A T&E approach is very simple (and fast) to do with MMB - so it suits a programming 'dummy' (like myself) who is trying to work things out as they go along. ' I now have newer programmes that use more iterative processes and that I will (eventually) get to work - but it's very much my Christmas Crossword Puzzle - so I have a go at it when I have a quite moment and feel in the mood (which as Christmas gets nearer is harder to do). Regards, IanT PS Should have illustrated Forth with classic example code (for a washing machine) " Rinse Wash Drain Dry " Edited By IanT on 15/12/2020 11:58:32 |
Bazyle | 15/12/2020 12:42:07 |
![]() 6956 forum posts 229 photos | I wonder if anyone still has a working PET. |
Gerard O'Toole | 15/12/2020 12:46:35 |
159 forum posts 13 photos | Thanks, Dave, Ian, Michael, John for the information and links to Forth. It was the "Retro Computing " title that got me thinking about Forth. I had a Jupiter Ace and I also had Forth on a HP 85 Computer. I enjoyed playing around with it but at that time the need was for large data programs and Pascal took up most of my time. I can't pretend to have ever coded any serious application but I still have the 'Starting Forth' book. Now that I am retired , I want to play around with Arduino and motor control with a view to CNC at some time. Forth just seemed ideal, given it was developed to control large astrological Telescopes . It was also very memory efficient. I know the HP computer came with 16K memory, 2.2Mb 8" disks (which were considered huge at the time)and memory was always an issue with every program. I wil check out the links and hopefully get started somehow. Thanks
PS. Still have the HP computer - it was dumped and I literally rescued it from a skip. Not sure what happened to the Ace |
Robert Atkinson 2 | 15/12/2020 13:01:27 |
![]() 1891 forum posts 37 photos | If you find the ACE, they sell for around £500 on ebay. |
IanT | 15/12/2020 13:03:35 |
2147 forum posts 222 photos | 'Starting Forth' by Leo Brodie - the classic intro book for learning Forth. Can be found here as a PDF or online version. The illustrations really help to understand stack manipulation in an amusing way. Regards, IanT
|
Michael Gilligan | 15/12/2020 13:36:03 |
![]() 23121 forum posts 1360 photos | Almost incredibly: I have just stumbled across my paper copy of FORTHWRITE issue 55, datedAugust 1990 This was published by FIGUK ... the FORTH Interest Group(UK) No idea if they ever made it to the Internet. MichaelG. |
IanT | 15/12/2020 14:53:34 |
2147 forum posts 222 photos | Posted by Michael Gilligan on 15/12/2020 13:36:03:
Almost incredibly: I have just stumbled across my paper copy of FORTHWRITE issue 55, datedAugust 1990 This was published by FIGUK ... the FORTH Interest Group(UK) No idea if they ever made it to the Internet. MichaelG. I don't know about 'Forthwrite' Michael - but the US version (Forth Dimensions) certainly was archived. I haven't managed to find the site I originally downloaded my copies from (it was some time ago now) which was sorted by volume. There are some FD editions available at the site below - although they seem somewhat randomly ordered. Regards, IanT
|
Frances IoM | 15/12/2020 15:02:42 |
1395 forum posts 30 photos | IanT - no you are merely using the wrong projection - try title! |
SillyOldDuffer | 15/12/2020 16:22:57 |
10668 forum posts 2415 photos | Posted by IanT on 15/12/2020 11:54:32:
SoD - having said I wasn't a Computer Science bod - you went ahead and set what I suspect would be an exercise for first year Computer Science Grads - who presumably have been introduced to "SoDs Algorithm" or some such as part of their course ! Not so, the challenge is from Creative Computing magazine circa 1976, almost all of which was BASIC! This one is more number theory than computer science, but the problem isn't that unusual - data getting bigger and bigger! Here's an answer from the time: And then this more sophisticated version: I suspect it would be a challenge to get these working today, because both are written in - I think - minicomputer dialects, not the tidied up BASICs we're used to. For example, Tom Karzes' BASIC appears to allow him to use 'b' as both a scalar integer and as an array, while Gregory Yob had an interpreter that could add strings numerically, eg A$ = "123" Today most BASICs do string concatenation, eg A$ + B$ is "123321" No disrespect to Tom Karzes, but his program demonstrates why classic BASIC fell into disrepute. No obvious structure, meaningless names, GOTOs, plus noisy line numbers and continuations. Hard to understand how his code works. Gregory Yob's program contains a showstopper. DIM A$(254) is the maximum number of digits his BASIC could store in a string. Far too small - after only 1000 reversals '196' is over 400 digits long: 353466443924136897858377144029121143628590980834140834402086145040599291832845719034956 For the same reason, it's not amenable to John Alexander Stewart's "find ALL the palindromes in the set [0->2,147,483,647] and return a flag indicating which one is set". I like the idea of using a graphics card, but am confident it won't prove 196 never becomes palindromic because 196 is a Lychrel Number - it's 'an unsolved problem in mathematics'. Wikipedia says the reversal number has been taken to over billion digits without becoming a palindrome. Python can't do a billion digits on my machine but I submit it makes the logic of my working version clearer, and it handles big numbers gracefully: Python3 strings and integers are only limited by the amount of machine memory available. Although there's no Python command to reverse a string in place, reversing lists is built in, and it's trivial to convert strings to lists and vice versa. Lists might seem like an arcane computer science structure, but they're not! Micromites are marvellous compared with the computers available in 1976, be interesting to see how far one could get with the 196 palindrome problem. Dave
|
Frances IoM | 15/12/2020 16:56:30 |
1395 forum posts 30 photos | the key is structure used to hold numbers - which can be generalised to any radix - you hold then as a sequenced set of digit tokens for which a definition of addition is a wraparound index on this set which wraparound sets a carry in a second string - a number is I think a palindrome when the addition of two sequences of digit strings added in reverse direction produces no overflow - by this you could easily program hexadecimal palindromes etc |
SillyOldDuffer | 15/12/2020 17:40:14 |
10668 forum posts 2415 photos | Posted by Frances IoM on 15/12/2020 16:56:30:
the key is structure used to hold numbers - which can be generalised to any radix - you hold then as a sequenced set of digit tokens for which a definition of addition is a wraparound index on this set which wraparound sets a carry in a second string - a number is I think a palindrome when the addition of two sequences of digit strings added in reverse direction produces no overflow - by this you could easily program hexadecimal palindromes etc Can you give an example please Frances? I'm OK ( I hope!) up to: for which a definition of addition is a wraparound index on this set. My maths is limited, and you just popped the fuse! Dave
|
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
Sign up to our newsletter and get a free digital issue.
You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.