Commit Graph

1021 Commits

Author SHA1 Message Date
Jakub Valtar
404990f29f Fix Net library buffer sizes
Because I don't know how to count...
2018-02-02 17:14:56 +01:00
Jakub Valtar
d887779eb6 Net-client: perf tuning - make read buf the size of socket receive buf 2018-01-22 20:28:09 +01:00
Jakub Valtar
fe465fe4de Net-client: remove unneeded synchronization block 2018-01-22 19:50:48 +01:00
Jakub Valtar
bb6c9a568a Net-server: remove suspicious sleep 2018-01-22 19:50:06 +01:00
Jakub Valtar
f6b08df336 Net-server: call clientEvent() of the sketch when received data from a client 2018-01-22 19:34:21 +01:00
Jakub Valtar
2b1cd66f83 Net: unwrap the exception if it came from the user code 2018-01-22 13:44:43 +01:00
Jakub Valtar
0d12c46825 Net-server: remove extra array creation 2018-01-21 22:32:16 +01:00
Jakub Valtar
b692215775 Net-server: properly synchronize clients array 2018-01-21 22:30:46 +01:00
Jakub Valtar
f76d3c4f80 Net-client: remove extra catch block
Handled by IOException block (it's a superclass of ConnectException and does the same thing).
2018-01-21 22:30:46 +01:00
Jakub Valtar
0e12d1175e Net-client: remove unnecessary array creation 2018-01-21 22:30:45 +01:00
Jakub Valtar
aba056cf96 Net-client: set max buffer size 2018-01-21 22:30:36 +01:00
Jakub Valtar
e7f6e1b5b0 Net-client: read bytes to a read buffer instead of one by one 2018-01-21 22:28:01 +01:00
Jakub Valtar
e64a283a00 Net-client: compact the buffer if possible instead of resizing 2018-01-21 17:03:55 +01:00
Jakub Valtar
f140299e48 Net-client: synchronize access to all concurrently modified fields 2018-01-21 16:42:45 +01:00
Jakub Valtar
05a2819a58 Net-client: use final field for lock 2018-01-21 16:40:47 +01:00
Rodrigo Bonifacio
325070d711 Refactoring towards Java language evolution.
- use the diamond operator in a few places
- use of multi-catch in a few places
2017-06-15 11:48:49 -03:00
gohai
8a055dddac IO: Remove unused internal method 2017-04-30 20:43:50 +02:00
gohai
b204f0d498 IO: Remove duplicate argument listing in Reference 2017-04-30 20:42:58 +02:00
gohai
00d3c11032 IO: Fix waitFor(pin, mode) 2017-04-30 20:41:14 +02:00
gohai
5ff162e20a IO: Invert OLED example
This makes bright pixels be illuminated on the display.
2017-04-05 14:52:22 +02:00
gohai
1df221200b IO: Update I2CScreen example
Hardcode i2c interface, add background, fix indentation
2017-04-03 18:18:46 +02:00
gohai
fb4b054bbe IO: Compile native code with -ffast-math 2017-03-13 20:31:57 +01:00
gohai
7c49c34cce IO: Fix SPI.close() 2017-02-26 16:40:27 +01:00
gohai
9025ecee4e IO: Remove superfluous super in examples 2017-02-26 15:26:32 +01:00
gohai
82e0c8764d IO: Make waitFor throw an exception in case of a timeout
Previously, it returned a boolean indicating success. But the code on the caller-side will be nicer to read with exceptions.
2017-02-26 15:26:32 +01:00
gohai
ad6986caef IO: Introduce a variant of waitFor that doesn't take a timeout
This simplifies the semantic of the variant with three arguments, since we now don't have the "-1 means wait forever" case any longer.
2017-02-26 15:26:25 +01:00
gohai
5b4be31a28 IO: Remove the RPI (Raspberry Pi) class
This provided constants that translated from the physical header pin numbers to GPIO lines. Instead, we (and the majority of other Pi related documentation out there) now just use GPIO numbers exclusively.

The class hasn't been used in examples since a few versions, and also wasn't ever properly documented in the reference, so unlikely that many people will notice.
2017-02-22 16:54:03 +01:00
gohai
45fe7a8d73 IO: Rename the (publicly listed) waitForInterrupt function to waitFor
This function is used like this:
GPIO.waitFor(pin number, rising/falling/change, timeout or -1)

While it's using an interrupt internally, in the way it is used it doesn't relate to the interrupt functions (attachInterrupt, etc) at all. To prevent confusion, rename it to waitFor. (Another possible name would be waitForPin.)
2017-02-22 16:46:56 +01:00
gohai
76043ac0dc IO: Tweaks to SoftwareServo JavaDoc 2016-08-28 17:50:40 +02:00
gohai
ad28491c25 IO: Add PHONY target to Makefile 2016-08-28 17:50:40 +02:00
Ben Fry
2c0c1b9a36 bring back getImage() to fix #4473 2016-08-12 21:34:50 -04:00
gohai
6bea3ee5c1 IO: Fix compilation on arm
Error introduced in previous commit.
2016-07-15 17:30:18 +02:00
gohai
dbdeb9cf66 IO: We want motors, they said (implements SoftwareServo)
Some measurements with a logic analyzer and the Raspberry Pi 2
sleep: 0.001500, measured avg: 0.0015357, measured 0.95 perc.: 0.0015573
sleep: 0.0185, measured avg: 0.0186177, measured 0.95 perc.: 0.0186345

servo_pulse_oversleep was set to account for the (expected) overhead of waking up and toggling the pin with help from the numbers above.
2016-06-23 19:52:14 +02:00
George Bateman
5767b086f6 Fix most Javadoc errors, except syntax 2016-05-10 19:13:20 +01:00
Ben Fry
822089487b Merge pull request #4321 from kfeuz/serial_readbytes
Added readBytes(max) to serial library
2016-05-08 15:06:09 -04:00
Ben Fry
971d741111 Merge pull request #4320 from kfeuz/network_readbytes
Added readBytes(max) to net library
2016-05-08 15:05:59 -04:00
Ben Fry
db85400515 Merge pull request #4384 from gohai/arm-next
Add a few IO library examples
2016-05-06 20:03:11 -04:00
gohai
fe2082dcce IO: Simulate on all unsupported platforms
Instead of throwing an exception early on, this makes it possible to test all other parts of sketches that make light use of the IO library. A warning is printed once after startup for those environments.

This was tested on OS X against all examples that come with the IO library. Note: x86 and x64 are technically supported platforms. If a user on those prefers to use simulation instead, it is necessary to call NativeInterface.alwaysSimulate() before any other IO library function.
2016-05-05 19:33:37 +02:00
gohai
ef1490566b IO: Fix LedCounter example 2016-05-05 19:27:19 +02:00
gohai
f1077d0a86 IO: Prepare for standalone distribution in Contribution Manager 2016-05-02 18:28:20 +02:00
gohai
0d9d2d22d5 IO: Add an example that shows how to use a digital pin and a capacitor to measure resistive sensors 2016-04-04 21:01:20 +02:00
gohai
29f797bb79 IO: Add an 8-channel ADC example using the MCP3008 2016-04-03 17:37:49 +02:00
gohai
50be2983e2 IO: Add an OLED display example 2016-04-03 17:37:49 +02:00
gohai
f74c4e7a28 IO: Add a byte-variant of I2C.write and SPI.write 2016-04-03 17:37:46 +02:00
Jakub Valtar
dd8698427c Update app to Java 8 2016-04-02 23:17:25 +02:00
kfeuz
44785f6bd9 Added readBytes(max) to net library 2016-02-18 22:24:44 -07:00
kfeuz
bad395b08d Added readBytes(max) to serial library 2016-02-18 22:21:04 -07:00
gohai
102f55b29d IO: Add comments pointing to wiring diagrams 2016-02-14 11:37:30 +01:00
gohai
c30aa85ab9 IO: Use GPIO numbers in examples
Even the Raspberry Pi Foundation used GPIO numbers over (congruous) physical pin numbers:
https://www.raspberrypi.org/learning/introduction-to-processing/worksheet-2/

Switch our examples as well, so that it they're more clear and hardware-agnostic.
2016-02-14 01:07:37 +01:00
Ben Fry
8185c6fbde Merge pull request #4015 from gohai/serial-fixes
Serial fixes
2015-10-20 09:19:33 -04:00