Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:07 05 Jan 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Confused by SETPIN

Author Message
pwillard
Guru

Joined: 07/06/2022
Location: United States
Posts: 329
Posted: 07:16pm 02 Jan 2026
Copy link to clipboard 
Print this post

Trying new version 6 firmware on my old RP2040.

Now I'm confused.

Using the MANUAL example:


SETPIN GP21, DOUT
DO
PIN(GP21) = 1
PAUSE 300
PIN(GP21) = 0
PAUSE 300
LOOP


I get blinking on GPIO pin 16


Using this code:



SETPIN GP16, DOUT

DO
 PIN(16) = 1
 PAUSE 100
 PIN(16) = 0
 PAUSE 100
LOOP


I get fast blinking on pin 12.

???
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3528
Posted: 07:29pm 02 Jan 2026
Copy link to clipboard 
Print this post

Pin(16) is GP12. You must use either the pin numbers or the GP numbers--they aren't the same.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
pwillard
Guru

Joined: 07/06/2022
Location: United States
Posts: 329
Posted: 07:31pm 02 Jan 2026
Copy link to clipboard 
Print this post

I think I forgot that... its been a while.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8423
Posted: 08:14am 03 Jan 2026
Copy link to clipboard 
Print this post

Please don't use hardware pin numbers at all if you can avoid it. Doing so can completely screw up compatibility between your software and different hardware platforms.  :(  The chip itself uses the GPIOxx format, which MMBasic kindly abbreviates to GPxx to save our poor fingers, the I and O keys.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026