Author Topic: The SetDac Command  (Read 6585 times)

karen

  • Newbie
  • Posts: 18
  • I love YaBB 1G - SP1!
    • View Profile
The SetDac Command
« on: June 18, 2002, 08:58:13 AM »
i wonder if you can help me

using the setdac command how can i solve this problem

setdac from 0-3800
show on the lcd a scale of 0-250 where
3800 represents 0
0 equals 250

thanks

karen
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re: The SetDac Command
« Reply #1 on: June 18, 2002, 09:34:14 AM »
Try the following statements:

X = .....    ' assume X contains the desired value 0-3800.

SETDAC 1, X
N = 250 - X*250/3800

SETLCD 1,1, STR$(N)
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS