https://github.com/ornen/go-xplane
X-Plane interface for Go
https://github.com/ornen/go-xplane
go xplane
Last synced: 6 months ago
JSON representation
X-Plane interface for Go
- Host: GitHub
- URL: https://github.com/ornen/go-xplane
- Owner: ornen
- License: apache-2.0
- Created: 2016-10-30T21:27:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-26T12:34:33.000Z (over 1 year ago)
- Last Synced: 2025-08-15T10:22:51.272Z (11 months ago)
- Topics: go, xplane
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 20
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# go-xplane
This is an interface to X-Plane for Go. The interface is functional and supports the basics, but does not cover all messages supported by X-Plane yet. Pull-requests are welcome.
## Example
```go
package main
import (
"github.com/ornen/go-xplane"
"github.com/ornen/go-xplane/messages"
"log"
)
func main() {
x := xplane.New("127.0.0.1:49000", ":49003")
x.Connect()
x.Send(messages.ThrottleCommandMessage{
Throttle: 1,
})
x.Send(messages.FlightControlMessage{
Elevator: 1,
Aileron: -1,
Rudder: 0,
})
go x.Receive()
for {
message := <-x.Messages
if message != nil {
log.Printf("%+v\n", message)
}
}
}
```
## License
This code is licensed under the Apache License 2.0.