This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AC RMS Voltage Sensor Using STM32F103C8 and ZMPT101B

Hello all! this is a working (below at the end), code for using ZMPT to measure Ac mains 250VAC, The code is a working code and it is fairly accurate but my problem is that I have been trying quite for some time now to translate it to STM32 Keil uVision but I can't seem to do it. I want to start My ADC learning base on this. Please can someone here help me out to port this code to Keil uVision, I want the  RMS to display on serial monitor via UART1 TX_Only.

Sorry! In case you have viewed this code few minutes ago, I posted a wrong code but a have corrected it now.

ouble sensorValue1 = 0; double sensorValue2 = 0; int val[100]; int max_v = 0; double VmaxD = 0; double VeffD = 0; double RMS = 0; void setup() {  Serial.begin(9600); } void loop() {  for ( int i = 0; i 511) {  val[i] = sensorValue1;...Code I am learning STM32 with Keil but I am bewildered in some translations from my little knowlade
0