Search found 14 matches
- Tue Jan 21, 2020 10:42 pm
- Forum: General discussion
- Topic: How to use analogWrite
- Replies: 7
- Views: 11050
How to use analogWrite
Hello! Tell me how to do analogWrite correctly? I use simple code, but it does not work, the LED just turns on and off: const int thisPin = PC13; void setup() { pinMode(thisPin, OUTPUT); } void loop() { for (int brightness = 0; brightness < 65536; brightness++) { analogWrite(thisPin, brightness); de...
- Tue Jan 21, 2020 12:03 pm
- Forum: General discussion
- Topic: SPI remapping
- Replies: 6
- Views: 8400
Re: SPI remapping
Can't get it to work! If I'm flashing a test sketch, then SPI works: #include <SPI.h> #define SPI2_NSS_PIN PA15 //SPI_2 Chip Select pin is PB12. You can change it to the STM32 pin you want. // mosi, miso, sclk, ssel SPIClass SPI_2(PB5, PB4, PB3, SPI2_NSS_PIN); //Create an instance of the SPI Class c...
- Tue Jan 21, 2020 8:39 am
- Forum: General discussion
- Topic: SPI remapping
- Replies: 6
- Views: 8400
Re: SPI remapping
All figured out. It was only necessary to update the library. In the new version of the library, you can specify pins SPI:
Code: Select all
SPIClass SPI_3(PB5, PB4, PB3, PA15);
- Mon Jan 20, 2020 10:55 am
- Forum: General discussion
- Topic: SPI remapping
- Replies: 6
- Views: 8400
SPI remapping
Hello! I want to connect nrf24l01 to stm32f103c8t6. It is standardly connected to pins PA5 (SCK1), PA6 (MOSO1), PA7 (MOSI1). I have these pins busy, I already ordered a printed circuit board, so I won’t be able to use them. SPI2 pins are also busy. At the same time, there is another SPI port on stm3...