Talk:MicroTrac Controller v17.10/Code: Difference between revisions
Jump to navigation
Jump to search
(→IDs and Networks: new section) |
|||
Line 30: | Line 30: | ||
::read pin for LF (left track forward) | ::read pin for LF (left track forward) | ||
:::if HIGH | :::if HIGH | ||
:::: | ::::add "A" to string | ||
:::otherwise | :::otherwise add "a" | ||
::... | ::... | ||
:: | ::add timout time value "n" to string | ||
::if n = 8 | ::if n = 8 | ||
:::n = 1 | :::n = 1 | ||
::else n ++; | ::else n ++; | ||
::transmit string | |||
:::print to serial | |||
== IDs and Networks == | == IDs and Networks == |
Revision as of 15:57, 29 October 2017
Code Examples
- http://www.doctormonk.com/2012/05/sparkfun-venus-gps-and-arduino.html
- uses arduino's pin 10 for software serial
ideas
- use capital letter for relay ON and lower case letter for OFF.
- transmit continuous stream of current switch settings
- shut down if stream times out
- remote box could request gps coordinates by sending a "?"
- onboard could resond "¿" when ready
- remote will pause stream, onboard will broadcast gps, then continue.
controller setup loop
- setup
- enter AT command mode
- print "+++"
- set network ID
- read EEPROM setting
- ATID0x909
- set destination address
- enter AT command mode
controller loops
- loop
- read pin for LF (left track forward)
- if HIGH
- add "A" to string
- otherwise add "a"
- if HIGH
- ...
- add timout time value "n" to string
- if n = 8
- n = 1
- else n ++;
- transmit string
- print to serial
- read pin for LF (left track forward)
IDs and Networks
- network number 9090
- controller number 9091
- onboard number 9092