Can't flash Phobot/Webrover code to Photon from book Make Getting Started with the Photon

I’m going through the Robotics chapter of the O’Reilly book “Make: Getting Started with the Photon” by Simon Monk, and I’ve gotten to the stage of creating a new app on the site, called Webrover.ino, and adding the various libraries to that app. It verifies correctly, but when I attempt to upload it to my Photon, I get the error message found below.

Steps to repro, as directed in the book, starting on page 147:

  1. The closest library I could find to what the book directed me to find was PHOBOT_SPARKCORE v 0.0.1, so that’s what I used. I found it by typing PHOBOT into the search field below Community Libraries in the Web IDE. “When you do this, you will see the library files. Select the file WEBROVER.CPP and then click the USE THIS EXAMPLE button.” So I did that, and I’m now looking at a new app in my account called WEBROVER.INO.

  2. “Before the WEBROVER example can be flashed onto a Photon or Core, you will need to find a couple of libraries that are used by the PHOBOT library and also the HC_SR04 library needed for the rangefinder.” I added HC_SR04 by searching for it in the Community libraries area and then clicked INCLUDE IN APP button. When the Web IDE prompted me with “Which app,” I selected WEBROVER from the list and clicked the ADD TO THIS APP button.

  3. According to the book, which reads “if you are using a Spark Core rather than a Photon, you will also need to import the SPARKINTERVALTIMER and SOFTPWM libraries,” I should be ready to flash. Actually, it appears you need these libraries even for the using the Photon. So, I followed the same process to import and INCLUDE IN APP the SPARKINTERVALTIMER and SOFTPWM libraries.

  4. At this stage I’m ready to verify. I clicked the verify button and got the message, “Code verified! Great work.”

  5. Finally, I click the flash button, and get the following error:

What I wanted:

A successful upload message.

What I actually got, was this error message:

/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaHC_SR04/HC_SR04.cpp: In member function 'void HC_SR04::waitForEcho(int, int, long int)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaHC_SR04/HC_SR04.cpp:50:52: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while (digitalRead(pin) != value && millis() < giveupTime) {}
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaSoftPWM/SoftPWM.cpp: In function 'void SoftPWM_Timer_Interrupt()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaSoftPWM/SoftPWM.cpp:132:5: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_softpwm_channels[i].pin].gpio_peripheral->BSRR = PIN_MAP[_softpwm_channels[i].pin].gpio_pin; //hi
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaSoftPWM/SoftPWM.cpp:138:5: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_softpwm_channels[i].pin].gpio_peripheral->BRR = PIN_MAP[_softpwm_channels[i].pin].gpio_pin; //lo
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaSoftPWM/SoftPWM.cpp:156:5: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_softpwm_channels[i].pin].gpio_peripheral->BRR = PIN_MAP[_softpwm_channels[i].pin].gpio_pin; //lo
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaSoftPWM/SoftPWM.cpp:162:5: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_softpwm_channels[i].pin].gpio_peripheral->BSRR = PIN_MAP[_softpwm_channels[i].pin].gpio_pin; //hi
^
make[1]: *** [../build/target/user/platform-6SoftPWM/SoftPWM.o] Error 1
make: *** [user] Error 2

Flash unsuccessful.

Any ideas on what I can change in the app’s code to fix it?

/mz

Some libraries still have to be ported to the photon. Moreover, there is still active development going on to make it easier to port said libraries over. That unfortunately means some of them aren’t yet compatible. @peekay123 is working hard on the intervalTimer library, and should be able to tell you more about what remains to be done.

@Moors7 @peekay123 have there been any further developments to resolve this issue?