{"id":207,"date":"2015-08-10T23:14:51","date_gmt":"2015-08-10T23:14:51","guid":{"rendered":"http:\/\/rogerbit.com\/wprb\/?p=207"},"modified":"2015-08-11T15:53:42","modified_gmt":"2015-08-11T15:53:42","slug":"midiendo-resistores-con-arduino-uno-y-display-nokia-5110","status":"publish","type":"post","link":"https:\/\/rogerbit.com\/wprb\/2015\/08\/midiendo-resistores-con-arduino-uno-y-display-nokia-5110\/","title":{"rendered":"Midiendo resistores con arduino uno y display nokia 5110"},"content":{"rendered":"<p><iframe loading=\"lazy\" width=\"1160\" height=\"653\" src=\"https:\/\/www.youtube.com\/embed\/EE_6cPxvG98?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>C\u00f3digo Fuente<\/p>\n<p>\/\/ M\u00c1S INFOMARCI\u00d3N EN:<br \/>\n\/\/ EN MI P\u00c1GINA http:\/\/www.rogerbit.com\/ REGISTRATE TE ESPERAMOS<br \/>\n\/\/ CANAL DE YOUTUBE https:\/\/www.youtube.com\/c\/Carlosvolt SUSCRIBETE A MI CANAL Y REGALAME UN ME GUSTA<br \/>\n\/\/ SEGUIME EN FACEBOOK https:\/\/www.facebook.com\/groups\/407445649459365 \u00daNETE AL GRUPO<br \/>\n\/\/ EN TWITTER https:\/\/twitter.com\/rogerbit_<br \/>\n#define PIN_SCE 7<br \/>\n#define PIN_RESET 6<br \/>\n#define PIN_DC 5<br \/>\n#define PIN_SDIN 4<br \/>\n#define PIN_SCLK 3<\/p>\n<p>#define LCD_C LOW<br \/>\n#define LCD_D HIGH<\/p>\n<p>#define LCD_X 84<br \/>\n#define LCD_Y 48<br \/>\n#include&lt;stdlib.h&gt;<br \/>\nstatic const byte ASCII[][5] =<br \/>\n{<br \/>\n{0x00, 0x00, 0x00, 0x00, 0x00} \/\/ 20<br \/>\n,{0x00, 0x00, 0x5f, 0x00, 0x00} \/\/ 21 !<br \/>\n,{0x00, 0x07, 0x00, 0x07, 0x00} \/\/ 22 &#8221;<br \/>\n,{0x14, 0x7f, 0x14, 0x7f, 0x14} \/\/ 23 #<br \/>\n,{0x24, 0x2a, 0x7f, 0x2a, 0x12} \/\/ 24 $<br \/>\n,{0x23, 0x13, 0x08, 0x64, 0x62} \/\/ 25 %<br \/>\n,{0x36, 0x49, 0x55, 0x22, 0x50} \/\/ 26 &amp;<br \/>\n,{0x00, 0x05, 0x03, 0x00, 0x00} \/\/ 27 &#8216;<br \/>\n,{0x00, 0x1c, 0x22, 0x41, 0x00} \/\/ 28 (<br \/>\n,{0x00, 0x41, 0x22, 0x1c, 0x00} \/\/ 29 )<br \/>\n,{0x14, 0x08, 0x3e, 0x08, 0x14} \/\/ 2a *<br \/>\n,{0x08, 0x08, 0x3e, 0x08, 0x08} \/\/ 2b +<br \/>\n,{0x00, 0x50, 0x30, 0x00, 0x00} \/\/ 2c ,<br \/>\n,{0x08, 0x08, 0x08, 0x08, 0x08} \/\/ 2d &#8211;<br \/>\n,{0x00, 0x60, 0x60, 0x00, 0x00} \/\/ 2e .<br \/>\n,{0x20, 0x10, 0x08, 0x04, 0x02} \/\/ 2f \/<br \/>\n,{0x3e, 0x51, 0x49, 0x45, 0x3e} \/\/ 30 0<br \/>\n,{0x00, 0x42, 0x7f, 0x40, 0x00} \/\/ 31 1<br \/>\n,{0x42, 0x61, 0x51, 0x49, 0x46} \/\/ 32 2<br \/>\n,{0x21, 0x41, 0x45, 0x4b, 0x31} \/\/ 33 3<br \/>\n,{0x18, 0x14, 0x12, 0x7f, 0x10} \/\/ 34 4<br \/>\n,{0x27, 0x45, 0x45, 0x45, 0x39} \/\/ 35 5<br \/>\n,{0x3c, 0x4a, 0x49, 0x49, 0x30} \/\/ 36 6<br \/>\n,{0x01, 0x71, 0x09, 0x05, 0x03} \/\/ 37 7<br \/>\n,{0x36, 0x49, 0x49, 0x49, 0x36} \/\/ 38 8<br \/>\n,{0x06, 0x49, 0x49, 0x29, 0x1e} \/\/ 39 9<br \/>\n,{0x00, 0x36, 0x36, 0x00, 0x00} \/\/ 3a :<br \/>\n,{0x00, 0x56, 0x36, 0x00, 0x00} \/\/ 3b ;<br \/>\n,{0x08, 0x14, 0x22, 0x41, 0x00} \/\/ 3c &lt;<br \/>\n,{0x14, 0x14, 0x14, 0x14, 0x14} \/\/ 3d =<br \/>\n,{0x00, 0x41, 0x22, 0x14, 0x08} \/\/ 3e &gt;<br \/>\n,{0x02, 0x01, 0x51, 0x09, 0x06} \/\/ 3f ?<br \/>\n,{0x32, 0x49, 0x79, 0x41, 0x3e} \/\/ 40 @<br \/>\n,{0x7e, 0x11, 0x11, 0x11, 0x7e} \/\/ 41 A<br \/>\n,{0x7f, 0x49, 0x49, 0x49, 0x36} \/\/ 42 B<br \/>\n,{0x3e, 0x41, 0x41, 0x41, 0x22} \/\/ 43 C<br \/>\n,{0x7f, 0x41, 0x41, 0x22, 0x1c} \/\/ 44 D<br \/>\n,{0x7f, 0x49, 0x49, 0x49, 0x41} \/\/ 45 E<br \/>\n,{0x7f, 0x09, 0x09, 0x09, 0x01} \/\/ 46 F<br \/>\n,{0x3e, 0x41, 0x49, 0x49, 0x7a} \/\/ 47 G<br \/>\n,{0x7f, 0x08, 0x08, 0x08, 0x7f} \/\/ 48 H<br \/>\n,{0x00, 0x41, 0x7f, 0x41, 0x00} \/\/ 49 I<br \/>\n,{0x20, 0x40, 0x41, 0x3f, 0x01} \/\/ 4a J<br \/>\n,{0x7f, 0x08, 0x14, 0x22, 0x41} \/\/ 4b K<br \/>\n,{0x7f, 0x40, 0x40, 0x40, 0x40} \/\/ 4c L<br \/>\n,{0x7f, 0x02, 0x0c, 0x02, 0x7f} \/\/ 4d M<br \/>\n,{0x7f, 0x04, 0x08, 0x10, 0x7f} \/\/ 4e N<br \/>\n,{0x3e, 0x41, 0x41, 0x41, 0x3e} \/\/ 4f O<br \/>\n,{0x7f, 0x09, 0x09, 0x09, 0x06} \/\/ 50 P<br \/>\n,{0x3e, 0x41, 0x51, 0x21, 0x5e} \/\/ 51 Q<br \/>\n,{0x7f, 0x09, 0x19, 0x29, 0x46} \/\/ 52 R<br \/>\n,{0x46, 0x49, 0x49, 0x49, 0x31} \/\/ 53 S<br \/>\n,{0x01, 0x01, 0x7f, 0x01, 0x01} \/\/ 54 T<br \/>\n,{0x3f, 0x40, 0x40, 0x40, 0x3f} \/\/ 55 U<br \/>\n,{0x1f, 0x20, 0x40, 0x20, 0x1f} \/\/ 56 V<br \/>\n,{0x3f, 0x40, 0x38, 0x40, 0x3f} \/\/ 57 W<br \/>\n,{0x63, 0x14, 0x08, 0x14, 0x63} \/\/ 58 X<br \/>\n,{0x07, 0x08, 0x70, 0x08, 0x07} \/\/ 59 Y<br \/>\n,{0x61, 0x51, 0x49, 0x45, 0x43} \/\/ 5a Z<br \/>\n,{0x00, 0x7f, 0x41, 0x41, 0x00} \/\/ 5b [<br \/>\n,{0x02, 0x04, 0x08, 0x10, 0x20} \/\/ 5c \u00a5<br \/>\n,{0x00, 0x41, 0x41, 0x7f, 0x00} \/\/ 5d ]<br \/>\n,{0x04, 0x02, 0x01, 0x02, 0x04} \/\/ 5e ^<br \/>\n,{0x40, 0x40, 0x40, 0x40, 0x40} \/\/ 5f _<br \/>\n,{0x00, 0x01, 0x02, 0x04, 0x00} \/\/ 60 `<br \/>\n,{0x20, 0x54, 0x54, 0x54, 0x78} \/\/ 61 a<br \/>\n,{0x7f, 0x48, 0x44, 0x44, 0x38} \/\/ 62 b<br \/>\n,{0x38, 0x44, 0x44, 0x44, 0x20} \/\/ 63 c<br \/>\n,{0x38, 0x44, 0x44, 0x48, 0x7f} \/\/ 64 d<br \/>\n,{0x38, 0x54, 0x54, 0x54, 0x18} \/\/ 65 e<br \/>\n,{0x08, 0x7e, 0x09, 0x01, 0x02} \/\/ 66 f<br \/>\n,{0x0c, 0x52, 0x52, 0x52, 0x3e} \/\/ 67 g<br \/>\n,{0x7f, 0x08, 0x04, 0x04, 0x78} \/\/ 68 h<br \/>\n,{0x00, 0x44, 0x7d, 0x40, 0x00} \/\/ 69 i<br \/>\n,{0x20, 0x40, 0x44, 0x3d, 0x00} \/\/ 6a j<br \/>\n,{0x7f, 0x10, 0x28, 0x44, 0x00} \/\/ 6b k<br \/>\n,{0x00, 0x41, 0x7f, 0x40, 0x00} \/\/ 6c l<br \/>\n,{0x7c, 0x04, 0x18, 0x04, 0x78} \/\/ 6d m<br \/>\n,{0x7c, 0x08, 0x04, 0x04, 0x78} \/\/ 6e n<br \/>\n,{0x38, 0x44, 0x44, 0x44, 0x38} \/\/ 6f o<br \/>\n,{0x7c, 0x14, 0x14, 0x14, 0x08} \/\/ 70 p<br \/>\n,{0x08, 0x14, 0x14, 0x18, 0x7c} \/\/ 71 q<br \/>\n,{0x7c, 0x08, 0x04, 0x04, 0x08} \/\/ 72 r<br \/>\n,{0x48, 0x54, 0x54, 0x54, 0x20} \/\/ 73 s<br \/>\n,{0x04, 0x3f, 0x44, 0x40, 0x20} \/\/ 74 t<br \/>\n,{0x3c, 0x40, 0x40, 0x20, 0x7c} \/\/ 75 u<br \/>\n,{0x1c, 0x20, 0x40, 0x20, 0x1c} \/\/ 76 v<br \/>\n,{0x3c, 0x40, 0x30, 0x40, 0x3c} \/\/ 77 w<br \/>\n,{0x44, 0x28, 0x10, 0x28, 0x44} \/\/ 78 x<br \/>\n,{0x0c, 0x50, 0x50, 0x50, 0x3c} \/\/ 79 y<br \/>\n,{0x44, 0x64, 0x54, 0x4c, 0x44} \/\/ 7a z<br \/>\n,{0x00, 0x08, 0x36, 0x41, 0x00} \/\/ 7b {<br \/>\n,{0x00, 0x00, 0x7f, 0x00, 0x00} \/\/ 7c |<br \/>\n,{0x00, 0x41, 0x36, 0x08, 0x00} \/\/ 7d }<br \/>\n,{0x10, 0x08, 0x08, 0x10, 0x08} \/\/ 7e \u2190<br \/>\n,{0x78, 0x46, 0x41, 0x46, 0x78} \/\/ 7f \u2192<br \/>\n};<\/p>\n<p>void LcdCharacter(char character)<br \/>\n{<br \/>\nLcdWrite(LCD_D, 0x00);<br \/>\nfor (int index = 0; index &lt; 5; index++)<br \/>\n{<br \/>\nLcdWrite(LCD_D, ASCII[character &#8211; 0x20][index]);<br \/>\n}<br \/>\nLcdWrite(LCD_D, 0x00);<br \/>\n}<\/p>\n<p>void LcdClear(void)<br \/>\n{<br \/>\nfor (int index = 0; index &lt; LCD_X * LCD_Y \/ 8; index++)<br \/>\n{<br \/>\nLcdWrite(LCD_D, 0x00);<br \/>\n}<br \/>\n}<\/p>\n<p>void LcdInitialise(void)<br \/>\n{<br \/>\npinMode(PIN_SCE, OUTPUT);<br \/>\npinMode(PIN_RESET, OUTPUT);<br \/>\npinMode(PIN_DC, OUTPUT);<br \/>\npinMode(PIN_SDIN, OUTPUT);<br \/>\npinMode(PIN_SCLK, OUTPUT);<br \/>\npinMode(A0,INPUT);<br \/>\ndigitalWrite(PIN_RESET, LOW);<br \/>\ndigitalWrite(PIN_RESET, HIGH);<br \/>\nLcdWrite(LCD_C, 0x21 ); \/\/ LCD Extended Commands.<br \/>\nLcdWrite(LCD_C, 0xbf ); \/\/ Set LCD Vop (Contrast).<br \/>\nLcdWrite(LCD_C, 0x04 ); \/\/ Set Temp coefficent. \/\/0x04<br \/>\nLcdWrite(LCD_C, 0x00 ); \/\/ LCD bias mode 1:48. \/\/0x13<br \/>\nLcdWrite(LCD_C, 0x20 ); \/\/ LCD Basic Commands<br \/>\nLcdWrite(LCD_C, 0x0C ); \/\/ LCD in normal mode.<\/p>\n<p>}<\/p>\n<p>void LcdString(char *characters)<br \/>\n{<br \/>\nwhile (*characters)<br \/>\n{<br \/>\nLcdCharacter(*characters++);<br \/>\n}<br \/>\n}<\/p>\n<p>void LcdWrite(byte dc, byte data)<br \/>\n{<br \/>\ndigitalWrite(PIN_DC, dc);<br \/>\ndigitalWrite(PIN_SCE, LOW);<br \/>\nshiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);<br \/>\ndigitalWrite(PIN_SCE, HIGH);<br \/>\n}<\/p>\n<p>void LcdWriteCmd(byte cmd)<br \/>\n{<br \/>\ndigitalWrite(PIN_DC, LOW); \/\/DC pin is low for commands<br \/>\ndigitalWrite(PIN_SCE, LOW);<br \/>\nshiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, cmd); \/\/transmit serial data<br \/>\ndigitalWrite(PIN_SCE, HIGH);<br \/>\n}<\/p>\n<p>void setup(void)<br \/>\n{<br \/>\nSerial.begin(9600);<br \/>\nLcdInitialise();<br \/>\nLcdClear();<br \/>\nLcdString(&#8220;rogerbit.com&#8221;);<br \/>\nLcdString(&#8220;Resistencia:&#8221;);<br \/>\n}<\/p>\n<p>void LcdXY(int x, int y)<br \/>\n{<br \/>\nLcdWriteCmd(0x80 | x); \/\/ Column.<br \/>\nLcdWriteCmd(0x40 | y); \/\/ Row.<br \/>\n}<br \/>\nchar string[8];<br \/>\nvoid loop()<br \/>\n{<\/p>\n<p>delay(2000);<br \/>\nint m=analogRead(0);<br \/>\ndouble voltage = m*(5.00000\/1023.00000);<br \/>\ndouble resistor=1000*(5-voltage)\/voltage;<br \/>\nSerial.print(resistor);<br \/>\nSerial.println(&#8221; OHMS&#8221;);<br \/>\nint r=resistor;<br \/>\nLcdXY (95,9);<br \/>\nLcdString((dtostrf(r,6,2,string)));<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>C\u00f3digo Fuente \/\/ M\u00c1S INFOMARCI\u00d3N EN: \/\/ EN MI P\u00c1GINA http:\/\/www.rogerbit.com\/ REGISTRATE TE ESPERAMOS \/\/ CANAL DE YOUTUBE https:\/\/www.youtube.com\/c\/Carlosvolt SUSCRIBETE A MI CANAL Y REGALAME UN ME GUSTA \/\/ SEGUIME EN FACEBOOK https:\/\/www.facebook.com\/groups\/407445649459365 \u00daNETE AL GRUPO \/\/ EN TWITTER https:\/\/twitter.com\/rogerbit_ #define PIN_SCE 7 #define PIN_RESET 6 #define PIN_DC 5 #define PIN_SDIN 4 #define PIN_SCLK 3 [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":208,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":3,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/posts\/207\/revisions\/211"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/media\/208"}],"wp:attachment":[{"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rogerbit.com\/wprb\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}