Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Search found 65 matches
www.mcselec.com Forum Index
Author Message
  Topic: constrain a variable?
snipsnip

Replies: 11
Views: 321

PostForum: BASCOM-AVR Archive   Posted: Mon Feb 17, 2014 11:59 pm   Subject: constrain a variable?
One other way to implement a fast/slow inc/dec is to use a timer to set the delay, then run the timeout shorter the longer the button is held down. Reset the timer to the long delay as soon as the bu ...
  Topic: constrain a variable?
snipsnip

Replies: 11
Views: 321

PostForum: BASCOM-AVR Archive   Posted: Mon Feb 17, 2014 8:18 am   Subject: constrain a variable?
You need "Backlvl" to be a signed type. Try
Dim Backlvl as Integer.
In the example he tests for < 1, which is 0 and sure tests ok also in unsigned variables. So signed ones are unnecessary, as lo ...
  Topic: constrain a variable?
snipsnip

Replies: 11
Views: 321

PostForum: BASCOM-AVR Archive   Posted: Sun Feb 16, 2014 10:43 pm   Subject: constrain a variable?
hi all,

is there an easy way to set a value range for a variable, ie 100-200 or say 0-255?

If Backlvl < 1 Then Backlvl = 1
If Backlvl > 250 Then Backlvl = 250

I'm using the above metho ...
  Topic: Shutter control
snipsnip

Replies: 14
Views: 1031

PostForum: BASCOM-AVR Archive   Posted: Wed Feb 12, 2014 9:31 pm   Subject: Shutter control
edit - double post, don't hit browser refresh!
  Topic: Shutter control
snipsnip

Replies: 14
Views: 1031

PostForum: BASCOM-AVR Archive   Posted: Wed Feb 12, 2014 9:23 pm   Subject: Shutter control
another interested vote.
some more application info would be cool.

cheers
 
Page 5 of 5 Goto page Previous  1, 2, 3, 4, 5
All times are GMT + 1 Hour
Jump to: