In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote: Nick, that's right - on the pot board, the mcu is constantly reading the current setting of all pots. In an array of 16 bytes, I hold the last value read for each pot. After a new A/D conversion I compare the new result against the last one. When it differs, I send a change message to the "super master". When this was successful, I save the new value in the array. If not, I don't save it. Thus, when the same pot is read the next time, the unit automatically tries to send a new change message in case the pot val still differs from the saved one. The maximum value I allow for a pot reading is 254, and not 255 - why? Well, on the other hand, the "super master" can secifically have the unit send the setting of one or all pots. In this case, when it receives such a request, it writes 255 to the last value register, or 255s to all last value registers. This causes the pot unit to automatically send one or 16 change messages when it reads the pot(s) next time, as the last value and the current value are definitely different in this case. With this "trick", it was not necessary to specify a special answer format for "super master" requests. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=89152#m89653 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)