Hi
I am new to this forum so any help/feedback would be appreciated. I used to programme old ZX Spectrums in machine code and now have an Ardunio ready to control a typical day on a model railway set. By control I mean the environment not the trains. So we would hear a cock crow at 7, the workshops machinery would start work at 9, kids playgrounds move at midday and the lights come on late at night. All this works via servos relays and the lie. Great stuff with success so far.
The code so far has been written to cover a full day in a full day or just 60 mins depending on my needs. I intended to have an array that stored a time and action for each event. I would then loop through this to control the ‘day’.
I intended to use a READ DATA statement or similar to fill the array. So
‘07:00 M1’ would make the cock crow by playing mp3 track 1
‘09:00 M2’ would make the works start by playing mp3 track 2
’12:00 R1’ would make relay one turn on and switch the playground to swing, turn etc
’20:00 R2’ would make a relay turn on and the lights to a road light up.
You will get the picture.
But how do I fill the array. Does anybody know of a similar statement or method to the old READ DATA methods of Basic. I could of course define each line one by one but that seems very clumsy.
Graham