Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: variable/constant input from a PC ?

2004-07-14 by Dave Mucha

--- In AVR-Chat@yahoogroups.com, Robert Adsett <subscriptions@a...> 
wrote:
> At 04:31 PM 7/14/04 +0000, you wrote:
> >I'm getting way ahead of myself vs. my understanding of programming
> >as I have only started to read the C programming book.
> >
> >I was wondering if there is a way to connect a uC to a PC via SC
> >(serial cable) and input constants ?
> >
> >What I am thinking about is making a timer.
> >I would input a value of say 1 minute to get the program running 
and
> >then later, if I wanted to change the value, I'd like to only input
> >that new value from a PALM or PC or something like that.
> 
> The short answer is yes.
> 
> The longer answer (you knew there was a longer answer) is you need 
to write 
> something at the microcontroller end to have a 'conversation' over 
the 
> serial port to get the new values and store them somewhere (EE 
> maybe?).  The microcontroller would parse an input string of 
something like 
> this
> 
> a 100
> 
> which it would interpret as setting value a to 100.  It would then 
sore 
> that somewhere for the control program in the micro to read.


Makes sense.

If I have 10 timing loops and want each to be indivudually set, I can 
declare a constant for each

a = 100  ; seconds
b = 900
c = 60
 and so on

then input a string of 

a 100 b 900 c 60 (and so on) so that these would be altered in the 
program and used for the timing counts.

I know the format is not correct, but the idea is that I would 
probaly have to send all the values each time, or maybe just the ones 
I want to change.  (guess this is that trees in the forest thing)


Is there anyone who does something similar ?   The end result will be 
that students will be able to set the timing for the data logging and 
then put them into the greenhouse and take readings.

Hortocultural students are not electronicaly inclined so the screen 
on the PC would need to be simple.  Maybe even a spreadsheet layout 
with the names of the things and the timing values.

Dave

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.