Using Cforth, looking for serial examples #152
-
Hi all, I just discovered Mitch Bradley’s amazing Cforth, and I specially love the way he has created a VM with a pre compiled dictionary and a plethora of supported MCU’s. I can’t seem to find a lot of examples on how use this forth, lots of words, and would love if someone can point me in the right direction. I’m keen on simple UART serial communication on the RP2040 or the ESP32. Forth the EP2040, I think I have most of the code ready to enable the pins, but I don’t have all the details and most of the APP’s folder examples have a lot of missing little words that I can’t seem to find. https://gist.github.com/jemo07/d511aa14da7fc34e9e90bf4a0ecc390f I’m mostly interested in learning forth, while building fun little projects just to test and showcase Cforth to the rest of the community. Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
"Lots of missing little words" - tell us some specific examples. I can't really address "lots of". |
Beta Was this translation helpful? Give feedback.
-
https://github.com/MitchBradley/cforth/blob/master/README.md explains how to build for RP2040 using PlatformIO, which leverages the C++ UART implementation in the Arduino framework. If you're wanting to reimplement a UART driver in Forth, you will have to disable that C++ implementation somehow, or steal the hardware out from under it. Good luck! |
Beta Was this translation helpful? Give feedback.
-
There are example applications in various app/ subdirectories like arm-teensy3-pump, bottle-filler, esp8266-rtos-keg, filler, keg, labeler, and scale. Some of them are for automating various processes in a Kombucha production kitchen. The mqtt-* apps are IoT gadgets that are part of an IoT demo system that involved starting the demo with a sonoff switch, then using an RFID tag to start a robot car, using an alcohol sensor as a breathalyzer, using load cells from an old bathroom scale as an accelerator, sending speed commands to a robot car, and finally taking a selfie with an ESP32-CAM concealed inside a Bender (Futurama) action figure. The individual components were ESP8266 and ESP32 based gadgets, and the storyboard ran on a tablet computer with NODE-Red managing overall various state transitions. |
Beta Was this translation helpful? Give feedback.
-
cforth is not intended to be an all-inclusive product with an extensive fixed list of system functions. Instead, it is whatever I or other need it to be for specific projects. When I need additional functions in extend.c, I often create a new directory under src/app for the specific application, adjusting extend.c as needed. |
Beta Was this translation helpful? Give feedback.
-
Hello Mitch, Yes I’m stating to comprehend that, thank you for bringing in some clarity. Apologies for the lack of understanding. This has helped me a I can further evaluate how to get the serial communication needed. This brings a new level of clarity in understanding the app folders. This sets me in an exiting opportunity to better understand C-Forth. Thank you @MitchBradley and @quozl for shedding some light into this, will close this and comeback if and when I run to a standstill. |
Beta Was this translation helpful? Give feedback.
cforth is not intended to be an all-inclusive product with an extensive fixed list of system functions. Instead, it is whatever I or other need it to be for specific projects. When I need additional functions in extend.c, I often create a new directory under src/app for the specific application, adjusting extend.c as needed.