Javascript

Merry Christmas!

The PCBs came in today, they look great.  Of course I will need to make the modifications I mentioned last week.  I haven’t received the CH340G chips yet. I will wait until I receive them before I start building.

Rev00BPCBs

This week, I wanted to add  a slider to set the Sigma Delta output that drives the voltage booster to the web interface.  I didn’t know javascript at all so, I went to an online tutorial at Codecademy.com. This tutorial is very basic and even explains the basic concepts of programming in general.  I didn’t learn enough to set up a slider, I did learn enough to do some testing.

I quickly got the Sigma Delta output working in GPIO12 by copying the necessary code from the test project I was using. I then added a call to config_sigma_delta() from user_init() in user_main.c.  I also added a call to set_sigma_delta_duty() from my test code in cgi_relay.c.  Of course I added includes to sigma_delta.h in both of those files.  I then changed the Sigma Delta output from GPIO12 to GPIO4 to match the HV_pulse line used to run the switched coil.

Now if I hit the say Hello button, It changes the Sigma Delta output duty cycle. also, the Chart on the index.html page gives the current reading from the ADC once every 5 seconds.

ADCandSDelta

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.