News:

We're live! Join us!

Main Menu

Picomite

Started by JKnightandKARR, Jan 29, 2025, 11:16 PM

Previous topic - Next topic

JKnightandKARR

Quote from: granz on Mar 11, 2025, 06:48 AM
Quote from: JKnightandKARR on Mar 10, 2025, 11:24 PMYup, that did it. Thanks!  Though playing with the Pause command didn't seam todo anything....  If what I read was right Pause 1000 = 1 second.  I changed it to various values inc 1, 10, 100, 1000 & 10000 and nothing changed on the blinking rate.  Did I do something wrong?? PM sent btw.

Edit, I think I know the issue.... I was using the only option at this moment GP0 for the built in LED...
Which Pico are you using, Pico or Pico W?

The Pico has the built-in heartbeat LED at GP25, not GP0 (unless you are talking about an external LED, rather than the built-in one.) If you are using the Pico W, the heartbeat LED is not attached to a GPIO pin, the heartbeat is turned on, or off, by the OPTION HEARTBEAT ON/OFF statements.
Its Pico H is whats printed, the first info i got said 0 not 25, so guess that info is wrong. Which would explain it.  Lol

JKnightandKARR

#16
Quote from: granz on Mar 11, 2025, 06:48 AM
Quote from: JKnightandKARR on Mar 10, 2025, 11:24 PMYup, that did it. Thanks!  Though playing with the Pause command didn't seam todo anything....  If what I read was right Pause 1000 = 1 second.  I changed it to various values inc 1, 10, 100, 1000 & 10000 and nothing changed on the blinking rate.  Did I do something wrong?? PM sent btw.

Edit, I think I know the issue.... I was using the only option at this moment GP0 for the built in LED...
Which Pico are you using, Pico or Pico W?

The Pico has the built-in heartbeat LED at GP25, not GP0 (unless you are talking about an external LED, rather than the built-in one.) If you are using the Pico W, the heartbeat LED is not attached to a GPIO pin, the heartbeat is turned on, or off, by the OPTION HEARTBEAT ON/OFF statements.
Yeah, as I thought the info I found was wrong.  Using the Heartbeat command shut it off on GP25 and now I can use that as an example till I get something else to use with it.  I guess I could shove it in my PPDB with a custom designed pin adapter to sock it in place of the Peopeller IC, since I can't program this board, USB port got ripped off, ext programmer rigged up needed.

However on a side note.  The manual on Pg 9, says "SETPIN 32, DOUT" and SETPIN GP27, DOUT" refer to the same pin and operate the same.  I can see this as VERY confusing, so maybe just do one or the other and keep it simple.  Also noticed there isn't any GP23, GP24 or GP25, physical pins, but are Ref to other built in functions that aren't used the same way as the other pins.

granz

Quote from: JKnightandKARR on Mar 11, 2025, 10:01 AMIts Pico H is whats printed, the first info i got said 0 not 25, so guess that info is wrong. Which would explain it.  Lol
The "H" suffix refers to the addition of male header pins on the board. That can be on the Pico H, or the Pico WH; those two already have the male headers soldered to the boards - at an additional ~$1 (which is why I recommend those options, unless you need female headers, or something else.)

granz

Quote from: JKnightandKARR on Mar 11, 2025, 12:27 PMHowever on a side note.  The manual on Pg 9, says "SETPIN 32, DOUT" and SETPIN GP27, DOUT" refer to the same pin and operate the same.  I can see this as VERY confusing, so maybe just do one or the other and keep it simple. 
That is so that you can use the named GPIO pins, or the equivalent pin numbers on the DIP board itself. Yes, it can be a bit confusing - I tend to use the GP pin numbers, but it's not too hard to convert, if someone else uses the opposite nomenclature.
Quote from: JKnightandKARR on Mar 11, 2025, 12:27 PMAlso noticed there isn't any GP23, GP24 or GP25, physical pins, but are Ref to other built in functions that aren't used the same way as the other pins.
That is explained on the next page (page 10.) Those pins are used for internal functions for the microcontroller board.

JKnightandKARR

Quote from: granz on Mar 11, 2025, 03:34 PM
Quote from: JKnightandKARR on Mar 11, 2025, 10:01 AMIts Pico H is whats printed, the first info i got said 0 not 25, so guess that info is wrong. Which would explain it.  Lol
The "H" suffix refers to the addition of male header pins on the board. That can be on the Pico H, or the Pico WH; those two already have the male headers soldered to the boards - at an additional ~$1 (which is why I recommend those options, unless you need female headers, or something else.)
Got ya, makes sence, the wifi ver could make interesing projects.
Quote from: granz on Mar 11, 2025, 03:40 PM
Quote from: JKnightandKARR on Mar 11, 2025, 12:27 PMHowever on a side note.  The manual on Pg 9, says "SETPIN 32, DOUT" and SETPIN GP27, DOUT" refer to the same pin and operate the same.  I can see this as VERY confusing, so maybe just do one or the other and keep it simple. 
That is so that you can use the named GPIO pins, or the equivalent pin numbers on the DIP board itself. Yes, it can be a bit confusing - I tend to use the GP pin numbers, but it's not too hard to convert, if someone else uses the opposite nomenclature.
Quote from: JKnightandKARR on Mar 11, 2025, 12:27 PMAlso noticed there isn't any GP23, GP24 or GP25, physical pins, but are Ref to other built in functions that aren't used the same way as the other pins.
I'll just stick to the GP##, keep it simple.
That is explained on the next page (page 10.) Those pins are used for internal functions for the microcontroller board.
I saw that, not sure they'll be much use to me, but never know.

granz


JKnightandKARR

Ok...... got ANY IDEA WHATSOEVER on HOW in the heck you use the Device WS2812 command????????  I've used EVERY idea on stuff I find, all I get is errors..... Expression syntax stuff...

granz

The WS28xx usage is described on page 43 of the manual (ver 5.08). The trick is to know that the WS28xx series takes three 8-bit numbers (for red, green and blue - and white if it is an RGBW LED.) PicoMite BASIC includes codes for those numbers, as RGB(xxxx) - like RGB(red) for red. This is shown in the example on that page, but the list is given on page 54, second paragraph. These are just the main colors, but you can use numbers (from H000000 through &HFFFFFF - or &HFFFFFFFF for LEDs with white,) to create your own colors also; see page 94 of the manual.

If you are using the LED on that GeeekPi board, then you would use 1 for the nbr parameter (since it is a single LED, and not a string.) So on that board, to turn the WS2812 LED red, you would use:
DEVICE WS2812 O, GP12, 1, RGB(red)
or you could use:
DEVICE WS2812 O, GP12, 1, &HFF0000
The hex number is all on (FF) for the red, and all off (00) for the green and blue.
The hex numbers that you would send out would be in the format: &Hrrggbb - where each pair is a number between &H00 and &HFF (or 0 through 255) for that color (i.e. rr is the intensity of red, gg is the intensity of green and bb is the intensity of blue.)

If you were to use a string of those WS2812 LEDs, you would need to set up an array of 24-bit numbers. You would need one 24-bit number in each element of that array. The example on page 43 of the manual shows code for a string of five WS2812 LEDs, and how you would set up the array B% (the dimension command in the example sets up the array, and then fills it with 24-bit numbers for red, green, blue, yellow and cyan) on the first line. On the second line the example sets up pin GP5 (the pin which has the LED string attached) as an output. Then on the third line, the Pico sends out the numbers to light up the string of LEDs with the colors defined in the array in the first line of the example.

The real trick of PicoMite BASIC is to get the really get to know the manual. I just enjoy reading through the manual, and then try out each new thing that I come across.

JKnightandKARR

Quote from: granz on Mar 15, 2025, 06:55 AMThe WS28xx usage is described on page 43 of the manual (ver 5.08). The trick is to know that the WS28xx series takes three 8-bit numbers (for red, green and blue - and white if it is an RGBW LED.) PicoMite BASIC includes codes for those numbers, as RGB(xxxx) - like RGB(red) for red. This is shown in the example on that page, but the list is given on page 54, second paragraph. These are just the main colors, but you can use numbers (from H000000 through &HFFFFFF - or &HFFFFFFFF for LEDs with white,) to create your own colors also; see page 94 of the manual.

If you are using the LED on that GeeekPi board, then you would use 1 for the nbr parameter (since it is a single LED, and not a string.) So on that board, to turn the WS2812 LED red, you would use:
DEVICE WS2812 O, GP12, 1, RGB(red)
or you could use:
DEVICE WS2812 O, GP12, 1, &HFF0000
The hex number is all on (FF) for the red, and all off (00) for the green and blue.
The hex numbers that you would send out would be in the format: &Hrrggbb - where each pair is a number between &H00 and &HFF (or 0 through 255) for that color (i.e. rr is the intensity of red, gg is the intensity of green and bb is the intensity of blue.)

If you were to use a string of those WS2812 LEDs, you would need to set up an array of 24-bit numbers. You would need one 24-bit number in each element of that array. The example on page 43 of the manual shows code for a string of five WS2812 LEDs, and how you would set up the array B% (the dimension command in the example sets up the array, and then fills it with 24-bit numbers for red, green, blue, yellow and cyan) on the first line. On the second line the example sets up pin GP5 (the pin which has the LED string attached) as an output. Then on the third line, the Pico sends out the numbers to light up the string of LEDs with the colors defined in the array in the first line of the example.

The real trick of PicoMite BASIC is to get the really get to know the manual. I just enjoy reading through the manual, and then try out each new thing that I come across.
I actually tried DEVICE WS2812 O, GP12, 1, &HFF0000 last night from my laptop and didn't work, just got errors, but on my desktop it did work. Odd...  I looked in all the manuals I had, and nothing I tried helped. Even did internet searches.  I tried ALL diff ways, but RGB{color). nothing worked

granz

Strange.

There is a Wiki page that I found which may help:

https://wiki.52pi.com/index.php?title=EP-0172

This is about that Geeek board, and you may find answers to other questions there (I have not really done more than glancing through it, though.)