Compilation error: expected primary-expression before ':' token

Hello,

I am Bob and I am programming stupid. I am trying to build a RF Detector using an Arduino Nano and the code is written in FORTH. Arduino IDE is pushing out the "expected primary-expresson..." error and I don't know where to begin to try and fix this. I have installed nanoFORTH 1.4.4 and it's selected as the library, but I guess there's more to it than that. Here is the link to the video I am using to build the detector: Build A RF Field Strength Meter - YouTube

Here's the full code: FSM is the program "Field Strength Meter"

: 0Led pin4 low pin6 low pin8 low pin10 low pin12 low ;
: 1Led pin4 high pin6 low pin8 low pin10 low pin12 low ;
: 2Led pin4 high pin6 high pin8 low pin10 low pin12 low ;
: 3Led pin4 high pin6 high pin8 high pin10 low pin12 low ;
: 4Led pin4 high pin6 high pin8 high pin10 high pin12 low ;
: 5Led pin4 high pin6 high pin8 high pin10 high pin12 high ;

: FSM
Init.GPIO
SelectA0
Begin
?ADC 210 < IF 0Led THEN
?ADC 211 220 within IF 1Led THEN
?ADC 221 240 within IF 2Led THEN
?ADC 241 260 within IF 3Led THEN
?ADC 261 270 within IF 4Led THEN
?ADC 283 > IF 5Led THEN ?KEY
UNTIL drop ;

I am seeking help to get this code working so I can proceed with my project. I have hidden cameras I need to find... Thank you in advance.

The Arduino IDE doesn't compile FORTH code. You will need to find a version of FORTH that is compatible with your Arduino hardware and the code you show above. You can then install that version of FORTH on your Arduino and read its documentation to learn how to upload and run your code.

Thank you for your prompt response and I really do appreciate it.

Would you be willing to point me in a direction to the version of FORTH that is compatible with the Nano/code? I have been trying to search for answers, but I have come up with none which is why I joined this forum. The tools are all I need and the documentation I will follow through on my own. This sounds more complicated than I thought it would be. I have uploaded pre-made sketches before, but I have never built or compiled any in raw form.

I have been hacked and they have hidden cameras watching me that this detector will help me find.

Maybe some of that YouTube channel's earlier videos will help shed light on the version of Forth he uses and how to program it:

Thank you!! These videos look like exactly what I need. I owe you a beer.

I need this USBasp programmer to upload a hex file which installs Interactive Arduino so I can run the code. Brilliant!

Wish me luck

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.