Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:30 28 Nov 2024 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 : PWM problem, probably me but..

Author Message
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 76
Posted: 09:15pm 09 Jul 2023
Copy link to clipboard 
Print this post

PicoMite, absolutely fabulous, next job making an accurate pedometer.
(the accelerometer should be taped to the big toe for best results)
then no need for complex maths.

I just want a beep, what am I doing wrong. (it's usually me)

setpin gp2,pwm1a
pwm 1,256,50,0

error = 'pin not set for pwm'

also, while I'm at it,

do flag=1
loop until flag

'not a biggie, but be aware

regs Dave
 
ice2642

Regular Member

Joined: 27/05/2023
Location: Brazil
Posts: 82
Posted: 09:40pm 09 Jul 2023
Copy link to clipboard 
Print this post

1 - Do you set the option power pwm ? (page 57)

2 - Look in the manual 87 page for the pwm configuration.

3 - look in page 92 for the correct setpin with pwm use.

I hope it help you.

Best regards,
MMBasic 5.0707 on PicoMite VGA
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 09:43pm 09 Jul 2023
Copy link to clipboard 
Print this post

You are setting a value (0) for pwm1b. Just omit the ",0"
 
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 76
Posted: 10:04pm 09 Jul 2023
Copy link to clipboard 
Print this post

That was quick! thanks Peter ! worked a treat. 'beeep'ed great !
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3150
Posted: 10:42pm 09 Jul 2023
Copy link to clipboard 
Print this post

Re DO, it's not clear what you're seeing or finding a problem with, but you need a ":" after DO.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 11:10pm 09 Jul 2023
Copy link to clipboard 
Print this post

Perhaps he is expecting an error as WHILE is usually the only thing that can follow DO.
Trapping every possible typo is a bit difficult.
 
Print this page


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

© JAQ Software 2024