Led_status &= word(B00000111,B11111111) // clearing the bits that we want to change whilst preserving the other unchanged bits Led_status |= ~word(B11110000,B00000000) // setting up the bits that we want to change Led_status &= word(B00001111,B11111111) // clearing the bits that we want to change whilst preserving the other unchanged bits Led_status |= ~word(B11100000,B00000000) // setting up the bits that we want to change Led_status &= word(B00011111,B11111111) // clearing the bits that we want to change whilst preserving the other unchanged bits Led_status |= ~word(B11000000,B00000000) // setting up the bits that we want to change Led_status &= word(B00111111,B11111111) // clearing the bits that we want to change whilst preserving the other unchanged bits Int battery_percentage = voltage_amplifier*100/bit_max led_battery() led doesn't update if used here INTERRUPT MODE - INSERT INBETWEEN portENTER and portEXIT PortMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED // used to sync main loop and ISR Hw_timer_t * timer = NULL //configure the timer, need pointer to a variable type of hw_timer_t for Zero, output on USB Serial console, remove line below if using programming port to program the Zero! The way I go around it is that I set a flag in interrupt mode to show that I want to deepsleep and then execute it in the void loop() function.ĭoes anyone have any solution on how to make this work? (code is just for i2c and esp32) #include Same with deepsleep, I can't execute it in the interrupt mode. It's working fine for i2c (such as turning on LED) when I run it in the void loop() function, but when I port it to interrupt it doesn't work. I am using this library coding it in Arduino IDE : I am having problem of executing deepsleep and i2c communication in the ISR(Interrupt Mode).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |