Starting Point System : Forum

You are not logged in.

  • Index
  •  » ÁChameleon
  •  » How do you write the PWM counter to a local variable?

#1 2015-04-15 17:53:38

jt
New member

How do you write the PWM counter to a local variable?

# Can't figure out how to set a variable to the value of a PWM counter.
# Need to do this within the background event.

# For example, from uC control:

Device selected : 0
device handle : 468
>dim delta as int
>let delta = 2015
>print delta
received : 2015      # As expected

>pin 1 input
>adc 1
received : adc 1 232

>let delta = ?     
>print delta
received : 232        # As expected

>pwm 9 on
>pwm 9 counter
received : pwm 9 counter 8821

>let delta = ?
>print delta
received : 232         # Okay, can't read counter this way.

>let delta = pin 9
>print delta
received : 232         # And, can't read counter this way.

>let delta = pwm 9 counter
>print delta
received : 232         # And, can't read counter this way.

>let delta = counter 9
>print delta
received : 232         # And, can't read counter this way.

# So, how does one do it?

Offline

 

#2 2015-04-16 17:17:34

SPS Support Team
Moderator

Re: How do you write the PWM counter to a local variable?

Your first attempt was correct, to summarize:

dim delta as int
pwm 9 counter
let delta = ?
print delta

However a bug in the firmware does not update the value associated with the ? sign when the pwm <n> counter command is used.

Our next firmware release will correct the issue, but those who really need this to work right now can download our 4.4beta firmware here :
http://www.starting-point-systems.com/d … .4beta.frw

Offline

 

#3 2015-04-16 22:11:32

jt
New member

Re: How do you write the PWM counter to a local variable?

Attempted upgrade. Installed the upgrader and ran. It could not detect the uC2.

Returned with "Run-time error '53': File not found FTD2XX.DLL"

Offline

 
  • Index
  •  » ÁChameleon
  •  » How do you write the PWM counter to a local variable?

Board footer

Powered by FluxBB

Home