Skip to content
Snippets Groups Projects
Commit 05d4bd2f authored by paulscalise1's avatar paulscalise1
Browse files

updated code and added slower program speed

parent 643276f2
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@
"svdFile": "CMSIS/Device/PY32F0xx/py32f030axx.svd",
"preLaunchTask": "Build",
"showDevDebugOutput":"raw",
"serverArgs": ["-speed", "1000"]
}
]
}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Subproject commit 666a040a623e1dd84af2cf40dc88524060e80a30
Subproject commit 602370646d9a413f41de97b1d8858297a89ddb1c
//#include <stdint.h>
#include <stdint.h>
uint8_t set_display[] = {0x00, 0xAE}; //set (SSD1306_DISPLAY_OFF)
uint8_t set_col_addr[] = {0x00, 0x21, 0x00, 0x7F};
......
......@@ -234,6 +234,31 @@ void EXTI4_15_IRQHandler(void)
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5);
}
void Display_UNL_Info(){
displayArray(flag, 2, 20, 0, 70);
displayArray(pointers, 2, 8, 1, 35);
ssd1306_bitmap((const uint8_t *)dept);
HAL_Delay(3000);
displayArray(flag, 2, 20, 0, 70);
displayArray(pointers, 2, 8, 1, 35);
ssd1306_bitmap((const uint8_t *)dept);
HAL_Delay(3000);
}
void Display_On(){
uint8_t on[2] = {0x00, 0xAF};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, on, 2, 5000);
}
void Sleep(){
uint8_t try1[2] = {0x00, 0xAE};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, try1, 2, 5000);
HAL_SuspendTick();
/* Enter STOP mode */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
HAL_ResumeTick();
}
int main (void)
{
//test = 0xfe;
......@@ -246,23 +271,14 @@ int main (void)
LED_Init();
ssd1306_init();
ssd1306_clear();
uint8_t try[2] = {0x00, 0xA4};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, try, 2, 5000);
uint8_t off[2] = {0x00, 0xA4};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, off, 2, 5000);
while (1) {
uint8_t try1[2] = {0x00, 0xAE};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, try1, 2, 5000);
HAL_SuspendTick();
/* Enter STOP mode */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
HAL_ResumeTick();
uint8_t try2[2] = {0x00, 0xAF};
HAL_I2C_Master_Transmit(&hi2c1, SSD1306_ADDR, try2, 2, 5000);
displayArray(flag, 2, 20, 0, 70);
displayArray(pointers, 2, 8, 1, 35);
Display_On();
Display_UNL_Info();
// Add more frames here
ssd1306_bitmap((const uint8_t *)dept);
HAL_Delay(3000);
Sleep();
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment