Hi.
I want to output numbers to tm1637 display with nrf52832.
The existing library is dedicated to Arudino, so we will contact you to change it for nRF52.
(Existing library: github.com/.../DigitalTube)
Most of the code above uses pinMode, digitalWrite, and digitalRead to output to the screen. (Using CLK and DIO pins)
So I created a function to use for nRF52 as follows.
#ifndef INPUT
#define INPUT 0x00
#endif
#ifndef OUTPUT
#define OUTPUT 0x01
#endif
#ifndef INPUT_PULLUP
#define INPUT_PULLUP 0x02
#endif
#ifndef HIGH
#define HIGH 0x01
#endif
#ifndef LOW
#define LOW 0x00
#endif
void pinMode (
uint32_t pin, uint8_t mode)
{
if (mode == OUTPUT)
{
nrf_gpio_cfg_output (pin);
}
else if (mode == INPUT)
{
nrf_gpio_cfg_input (pin, GPIO_PIN_CNF_PULL_Pulldown);
}
else if (mode == INPUT_PULLUP)
{
nrf_gpio_cfg_input (pin, GPIO_PIN_CNF_PULL_Pullup);
}
}
void
digitalWrite (
uint32_t pin, uint32_t value)
{
nrf_gpio_pin_write (pin, value);
}
uint32_t
digitalRead (
uint32_t pin)
{
return nrf_gpio_pin_read (pin);
}
Then, change all of the parts corresponding to the above existing source to the following contents, and execute
There were some letters that came out normally, but most of the letters were not printed properly.
Is there a problem with the above function? If you need to change it, please let us know the change.
Currently, clk (P0_08), dio (P0_07) are used.
Thank you.