|
Haven't seen any other posts with this problem so it must be something I am doing. The nano chips don't startup on power up unless I cycle the power a second time. This happens when the power has been off for more than 15 seconds. The chips just freeze and the programs don't run. I have added time delays etc in the first section of code to no avail. Is there some process that will ensure that the chips will startup every time? I am using a nano28 and the Nano Proto Board. Could the serial coms on startup be a problem?
pause 1000 'baud con i1200 'baud con i2400 baud con i9600 'baud con i19200
action var byte:motion var byte:servoNum var byte:value var word LeftVal var word:CenterVal var word:RightVal var word:rver var byte range var word:rst var word:spd var byte:i var byte:lt var word ct var word:rt var word: tdrval var word 'Time delay right tdlval var word 'Time delay left low 0:low 1:low 2:range=800:rst=600 pause 2000
'for i=1 to 6 readdm (i*(12+1)),[LeftVal.lowbyte,Leftval.highbyte,CenterVal.lowbyte,CenterVal.highbyte,RightVal.lowbyte,RightVal.highbyte,tdlval.lowbyte,tdlval.highbyte,tdrval.lowbyte,tdrval.highbyte,rver,spd] 'servo i-1,0-leftval,60
'cal: 'pulsout i-1,range 'pause 40 'range=range-10 'if range>800 then cal 'pause 100 'range=800 'pause1000 'next servo 0,0-650,40:servo 1,0-650,40:servo 2,0-650,40:servo 3,0-650,40 pause 2000 serout s_out,baud,["*"]:pause 500 Main:
_________________ Harley
|