abdf6f8c6b
Now the necessary settings are in adc.h. Refactored to allow repeated ADC reads without reinitialization. Arduino allows setting analogReference, this is now also implemented. ADC is now initialized to sane values in apps/arduino/arduino-process.c dev/arduino/arduino-compat.h now has all hardware independent settings for arduino (some moved from platform/osd-merkur/dev/hw-arduino.h). turnOffPWM re-implemented with hw_timer, removed from wiring_digital.c ADC-specific arduino stuff moved to arduino-compat.h Arduinos wiring_analog no longer necessary. arduino-sketch example now reads analog inputs 1 and 5 using analogRead. |
||
---|---|---|
.. | ||
arduino-example.c | ||
flash.sh | ||
led_pwm.h | ||
Makefile | ||
project-conf.h | ||
README.md | ||
resource_led_pwm.c | ||
run.sh | ||
sketch.pde |
Arduino compatibility example
This example shows that it is now possible to re-use arduino sketches in
Contiki. This example documents the necessary magic. Arduino specifies
two routines, setup
and loop
. Before setup
is called, the
framework initializes hardware. In original Arduino, all this is done in
a main
function (in C). For contiki we define a process that does the
same.
See the documentation file in apps/contiki-compat/README.md