Mar 17, 2023
11:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 17, 2023
11:22 PM
Hello! , I used arduino to try to set the value of Select Power Mode Profile setting, using I2c.write(0x20, 0x00, 0x01); Successful, but all the settings are restored after the power is cut off, can I not permanently write the configuration settings of the MA12070?
1.Both AD0 and AD1 are grounded
2.code
#include <I2C.h>
byte red = 0;
const byte LED = 13; // LED pin number
const byte BUTTON = 2; // BUTTON pin number
volatile int state = LOW;
int arr[7];
int i = 0;
byte *b;
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT); // so we can update the LED
digitalWrite(BUTTON, HIGH); // internal pull-up resistor
I2c.begin();
I2c.write(0x20, 0x00, 0x01); //
// I2c.write(0x20, 0x27, 0x03); //
// I2c.end();
// I2c.begin();
digitalWrite(LED, 0);
// I2c.timeOut(500);
// I2c.pullup(true);
Serial.begin(9600);
Serial.println("open");
// I2c.setSpeed(true);
// I2c.end();
}
void loop() {
// put your main code here, to run repeatedly:
//
red = I2c.read(0x20, 0x7C, 0x00);
// I2c.timeOut(5000);
byte v=I2c.receive();
Serial.print(v,HEX);
Serial.print('=');
Serial.print(v,BIN);
Serial.print(' ');
if (i >= 15) {
Serial.println();
i = 0;
}
i++;
delay(500);
}
Solved! Go to Solution.
1 Solution
Mar 22, 2023
04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 22, 2023
04:00 AM
你说的内容我也知道,对我来说不是答案。
3 Replies
Mar 19, 2023
07:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 19, 2023
07:05 PM
Hi @Happy
Registers are generally volatile, Therefore, every time power on, need to rewrite the register.
Mar 22, 2023
04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 22, 2023
04:00 AM
你说的内容我也知道,对我来说不是答案。
Mar 22, 2023
06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 22, 2023
06:54 PM
寄存器的值,每次上电都会恢复默认值,必须重新写入,没有其他办法。
This widget could not be displayed.
This widget could not be displayed.