In my case we have to put the void setup() and the void loop() at the end of my code. Otherwise it stops compiling and telling you that functions are not declared. But that´s so easy. Hope in a future package and with the final release of the local suda put´s the OTA feature to the package!
Think that is what ya need.
You can try to install ATOM IDE via Chocolatey and then try to use the package from suda. I did not know if that works. But give it a try!
I tried this in OSX and it worked the first time, I was able to upload the Blink sketch to the Spark no problem.
However when i try to load anything now it does nothing but gives this message -
Building core-common-lib
make[1]: Nothing to be done for 'all'.
Building core-communication-lib
make[1]: Nothing to be done for 'all'.
Any idea why? It does show the picture to press the core buttons but does nothing after that. Core just keeps flashing yellow.
I closed it completely.
So just to check that I am not doing something silly -
I open Atom.
Click VIEW - Developer - Open in Dev Mode - choose Blink.ino
Click Packages - Spark Core - Build/Verify
I get Build Failed Many errors including -
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h:54:72 warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (((uint32_t)_address)) == (((uint32_t)addr._address)); };
As I said, it worked the first time and I uploaded this sketch to the Core.
Confusing
// Define the pins we're going to call pinMode on
int led = D0; // You'll need to wire an LED to this one to see it blink.
// Define the pins we're going to call pinMode on
int led = D0; // You'll need to wire an LED to this one to see it blink.
int led2 = D7; // This one is the built-in tiny one to the right of the USB jack
// This routine runs only once upon reset
void setup() {
// Initialize D0 + D7 pin as output
// It's important you do this here, inside the setup() function rather than outside it or in the loop function.
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
}
// This routine gets called repeatedly, like once every 5-15 milliseconds.
// Spark firmware interleaves background CPU activity associated with WiFi + Cloud activity with your code.
// Make sure none of your code delays or blocks for too long (like more than 5 seconds), or weird things can happen.
void loop() {
digitalWrite(led, HIGH); // Turn ON the LED pins
digitalWrite(led2, HIGH);
delay(1000); // Wait for 1000mS = 1 second
digitalWrite(led, LOW); // Turn OFF the LED pins
digitalWrite(led2, LOW);
delay(1000); // Wait for 1 second in off mode
}
eBuilding core-common-libe
make[1]: Nothing to be done for `all'.
eBuilding core-communication-libe
make[1]: Nothing to be done for `all'.
eBuilding project file: /Users/macowner/Dropbox/blink.inoe
eInvoking: ARM GCC CPP Compilere
mkdir -p obj/
arm-none-eabi-gcc -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/libraries//Serial2 -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/CMSIS/Include -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/CMSIS/Device/ST/STM32F10x/Include -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/STM32F10x_StdPeriph_Driver/inc -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/STM32_USB-FS-Device_Driver/inc -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/CC3000_Host_Driver -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-common-lib/SPARK_Firmware_Driver/inc -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-communication-lib/lib/tropicssl/include -I/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/../core-communication-lib/src -I. -I/Users/macowner/Dropbox -ffunction-sections -Wall -fmessage-length=0 -MD -MP -MF obj/blink.o.d -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -DDFU_BUILD_ENABLE -DSPARK=1 -DRELEASE_BUILD -include /Users/macowner/.atom/packages/atom-spark-core/src/arduino/inc/binary.h -fno-exceptions -fno-rtti -x c++ -c -include /Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/application.h -o obj/blink.o /Users/macowner/Dropbox/blink.ino
In file included from /Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring.h:37:0,
from /Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/application.h:29,
from :0:
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h:53:52 warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h:54:72 warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
/Users/macowner/.atom/packages/atom-spark-core/src/core-firmware/inc/spark_wiring_ipaddress.h:54:105 warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
I guess @suda is going to face sooner or later the same issues I’ve experienced with the Spark Core framework when I tried to add support for the board to embedXcode.
Update did not work for me. Seems to take ages. So I cleaned the /Users /myuser/.atom/packages/atom-spark-core and download a fresh copy from your GIT Repository: https://github.com/suda/atom-spark-core
Unziped it and copied the atom-spark-core-master to the same place as it was before. Then I opend up ATOM and voila there we go!