Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dino 0.12.0 #34

Merged
merged 318 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
318 commits
Select commit Hold shift + click to select a range
f8802b6
Add DigitalOutput#low?, high?, on?, off?
vickash Sep 9, 2014
634846a
Call low? not board.low?
vickash Sep 29, 2014
dc38438
Switched from serialport to rubyserial
vickash Jan 3, 2015
f6caf61
Fix tests for rubyserial
vickash Jan 5, 2015
c810478
Change mock to double for rspec
vickash Jan 5, 2015
372c10c
Merge pull request #80 from austinbv/rubyserial
vickash Jan 5, 2015
6ae0c02
Merge pull request #72 from austinbv/ds18b20
vickash Feb 7, 2015
4f8a522
Remove upload/compile. Too much scope. Use shell scripts instead.
vickash Feb 7, 2015
0dce1e1
Update the readme for new command line options
vickash Feb 7, 2015
cc70a4d
Notify when the board is connected
vickash Feb 7, 2015
e257d56
Use a mutex when modifying callbacks to avoid modifying hash while it…
vickash Feb 7, 2015
4bb1809
Forgot to call super in initialize
vickash Feb 7, 2015
8c5724c
Use after_initalize instead
vickash Feb 7, 2015
7fcf387
Fix error leftover from cloning callbacks
vickash Feb 7, 2015
55b4385
Include a C library for the Due to compile
vickash Feb 7, 2015
a0d923c
Better behavior when using a shift register as a board proxy
vickash Feb 8, 2015
c7a24e8
Merge pull request #83 from austinbv/shift-register-modelling
vickash Feb 8, 2015
7fa7fca
Test 2.0.0, 2.2.0 and jruby. Bare minimum work to get tests passing.
vickash Feb 21, 2015
ee937d3
Better tests for Board. Move BoardNotFound into TxRx module.
vickash Feb 21, 2015
1926aeb
Fix inheritance of initalize for callbacks module
vickash Mar 1, 2015
d0644aa
Merge branch 'master' into 0.12.0-wip
vickash Mar 1, 2015
57258fb
Forgot to put back 5ms sleep in read thread to avoid high cpu usage
vickash Mar 1, 2015
52e7d1d
Make the read thread abort on exception. No more silently failing cal…
vickash Mar 2, 2015
27ed24a
Separate Board#read for simpler testing
vickash Mar 2, 2015
c165218
Expect all pins to be integer after component init. Add #pin to fix M…
vickash Mar 2, 2015
6090ebb
New rspec syntax for TxRx specs. Escape backslashes everywhere.
vickash Mar 3, 2015
cf895f6
allow instead of expect. Trying to get test passing on travis.
vickash Mar 3, 2015
3a8d73c
Rspec 3.2 syntax for all tests
vickash Mar 3, 2015
8976767
Test the Callbacks mixin properly
vickash Mar 3, 2015
a00e3b4
Don't need to #chop trailing \n from messages
vickash Mar 3, 2015
512e318
TCP lines need \n removed though
vickash Mar 3, 2015
8858b63
Make sure one wire library gets copied when generating a sketch
vickash Mar 23, 2016
23921aa
Use latest version of one wire library
vickash Mar 23, 2016
5af5c18
Small hack to avoid string -> char* conversion deprecation in latest …
vickash Mar 23, 2016
a7f29b7
Add the modified IRremote library as a submodule
vickash Sep 11, 2017
76ad102
Arduino half of infrared send. Reorganize lib/vendor folders for sket…
vickash Sep 11, 2017
0f6c39f
Don't need DHT or OneWire includes at sketch level
vickash Sep 11, 2017
66c4f1b
Forgot to actually call the infrared send function
vickash Sep 11, 2017
3ad2e12
Remove need for sendRawChar since we can cast inside Dino.cpp. Still …
vickash Sep 12, 2017
9ebf8df
Aux length to 512 like sketch. Allows up to 255 IR timings.
vickash Sep 12, 2017
b89064c
Add infrared emitter Ruby class and example
vickash Sep 12, 2017
452dedd
Merge pull request #88 from austinbv/infrared-emitter
vickash Sep 12, 2017
b432969
Patching in Piezo support by @MinasMazar from #74, since his repo is …
vickash Sep 12, 2017
eebbc86
Fix aux message test and forgot a comma
vickash Sep 12, 2017
3239ffc
Testing Travis CI workaround
vickash Sep 12, 2017
3481ec2
Update travis ruby version
vickash Dec 24, 2017
8bb60f7
Must cast IR length as uint8 or it hangs. Stub out tone for now becau…
vickash Dec 24, 2017
2a9df8a
Fix spelling error in frequency option.
vickash Dec 24, 2017
a732154
Remove some unnecessary includes from the main sketch files.
vickash Dec 24, 2017
48a60ea
Clearer comments for how multi pin components work.
vickash Dec 24, 2017
d987b66
Better implementation of delayed write when shift register acts as a …
vickash Dec 24, 2017
97d0906
Use byte (8 bit uint) instead of char for auxmsg. Less casting when c…
vickash Dec 25, 2017
7b7ab86
Add shift register read to Arduino sketch. Prevent listeners from mut…
vickash Dec 25, 2017
a9a9907
Ruby implementation for shift register read, updated register write, …
vickash Dec 26, 2017
779c30d
Make callback thread update component state after running all callbac…
vickash Dec 26, 2017
7f941fa
Make sure callbacks get the news data, not the old state.
vickash Dec 26, 2017
76c53da
Fix shift register output tests.
vickash Dec 26, 2017
70073ac
Add tests for IR emitter and shift register in.
vickash Dec 26, 2017
39f0854
Move register classes into module. Receive on latch pin instead of da…
vickash Dec 27, 2017
8ecdd97
Extract register communication into child classes.
vickash Dec 27, 2017
970443b
Add 1-way SPI read function and related shift register model.
vickash Dec 27, 2017
c2e4a1a
Always write 0s when SPI read-only.
vickash Dec 27, 2017
90fa23b
Add 1-way SPI register write and SSD example to go with.
vickash Dec 28, 2017
6d6e9a2
Add software flow control for data transmitted to the board.
vickash Dec 30, 2017
451fcdc
Forgot to remove a debugging line.
vickash Dec 30, 2017
e437a10
Add listeners for shift and SPI registers.
vickash Dec 30, 2017
c796776
Only split board messages on the fist colon. Allows colon in values.
vickash Dec 31, 2017
55af6a9
Add I2C functions to arduino sketch.
vickash Dec 31, 2017
b88f1dd
Missing gitlink for I2C library…
vickash Dec 31, 2017
13e84f7
Ack bytes received by board more often. Minor sketch cleanup.
Jan 5, 2018
3ebd051
Split into many cpp files. Toggle features with 1 #define.
vickash Jan 5, 2018
88d9deb
Map serial properly on the ATtiny85.
vickash Jan 5, 2018
ab8ec6b
preclock_high only matters for shift, not SPI.
vickash Jan 6, 2018
be48d68
More useful info and errors during connect/handshake
vickash Jan 6, 2018
baa98fa
Aux msg always 40 bytes if targeting ATmega168
vickash Jan 6, 2018
d9bd9db
Need to wrap Timeout in begin apparently…
vickash Jan 6, 2018
bb4e0fb
Forgot TCP file in earlier commits
vickash Jan 6, 2018
cd675bb
Fix tests for ruby < 2.5.0 and require rubyserial ~> 0.5.0.
vickash Jan 6, 2018
a69be54
Update CLI to target different boards
vickash Jan 7, 2018
b908bcf
Make all external libraries submodules. Fix a couple #ifdefs.
vickash Jan 7, 2018
e5de289
Remove OneWire submodule
vickash Jan 7, 2018
dc71fc9
Remove OneWire submodule files
vickash Jan 7, 2018
99c4100
Readd OneWire submodule cleanly
vickash Jan 7, 2018
60c03f7
Ignore backslashes that don't escape anything
vickash Jan 7, 2018
e3ca5f0
No more sprintf,dtostrf. Pass a Stream class to dino.
vickash Jan 7, 2018
359adc4
Fix how coreResponse works with listeners
vickash Jan 7, 2018
2384b14
Get ethernet and wifi? working with new Stream write method.
vickash Jan 7, 2018
776b237
Upgrade the ATMega168 target. Minor CLI bug fix.
vickash Jan 7, 2018
1f8b60f
Fix tone timer by removing unused IRRemote.cpp. Give mega168 tone too.
vickash Jan 7, 2018
1c2335b
Make Board#high 1 not 255. Added Board#analog_high for that.
vickash Jan 8, 2018
03b6bac
Improve bandwidth with soft flow control. Cleanup `TxRx#synced_write`
vickash Jan 9, 2018
2490a8d
Fix digital listeners always sending. Broken while removing sprintf u…
vickash Jan 9, 2018
65f9bd5
Call micros only once when updating listeners. Stronger typing.
vickash Jan 13, 2018
78fb692
Refactor acknowledgement out of sketch into Dino.cpp
vickash Jan 13, 2018
e8453ae
More flow control improvements.
vickash Jan 14, 2018
eeebd6b
Fix bug causing first servo pin used to be assigned to all objects.
vickash Jan 14, 2018
e316a26
Give every listener its own divider and just tick every 1ms instead.
vickash Jan 14, 2018
326f129
Add rotary encoder component by polling @1ms with the new listeners.
vickash Jan 14, 2018
98cdd4e
RotaryEncoder tracks position in degrees. Add Mac volume control exam…
vickash Jan 14, 2018
b6908a1
Add ESP8266 with most features. Uses GPIO numbered pins. Minor cleanup.
vickash Jan 16, 2018
910ad64
Return #read value. Test coverage for all component mixin behavior.
vickash Jan 19, 2018
42177cb
Cleaner IR code. Uses unmodified libs, works on ESP8266 now
vickash Jan 24, 2018
46f11df
Copy dependency sources when building gem
vickash Jan 24, 2018
0b65a35
Dynamic IR pin for ESP8266 since it bitbangs carrier frequency anyway.
vickash Jan 30, 2018
54e2462
Handle targets/exclusion when building sketch
vickash Feb 3, 2018
5729268
Ruby based OneWire with only the timing functions in C. Remove extern…
vickash Feb 3, 2018
43e7dea
Parasite power detection/support. Extract Bus interface.
vickash Feb 4, 2018
61da7cc
Cleanup one wire file names. Clearer code for parasite power detect.
vickash Feb 4, 2018
ea20609
Missing deletions from last commit?
vickash Feb 4, 2018
16e3be4
Add OneWire auto search and identify
vickash Feb 5, 2018
6f1eff7
Use a known working jruby version for travis.
vickash Feb 5, 2018
7d12609
Test 1-Wire search algorithm by simulating the bus in Ruby.
vickash Feb 5, 2018
ec113b4
Extract command API from components into a module.
vickash Feb 13, 2018
5725af1
Don’t use Fixnum#bit_length to keep Ruby 2.0 compatibility.
vickash Feb 13, 2018
f4b01e0
Trying to fix jruby tests
vickash Feb 13, 2018
1a09b98
Trying to get 2.0.0 and jruby to agree….
vickash Feb 13, 2018
f2587be
Maybe no sleep in wait loops is the real problem?
vickash Feb 13, 2018
234fd1f
RSpec is so great…
vickash Feb 13, 2018
d102c02
Comment cleanup, 1-Wire fixes, tests.
vickash Feb 13, 2018
1694632
More 1-Wire refactoring
vickash Feb 15, 2018
5c9ff4c
Default SPI access to 2-way, listeners read only.
vickash Feb 15, 2018
ba1f936
Minor cleanup of C functionss for shift and SPI listen.
vickash Feb 15, 2018
428e592
Revert I2C to built in Wire library for compatibility.
vickash Feb 16, 2018
a755926
Reader#read_using(method, &block). Other minor fixes.
vickash Feb 17, 2018
9bb37f8
Missing deletion from last commit…
vickash Feb 17, 2018
e6ccc34
#read_scratch should take blocks to keep callbacks in their thread.
vickash Feb 17, 2018
8b8a5fe
I2C bus, slave and DS3231 RTC example.
vickash Feb 17, 2018
bd83e35
Bug fix and test for analog and digital listeners
vickash Feb 17, 2018
75dbc5f
Remove misleading IrReceiver. Just an active low digital in.
vickash Feb 17, 2018
a0e1c98
ESP8266 class with pin mapping. Get aux limit in handshake.
vickash Feb 17, 2018
db5b9bd
Append current dino version to generated sketches.
vickash Feb 17, 2018
4b575c5
Trap interrupt and reset the board.
vickash Feb 17, 2018
4d1a333
DHT temp/RH sensor implementation in mostly Ruby.
vickash Feb 18, 2018
03f454e
Bunch of small fixes.
vickash Feb 22, 2018
14b3532
Pin wasn’t being set to ID servo & write microseconds instead now.
vickash Feb 22, 2018
2b2cc8d
Add Servo#speed= for continuous rotation servos.
vickash Feb 22, 2018
2d44bad
Switch from RSpec to MiniTest
vickash Mar 8, 2018
a6aa8b9
millis instead of micros for receive acknowledgement
vickash Mar 10, 2018
e633e65
Update helper.rb
VasiliyG May 3, 2018
250d9c8
Merge pull request #89 from VasiliyG/0.12.0-wip
vickash Jun 11, 2018
8474af9
Merge branch '0.12.0-wip' of github.com:austinbv/dino into 0.12.0-wip
vickash Dec 1, 2018
5d2063c
Small fixes to examples and comments
vickash Dec 1, 2018
fa8d650
Add basic EEPROM read/write functionality
vickash Dec 2, 2018
63b302e
Callbacks to run local code (on the board) based on listeners
vickash Dec 9, 2018
429d3a2
Add ESP8266 over the air update. Standardize CLI option format.
vickash Dec 10, 2018
8ad047f
TCP sketches fallback to serial so listeners work when no TCP connect…
vickash Dec 14, 2018
835f60f
Let basic outputs receive state updates from the board
vickash Dec 16, 2018
1afce17
Fix parser bug that would re-run commands if sent only newline
vickash Dec 16, 2018
1b71fe5
Let WiFi connect fail without blocking main loop
vickash Jan 1, 2019
a696e01
Fix a race condition in receiving handshake acknowledgement
vickash Feb 4, 2023
e3a4282
Pass tests
vickash Feb 4, 2023
2075848
Add EEPROM convenience methods and an example
vickash Feb 5, 2023
8d682f3
Clean up the I2C interface
vickash Feb 5, 2023
c51d4be
Readers and pollers handle arguments better
vickash Feb 5, 2023
728568d
Fix I2C
vickash Feb 6, 2023
88ef099
Add tests and remove unused methods for DHT sensors
vickash Feb 6, 2023
f606fad
Cleanup some tests
vickash Feb 6, 2023
faa361a
Start using simplecov and cleanup test helper
vickash Feb 6, 2023
b7fb1f5
Tests for core and one wire api
vickash Feb 6, 2023
652c726
EEPROM API and binary packing tests
vickash Feb 7, 2023
35a605f
API tests for I2C, IR emit, servo and tone
vickash Feb 7, 2023
60b4fb0
SPI testing and cleanup
vickash Feb 7, 2023
8560b46
Simplify EEPROM updating from board and board tests
vickash Feb 7, 2023
9fffa9b
Fixes to multipin proxy building and register state management. Base …
vickash Feb 8, 2023
4c175fd
Let SPI registers control MSBFIRST/LSBFIRST. Improved examples.
vickash Feb 8, 2023
278f8a5
Don't fix external OneWire library since it's no longer used
vickash Feb 9, 2023
59674ae
Add Board#eeprom convenience method
vickash Feb 9, 2023
1b833e7
Store listener dividers correctly on board. Store DigitalInput state …
vickash Feb 10, 2023
4e84108
Listeners still wrong with bitshift and (). Bitmasks work instead.
vickash Feb 10, 2023
a373608
Improve RotaryEncoder so #steps and #angle give state. Updated examples.
vickash Feb 10, 2023
15be763
#convert_pin can return nil for parts not directly using pins
vickash Feb 10, 2023
0bb2c78
Use steps per rev instead of degrees per step to set up RotaryEncoder
vickash Feb 10, 2023
43638fe
Correctly set default steps per rev for rotary encoders
vickash Feb 11, 2023
b690d21
Add BoardEEPROM support for the ESP8266
vickash Feb 11, 2023
11c8e56
Change the default config for the mega168 sketch
vickash Feb 11, 2023
63f0b41
Remove #callbacks= and test callback modification happening in mutex
vickash Feb 11, 2023
7a86b22
Exlude EEPROM and use MSBFIRST/LSBFIRST on the Due so it compiles
vickash Feb 11, 2023
589590e
Update change log with PR message
vickash Feb 11, 2023
ee96dae
Change #update_self to #update_state for more clarity
vickash Feb 11, 2023
b0c98a6
Tests
vickash Feb 12, 2023
4f7ee25
Fix spelling of Fahrenheit in variable names
vickash Feb 12, 2023
fde8ee7
Tests for ShiftIO register interface
vickash Feb 12, 2023
1e442d5
Make tone work with freq/duration above 4 digits, or no duration at all
vickash Feb 12, 2023
8094547
Let DigitalOutput take strings and nil. Let components on ESP8266 hav…
vickash Feb 13, 2023
8693e6a
Tests for BoardEEPROM and RotaryEncoder
vickash Feb 13, 2023
53b9a7d
Let Shift registers set bit order. Default to MSBFIRST for in, LSBFIR…
vickash Feb 13, 2023
5ede312
Change target for Due to 'sam3x' and update changelog
vickash Feb 13, 2023
ceb3399
Tests for SPI input and output registers
vickash Feb 14, 2023
cccb96c
Handshake checks ACK, so it doesn't raise from old data in serial buffer
vickash Feb 14, 2023
2cb6243
Add CLI instructions for vendor libraries
vickash Feb 14, 2023
1f5fbed
Test base classes for I2C bus devices
vickash Feb 14, 2023
212f6a5
Tests for DS3231 real time clock over ITC
vickash Feb 14, 2023
277baa6
Update led example and start numbering examples
vickash Feb 14, 2023
56532b5
Arrange the first 5 examples into a mini tutorial
vickash Feb 14, 2023
62d4e4a
Improve flow control: no timing functions. Notify every half buffer s…
vickash Feb 15, 2023
be19bb3
Update button example
vickash Feb 15, 2023
5c5b4e6
Use a separate thread and buffer to write to the board.
vickash Feb 15, 2023
b928561
Count ticks (and update listeners) more precisely
vickash Feb 17, 2023
cce3a13
Set listener defaults after_initialize instead of in args
vickash Feb 18, 2023
3f9a2f2
Add Potentiometer, with moving average smoothing, and example
vickash Feb 18, 2023
fd95ec7
Output sketch folder instead for use with Arduino CLI
vickash Feb 19, 2023
cd09ce0
Update readme and changelog
vickash Feb 19, 2023
c1fdefa
Fix readme formatting
vickash Feb 19, 2023
169830b
Add board#finish_write for scripts that don't loop
vickash Feb 19, 2023
7d34cb2
Merge branch 'master' into 0.12.0-wip
vickash Feb 20, 2023
60d4834
Merge branch '0.12.0-wip' into easydriver
vickash Feb 20, 2023
4fb6232
Merge pull request #77 from austinbv/easydriver
vickash Feb 20, 2023
3880ca5
Improve the stepper example
vickash Feb 20, 2023
4d61f87
Add wifi library to readme
vickash Feb 20, 2023
c54edfa
Sleep stepper driver after example
vickash Feb 20, 2023
737de0b
Track supported hardware in HARDWARE.md
vickash Feb 20, 2023
2e1737a
Add servo dependency to readme
vickash Feb 21, 2023
3b29dec
Add basic ESP32 support
vickash Feb 21, 2023
abc39e0
Fix WiFi, EEPROM and ADC/DAC reporting for ESP32
vickash Feb 21, 2023
4bfa84f
Make the SPI header API method clearer
vickash Feb 21, 2023
694d061
Cast SPI clock speed to uint32_t properly
vickash Feb 21, 2023
1f464ba
Merge branch '0.12.0-wip' into esp32
vickash Feb 21, 2023
9bc0628
I2C support for ESP32 and fixed stop bit being flipped
vickash Feb 21, 2023
03bc57f
Fix I2C stop bit being flipped
vickash Feb 21, 2023
2f731d8
Add I2C package to ESP32 target
vickash Feb 21, 2023
a0f437b
Manage LEDC channels better on the ESP32
vickash Feb 22, 2023
feebfa8
Servo works on ESP32 by swapping library
vickash Feb 22, 2023
0ffe095
OneWire (bit bang, not RMT) support on ESP32
vickash Feb 22, 2023
867567f
Fix some hardware list errors.
vickash Feb 22, 2023
665a48a
IR out for ESP32. Newest IR library for all platforms
vickash Feb 22, 2023
5ad8619
Update I2C and SPI tests with new defaults
vickash Feb 22, 2023
8b965c7
Update stepper tests
vickash Feb 22, 2023
4113d67
Use #digital_write in LED example so it doesn't PWM if on a capable pin
vickash Feb 22, 2023
c94b093
Add Led/Potentiometer PWM example
vickash Feb 23, 2023
bb0910d
Fix register Shift In for ESP32
vickash Feb 23, 2023
e55cdba
SPI works on ESP32, but needs different mode than AVR ?
vickash Feb 23, 2023
b2a2a26
Change pinMode interface so ESP32 can pull pins up or down
vickash Feb 25, 2023
d24dc67
Merge branch '0.12.0-wip' into esp32
vickash Feb 25, 2023
d6afbbc
Use LEDC channels in reverse order to minimize servo conflict
vickash Feb 25, 2023
6242fce
Correct error if calling A or DAC pin on boards without
vickash Feb 25, 2023
2c49f19
Add ESP32 to changelog and hardware list
vickash Feb 25, 2023
204f6e6
Fix -- instead of - in CLI arguments
vickash Feb 25, 2023
64c537c
The Nano Every ATmega4809 should just work
vickash Feb 25, 2023
2721bed
Tests for remaining mixins
vickash Feb 25, 2023
d3a1630
Input register tests. Fix bug where bit order was reversed, but not b…
vickash Feb 25, 2023
ae56c6c
Make input register bytes to bits conversion clearer
vickash Feb 25, 2023
2bf7443
Tests and fixes for output registers. Default to MSBFIRST
vickash Feb 25, 2023
1d5730f
Switch input register default back to MSBFIRST
vickash Feb 26, 2023
f9282be
Finish OneWire tests
vickash Feb 26, 2023
3bc8be4
Update hook-up diagrams for first 4 examples
vickash Feb 26, 2023
de8b22a
More consistent pin numbers for some examples
vickash Feb 26, 2023
3a3361a
Update readme and hardware.md
vickash Feb 26, 2023
00c4224
Move dependency installation out of readme
vickash Feb 26, 2023
6302f36
New RGBLed example and diagram
vickash Feb 26, 2023
e421bc5
Potentiometer test
vickash Feb 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ spec/reports
test/tmp
test/version_tmp
tmp
*DS_Store*
.ruby-version
.rvmrc
Empty file added .gitmodules
Empty file.
1 change: 0 additions & 1 deletion .rvmrc

This file was deleted.

12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
language: ruby

before_install:
- gem install bundler

rvm:
- 1.9.3
- 1.9.2
script: bundle exec rspec spec
- 2.4.1
- 2.0.0
- jruby-9.1.15.0

script: bundle exec rake test
131 changes: 131 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,136 @@
# Changelog

## 0.12.0

### New Boards
- The `dino sketch` shell command now accepts a `--target` argument. It includes/excludes features to tailor the sketch for different boards/chips. Run `dino targets` for more info.

- ATmega Based Boards (default) (`--target mega`):
- This is the default sketch if `--target` isn't specified, and works for Arduino (and other) products based on the ATmega AVR chips, like the Uno, Nano, Leonardo and Mega.

- ESP8266 (`--target esp8266`):
- Works with either built in WiFi or Serial.
- WiFi version supports OTA (over-the-air) update in the Arduino IDE. Initial flash must still be done via serial.
- Dev boards can map GPIOs to physical pins differently. Always look up the GPIO numbers and use those for pin numbers.
- **Note:** SoftwareSerial and LiquidCrystal (LCD) both do not work on the ESP8266, and are excluded from the sketch.

- ESP32 (`--target esp32`):
- Works with either built in WiFi or Serial.
- WiFi version does NOT support OTA (over-the-air) updates yet.
- Only tested with the original ESP32 module so far, not the later revisions with slightly different hardware.
- Dev boards can map GPIOs to physical pins differently. Always look up the GPIO numbers and use those for pin numbers.
- **Note:** Servos and analog outputs share the `LEDC` channels on the board. Maximum of 16 combined.
- **Note:** SoftwareSerial and LiquidCrystal (LCD) both do not work on the ESP32, and are excluded from the sketch.
- **Note:** SPI bug exists where input modes don't match other platforms. Eg. For a register using mode 0 on AVR, mode 2 needs to be set on ESP32 for it to work. Using mode 0 misses a bit.

- Arduino Due (`--target sam3x`) :
- Up to 12-bit analog in/out. Pass a `bits:` option to `Board#new` to set resolution for both.
- DAC support. Refer to DAC pins as `'DAC0'`, `'DAC1'`, just as labeled on the board. Call `#analog_write` or just `#write` on an `AnalogOutput` component that uses the pin.
- Uses the native ARM serial port by default. Configurable in sketch to use programming port.
- **Note**: SoftwareSerial, Infrared, and Tone are incompatible with the Arduino Due, and excluded from the sketch.

- ATmega168 (`--target mega168`):
- By excluding a lot of features, we can still fit the memory constraints of the ATmega168 chips found in older Arduinos.
- SoftwareSerial, LCD, OneWire and IROut are compatible, but left out to keep memory usage down.
- Included libraries can be toggled in `DinoDefines.h` to suit your needs.
- **Note:** Aux message is limited to 264 bytes on the mega168, or less depending on included libraries. The only feature currently affected by this is sending long infrared signals, like for an air conditioner.

### New Components

- `TxRx::TCP` allows communication with the board over an IP network, instead of serial connection. Tested on Arduino Uno Ethernet Shield (Wiznet W5100), and ESP8266 native WiFi. Should work on Uno WiFi shield, but is **untested**. WiFi must be configured before flashing. Instad of `dino sketch serial`, use `dino sketch wifi`.

- Hitachi HD44780 LCD support. _Uses Arduino `LiquidCrystal` library._

- Seven Segment Display support. _Ruby implementation as multiple LEDs._

- Infrared Emitter support. _Uses [Arduino-IRremote](https://github.com/z3t0/Arduino-IRremote), and the [ESP8266 fork](https://github.com/markszabo/IRremoteESP8266) where applicable._

- Tone (piezo) support. _Uses Arduino `tone`,`noTone` functions._

- SoftwareSerial **(write only)**. _Uses Arduino `SoftSerial` library. Only tested on ATmega chips._

- Potentiometer class, based on AnalogInput, but enables moving average smoothing by default, and adds #on_change callback method.

- Rotary encoder support. _Polls @ 1ms interval._ **WARNING**: Not suitable for high speed or precise position needs. It will definitely miss steps. Sufficient for rotary knobs as user input.

- DHT11 / DHT 21 (AM2301) / DHT22 temperature and relative humidity sensor support. _Custom implementation where input pulses are measured on the board, then decoded in Ruby._

- DS3231 RTC (real time clock) over I2C _(Ruby implementation)_

- DS18B20 temperature sensor. _Uses custom implementation of Dallas/Maxim 1-Wire bus below._

- Dallas/Maxim 1-Wire bus support. _Low level timing functions run on the board. High level logic in Ruby._
- Most bus features are implemented: reset/presence detect, parasite power handling, bus search and slave device identification, CRC. No overdrive support.
- Based on [Kevin Darrah's video](https://www.youtube.com/watch?v=ZKNQhzPwH0s) explaining the DS18B20 datasheet.

- I2C bus support. _Uses Arduino `Wire` library._

- Shift Register support. _Uses Arduino `ShiftOut` and `ShiftIn` functions._

- SPI bus support (_uses Arduino `SPI` library_) :
- Read/Write Transfers
- Read-Only Listeners (like digital/analog listeners, but reads n bytes from MISO)

- Generic input and output register classes for the above 2: `Register::ShiftIn`, `Register::ShiftOut`, `Register::SPIIn`, `Register::SPIOut`.

- Board EEPROM support. _Uses Arduino `EEPROM` library._

### Changed Components
- Servos can now be connected to arbitrary pins as long as they are supported by the board.

- Digital and analog listeners now have dividers on a per-pin basis.
- Timing is based on a 1000 microsecond tick being counted by the board.
- Call `#listen` with a value as the first argument. Eg. `analog_sensor.listen(64)` will tell the board to send us that specific sensor's state every 64 ticks (~64ms) or around 16 times per second, without affecting other components' rates.
- Valid dividers are: `1, 2, 4, 8, 16, 32, 64, 128`.
- Defaults are same as before: `4` for digital, `16` for analog.

### Hardware Abstraction

- `MultiPin` abstraction for components using more than one pin:
- Components connecting to more than 1 pin, like an RGB LED or rotary encoder, are now modeled as `MultiPin` and contain multiple `SinglePin` `proxies`. An `RGBLed` is built from 3 `AnalogOutput`s, for example, one for each color, connected to a separate pin.
- `MultiPin` implements a shortcut class method `proxy_pins`. Proxying a pin allows subcomponent pin numbers to be given as a hash when initializing an instance of a `MultiPin` component. Eg: `{red: 9, green: 10, blue: 11}` given as the `pins:` option for `RGBLed#new`.
- When initialized, subcomponents corresponding to the proxied pins are automatically created. They're stored in `#proxies` and `attr_reader` methods are created for each, corresponding to their key in the `pins:` hash. Eg: `RGBLed#green` and `RGBLed#proxies[:green]` both give the `AnalogOutput` component that represents the green LED inside the RGB LED, connected to pin 10.

- `BoardProxy` abstraction for shift/SPI registers:
- The `Register` classes implement enough of the `Board` interface to satisfy components based on `DigitalInput` and `DigitalOutput`, such as `Led` or `Button`.
- This lets you call methods on components directly, rather than manipulating the register data to control components indirectly.
- Initialize the appropriate `Register` object for the type of register. To initialize a component connected to the register, use the register as the `board:`, and give the parallel I/O pin on the register that the component is connected to. Pin 0 maps to the lowest bit.
- This also works for `MultiPin` components built out of only `DigitalInput` or `DigitalOutput`, eg. `SSD` - seven segment display or `RGBLed`. See `examples/register` for more.

### Input Components, Callbacks and State
- `@value` has been renamed to `@state`.
- By default, all components define `#state` and `#state=`, which access `@state` through `@state_mutex`. This way we don't try to read with `#state` while a callback is updating it with `#state=`.
- `@state` can be any Ruby object representing the state of the component.

- Callback functionality for components has been extracted into a mixin module, `Mixins::Callbacks`.
- Like before, callbacks for all components on a board run sequentially, in a single "update" thread, separate from the main thread. This is the same thread reading from TxRx.
- `#add_callback` and `#remove_callback` methods are available, and take an optional `key` as argument.
- Blocks given to `#add_callback` are stored in `@callbacks[key]`, to be called later, when the "update" thread receives data for the component. The default key is `:persistent`.
- Each key represents an array of callbacks, so multiple callbacks can share the same key.
- Calling `#remove_callbacks` with a key empties that array. Calling with no key removes **all** callbacks for the component.
- `#pre_callback_filter` is defined in the `Callbacks` module. The return value of this method is what is given to the component's callbacks and to update its `@state`. By default, it returns whatever was given from the board.
- Override `#pre_callback_filter` to process data before giving it to callbacks and `@state`. Eg: given raw bytes from a DHT sensor, process them into a hash containing `:celsius`, `: fahrenheit` and `:humidity` values. That hash is given to to callbacks and `#update_state` instead of the original string of raw bytes.
- `#update_state` is defined in the `Callbacks` module. It is called after all callbacks are run and given the return value of `#pre_callback_filter`. By default, it sets `@state=` to the value given.
- Override it if updating `@state` is more complex than this, but be sure to either use `#state=` only once, or wrap the operation in `@state_mutex.synchronize`.

- Input components no longer automatically start listening when created, since there are more options for reading inputs.
- `DigitalInput` and its subclasses are the exception to this. They automatically listen, since there is little advantage to other modes.

- Input components can have any combination of `#read`, `#poll` and `#listen` methods now, coming from `Reader`, `Poller`, and `Listener` respectively, inside `Mixins`.
- `#read` sends a single read command by calling `#_read`, and blocks the main thread, until `data` is received from `#pre_callback_filter`. When received, any block that was given to `#read` will run once as a callback and be removed immediately. `#read` then stops blocking the main thread and returns `data`.
- `#poll` requires an interval (in seconds) as its first argument. It starts a new thread, and keeps calling `#_read` in it, at the given interval. `#poll` does not block the main thread, and does not return a value. A block given will be added as a callback inside the `:poll` key.
- `#listen` adds its block as a callback inside the `:listen` key, calls `#_listen` and returns immediately.
- `#stop` stops polling **and** listening. It also **removes all callbacks** in the **`:poll` and `:listen` keys** (callbacks added as blocks when polling or listening).

### Minor Changes
- Serial communication now uses the [`rubyserial`](https://github.com/hybridgroup/rubyserial) gem instead of [`serialport`](https://github.com/hparra/ruby-serialport).
- Switched from `rspec` to `minitest` for testing.
- Added more useful information and errors during the connect & handshake process.
- Extended message syntax so the Arduino can receive arbitrary length messages, including binary.
- Created `Dino::Message` class to handle message construction.
- Moved CLI into it's own class, `Dino::CLI`.
- Added simple flow control to avoid overrunning the 64 byte input buffer in the Arduino `Serial` library. No flow control for Ruby receiving data.

## 0.11.3
* Backport bug fixes from 0.12:
* Listeners weren't working properly on the Arduino MEGA.
Expand Down
47 changes: 47 additions & 0 deletions DEP_INSTALL_CLI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Install Arduino Dependencies for Dino (CLI)

Once `arduino-cli` is installed, you can copy and paste into your shell for easy installation.

**Install Everything:**
````shell
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install arduino:megaavr
arduino-cli core install esp8266:esp8266
arduino-cli core install esp32:esp32
arduino-cli lib install Servo
arduino-cli lib install LiquidCrystal
arduino-cli lib install WiFi
arduino-cli lib install IRremote@4.0.0
arduino-cli core install esp8266:esp8266
arduino-cli lib install IRremoteESP8266@2.8.4
arduino-cli lib install ESP32Servo
````

**AVR-based Arduinos & Clones Only:**
````shell
arduino-cli core update-index
arduino-cli core install arduino:megaavr
arduino-cli lib install Servo
arduino-cli lib install LiquidCrystal
arduino-cli lib install WiFi
arduino-cli lib install IRremote@4.0.0
````

**ESP8266 Only:**
````shell
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
arduino-cli core update-index
arduino-cli core install esp8266:esp8266
arduino-cli lib install IRremoteESP8266@2.8.4
````

**ESP32 Only:**
````shell
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install esp32:esp32
arduino-cli lib install ESP32Servo
arduino-cli lib install IRremoteESP8266@2.8.4
````
82 changes: 82 additions & 0 deletions DEP_INSTALL_IDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
### Install Arduino Dependencies for Dino (IDE)

### Installing Cores

Some microcontroller platforms require board manager cores that do not come with the IDE. To install a core:
* Open the Preferences window of the IDE, and find "Additional boards manager URLS:". Click the button next to it.
* In the editor that opens, paste the given URL on a new line at the end (if it doesn't already exist).
* Confirm and exit Preferences. Wait for the IDE to finish downloading indexes from the new URL.
* Click on Tools > Board > Board Manager.
* Search for the platform you are installing by name, and click Install, optionally selecting a version.

### Installing Libraries

All platforms will require libraries to be installed. To install a library do the following:
* Click on Tools > Manage Libraries.
* Search for the library you are installing by name, and click Install, optionally selecting a version.

### Platforms:

**Install Everything:**
* Board Manager URLs:
````shell
https://arduino.esp8266.com/stable/package_esp8266com_index.json
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
````
* Boards (latest version unless specified):
````shell
Arduino megaAVR Boards
ESP8266 Boards
ESP32 Boards
````
* Libraries (latest version unless specified):
````shell
Servo by Michael Margolis, Arduino
Liquid Crystal by Arduino, Adafruit
WiFi by Arduino
IRremote @ v4.0.0 by shirriff, z3to, ArminJo
IRremoteESP82666 @ v2.8.4 by David Conran, Sebastien Warin
ESP32Servo by Kevin Harrington, John K. Bennett
````

**AVR-based Arduinos & Clones Only:**
* Boards (latest version unless specified):
````shell
Arduino megaAVR Boards (only for Atmega4809 / Nano Every)
````
* Libraries (latest version unless specified):
````shell
Servo by Michael Margolis, Arduino
Liquid Crystal by Arduino, Adafruit
WiFi by Arduino
IRremote @ v4.0.0 by shirriff, z3to, ArminJoß
````

**ESP8266 Only:**
* Board Manager URLs:
````shell
https://arduino.esp8266.com/stable/package_esp8266com_index.json
````
* Boards (latest version unless specified):
````shell
ESP8266 Boards
````
* Libraries (latest version unless specified):
````shell
IRremoteESP82666 @ v2.8.4 by David Conran, Sebastien Warin
````

**ESP32 Only:**
* Board Manager URLs:
````shell
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
````
* Boards (latest version unless specified):
````shell
ESP32 Boards
````
* Libraries (latest version unless specified):
````shell
IRremoteESP82666 @ v2.8.4 by David Conran, Sebastien Warin
ESP32Servo by Kevin Harrington, John K. Bennett
````
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in dino.gemspec
gemspec

gem 'rspec'
Loading