The whole point of PBP 3 is that you don’t have to to do anything complex for simple projects. For PWM with a pot it’a as simple as:
PWMloop:
setpoint VAR byte
ADCIN 1, setpoint
HPWM 1, setpoint, 1000
GOTO PWMloop
This reads a potentiometer on ADC input 1 to variable setpoint and outputs a corresponding PWM output at 1kHz on PWM output 1.
Robert.
I understand that a simple language is good enough for simple projects, but that’s not the point. The issue is that a simple language isn’t good enough for complex projects!
Engineers should always be aware of limitations. What happens when a project comes along that’s too big for BASIC and/or can’t be accommodated on a PIC?
The answer is to use a language like C that provides more tuning features, and/or to switch to a more powerful chip. C, being mostly standard, simplifies porting projects to different chips. PBP3 BASIC is PIC only, a dead-end.
Being told BASIC is easy doesn’t mean it actually is, or that C/C++ is necessarily more complicated. Here’s the Potentiometer controlled PWM C code for Arduino. I suggest it isn’t more difficult than Robert’s BASIC example, and some might think it’s simpler.

Starting out with microcontrollers, I’d recommend Arduino over PIC and BASIC. Apart from the glass ceiling being much higher, Arduino comes with a huge library of interfaces to a multitude of sensors and peripherals. Someone else has done the hard-work. And being based on C/C++ makes it relatively straightforward to switch to mbed or an RTOS, if that’s required.
Being involved in a few failed professional projects made me sensitive to the horrible consequence of choosing technology that runs out of steam and can’t deliver. In 3 cases, the boss chose simple and quick tools, only to find they couldn’t meet the full user requirement. If I may draw an analogy, Enid Blyton’s Noddy books require a reading age up to 5 years. All good provided one sticks to “Noddy and the Bumpy-dog”, but that level of English isn’t good enough to decode an adult novel or a legal document. Same issue with tools generally: you can’t turn railway wagon axles on a Sherline! And though my Vauxhall Corsa is good for light load local commuting, it struggles with heavy loads and long distances. That an individual happens to manage with a reading age of 5, a Sherline, and a Corsa does not mean that these tools are good enough for everyone and everything. They aren’t!!!
Dave