Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************************
- * TITLE : Read ADC from Knob and Show Bargraph
- * CATAGORIES : IPST/GLCD
- * CREATED DATE : SEPTEMBER 13, 2017
- * AUTHOR : KRITSADA JAIYEN
- * WEBSITE : HTTP://WWW.INEX.CO.TH
- * MCU : IPST-SE
- * Thai DESCRIPTION : อ่านค่าจากการหมุนตัวต้านทานปรับค่าได้
- * ในช่วง 0-128 นำค่าแสดงผลที่หน้าจอ
- * นำผลที่ได้แสดงเป็นกราฟแท่งด้วย
- ******************************************************/
- #include <ipst.h> // include file for IPST-SE
- int x;
- void setup(){
- setTextSize(3);
- }
- void loop(){
- glcd(1,0,"%d ",knob(128));
- glcdFillRect(0,80,knob(128),10,GLCD_RED);
- glcdFillRect(knob(128),80,128-knob(128),10,GLCD_BLACK);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement