@Hotaman, there is a purpose for the checks in the regular GPIO wiring functions. Having the fast_pin functions available gives advanced programmers an extra toolset they can use beyond that. The Photon's pin mapping does not lend itself to whole-port operations and digitalWriteFast() uses pinSetFast/PinResetFast to do a single command regardless of the target pin state. It is assumed that pinMode() was used prior to using the fast_pin functions.
I believe you are referring to an Arduino register which is not present in the STM32. Furthermore, the GPIO architecture on the STM32 is different. There are several registers in the STM32 for setting a pin's mode. Can you explain a scenario where fast pinMode() is required?
Has anyone successfully run the plotly library on the Photon, I tried the version from the Web IDE and that hangs the Photon while the version on github.com seems to work but the data doesnāt appear in the plotly gridā¦
Hi, Iām trying to get started with my Dotstar LEDs and my photon but I have no idea what is going wrong. Iām using sn74hct125n for level shifting. I want to use hw-spi but in the linrary git@github.com:technobly/SparkCore-DotStar.git the pin mapping of the sw-spi was brocken so Iāve modified the pin mapping with this:
+#if PLATFORM_ID == 0 // Core
+ #define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
+ #define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
+#elif PLATFORM_ID == 6 // Photon
+ STM32_Pin_Info* PIN_MAP2 = HAL_Pin_Map(); // Pointer required for highest access speed
+ #define pinLO(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRH = PIN_MAP2[_pin].gpio_pin)
+ #define pinHI(_pin) (PIN_MAP2[_pin].gpio_peripheral->BSRRL = PIN_MAP2[_pin].gpio_pin)
+#else
+ #error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core or Photon ***"
+#endif
// fast pin access
-#define pinLO(_pin) (PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin)
-#define pinHI(_pin) (PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin)
now it compiles. But nothing happens. I hope someone can help me.
Ah by the way the way the Dotstar library of the web ide needs an update.
Sorry for being to unclear I#ve modified the Example too. To use the hardware spi Iāve killed all pin settings in the strandtest but with using the define port for using hw spi doesnāt change anything.
After some rebuilds and reflashing the stripe is filling itself up with white color and the speed is something like every second. The filling start at various positions on different starts of the system. This leads me to the thinking it is coupled with clock. Iāve programmed somthing with more speed and colors.
@StuttVoli, I didnāt use any libs with my DotStar setup. i rolled my own code and found some interesting behavior. Iām driving a 1m strip directly off the Particle pin and it works great. You must set every led on the strip or you will get white on the led after the last one you set due to the end frame being all 1ās.
@Hotaman is there a public example of your project? With this perhaps I can fix the library because the community library in the web ide has the map problem too earlier mentioned in this thread for software spi. Thanks
@Dick@boldbigflank Hey folks, Iām also trying to resurrect WarSting on the Photon!
Iām building a āWarBlasterā from a Nintendo Zapper. I got it mostly done during a live workshop session that I havenāt made public, because I ran into some code incompatibilities when trying to flash the old code; once thatās resolved, Iāll do a new VWorkshop to help publicize the Star Wars challenge.
@alexhack The warsting wifiscan library is not necessary any more, check out my pull request which is a start to remove that and use the newer built-in wifi scanning capabilities of the latest firmware.
Iām having trouble using Servo , as done in the reference documentation, on my photon.
In the documentation, the Servo in āServo myservo;ā is blue, like int is when typed, its being recognized as a special thing (Iām quite a beginner, not to familiar with the terminology, and am not sure what else to call the special thing). When I tried using servos like this, and like I have on Arduino previously, and try to verify the code, I get an error saying that the āServo myservo;ā is me trying to define a function, and it canāt happen there.
That is a very very minimal description. If you could elaborate on what your issues are, weād have a better idea what youāre facing or how we could help. Saying: āit doesnāt workā is not that usefulā¦
Just copy past the original error message, that makes more sense to us than a somewhat confusing reworded version of it.
And providing your code (if it's not too long) would help too.
BTW:
That would be a "keyword" or a "reserved word/term" I'd guess.