Arduino
-
- Posts: 2
- Joined: 31 Jan 2024, 14:09
Arduino
Can anybody help me how to integrate Arduino-programms (for relays and servo's) into AstroArt-programms. I need that to also control remotely the calibration-lamps in my spectroscope and flip-mirror on it, together with all the other AstroArtprogramming.
-
- Posts: 17
- Joined: 09 May 2019, 08:02
Re: Arduino
Hi,
I'm currently using such an integration for opening and closing the roof of my observatory after checking the relevant status of either the telescope (it shall be parked) and the roof itself. This last control is made by using a magnetic switch. The relevant commands, that are defined in the Arduino sketch, are passed to Arduino via the serial port connected to Arduino itself. I guess that you have already developed the relevant sketch.
Alessandro
I'm currently using such an integration for opening and closing the roof of my observatory after checking the relevant status of either the telescope (it shall be parked) and the roof itself. This last control is made by using a magnetic switch. The relevant commands, that are defined in the Arduino sketch, are passed to Arduino via the serial port connected to Arduino itself. I guess that you have already developed the relevant sketch.
Alessandro
-
- Posts: 2
- Joined: 31 Jan 2024, 14:09
Re: Arduino
Hi,
what my issue is: the communication between Astro Art and Arduino via serial commands.
Not Arduino sketches only the interface with Astro Art.
what my issue is: the communication between Astro Art and Arduino via serial commands.
Not Arduino sketches only the interface with Astro Art.
-
- Posts: 17
- Joined: 09 May 2019, 08:02
Re: Arduino
Hi Frank,
I'd like to share the code calling Arduino to verify if the roof is opened or closed. It was developed several years ago by a friend for his own observatory. I modified a litlle the original one:
QUOTE
RoofStatusCheck()
End
Function RoofStatusCheck()
cmd_serl=7 'serial port set by Arduino
fed_1str$="ing1"
fed_2str$="ing2"
roof_opened="y"
roof_closed="y"
' LETTURA SENSORI IN INGRESSO ***************************************
' rilevatore di tetto aperto
if roof_opened="y" then
serial.connect(cmd_serl) 'connection to the serial port
pause(2)
serial.send(fed_1str$) 'lancio stringa di interrogazione ingresso 1
pause(2)
status_ig$=(serial.receive())
status_i1$=(status_ig$[1])
serial.disconnect()
if status_i1$="1" then print "Roof status: opened ("+status_i1$+")"
endif
'fine rilevatore di tetto aperto
'rilevatore di tetto chiuso
if roof_closed="y" then
serial.connect(cmd_serl) 'connessione alla porta seriale
pause(2)
serial.send(fed_2str$) 'lancio stringa di interrogazione ingresso 2
pause(2)
status_ig$=(serial.receive())
status_i2$=(status_ig$[1])
serial.disconnect()
if status_i2$="1" then print "Roof status: closed ("+status_i2$+")"
endif
'fine rilevatore di tetto chiuso
end function
UNQUOTE
Regards
Alessandro
I'd like to share the code calling Arduino to verify if the roof is opened or closed. It was developed several years ago by a friend for his own observatory. I modified a litlle the original one:
QUOTE
RoofStatusCheck()
End
Function RoofStatusCheck()
cmd_serl=7 'serial port set by Arduino
fed_1str$="ing1"
fed_2str$="ing2"
roof_opened="y"
roof_closed="y"
' LETTURA SENSORI IN INGRESSO ***************************************
' rilevatore di tetto aperto
if roof_opened="y" then
serial.connect(cmd_serl) 'connection to the serial port
pause(2)
serial.send(fed_1str$) 'lancio stringa di interrogazione ingresso 1
pause(2)
status_ig$=(serial.receive())
status_i1$=(status_ig$[1])
serial.disconnect()
if status_i1$="1" then print "Roof status: opened ("+status_i1$+")"
endif
'fine rilevatore di tetto aperto
'rilevatore di tetto chiuso
if roof_closed="y" then
serial.connect(cmd_serl) 'connessione alla porta seriale
pause(2)
serial.send(fed_2str$) 'lancio stringa di interrogazione ingresso 2
pause(2)
status_ig$=(serial.receive())
status_i2$=(status_ig$[1])
serial.disconnect()
if status_i2$="1" then print "Roof status: closed ("+status_i2$+")"
endif
'fine rilevatore di tetto chiuso
end function
UNQUOTE
Regards
Alessandro