Read state of pin STM32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 6:28 AM
HELLO,
I use
The
STM32L152RBT6
.
I want to know
how I can
read
the logic state
of a pine tree
if it is
up or down
and display it on
LCD.
#!rocketscience- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 6:53 AM
/* Reads the pin(3) of the GPIOA and store it in ReadValue variable */
u8 ReadValue; ReadValue = GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_3);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 6:54 AM
if (
GPIO_ReadInputDataBit(GPIOA
,
GPIO_Pin_3)==0) { [...code...]}
LCD SPI?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 7:21 AM
LCD SPI?
Probably not, the STM32L152 can drive the simple glass on it's own. Not sure how the pine tree works, spruce or douglas?Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 7:26 AM
thank you very much
,
but
is it possible
to give me
the instruction to
display the status
of
pine
on the display
LCD
STM32
board
after
reading it
and
thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 7:32 AM
Sorry,
Is this board???STM32L152RBT6 microcontroller featuring 128 KB Flash, 16 KB RAM, 4 KB EEPROM, in an LQFP64 package
On-board ST-Link/V2 with selection mode switch to use the kit as a standalone ST-Link/V2 (with SWD connector for programming and debugging)
Board power supply: through USB bus or from an external 3.3 or 5 V supply voltage
External application power supply: 3 V and 5 V
IDD current measurement
LCD
DIP28 package
24 segments, 4 commons
Four LEDs:
LD1 (red/green) for USB communication
LD2 (red) for 3.3 V power on
Two user LEDs, LD3 (green) and LD4 (blue)
Two pushbuttons (user and reset)
One linear touch sensor or four touchkeys
Extension header for LQFP64 I/Os for quick connection to prototyping board and easy probing
http://www.st.com/internet/evalboard/product/250990.jsp
From: ayari.zied
thank you very much
,
but
is it possible
to give me
the instruction to
display the status
of
pine
on the display
LCD
STM32
board
after
reading it
and
thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 7:46 AM
yes it is
the same card
as mine
, so
is
that
you can help me
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-11 9:29 AM
I think you need reference the library: stm32l_discovery_lcd
Then use this function to display message at LCD/* Display Welcome message */
LCD_GLASS_ScrollSentence('' **PIN 3 ACTIVE**'',1,SCROLL_SPEED); This funcion can be found at: stm32l_discovery_lcd.c/**
* @brief This function writes a char in the LCD RAM. * @param ptr: Pointer to string to display on the LCD Glass. * @retval None * @par Required preconditions: Char is ASCCI value ''Ored'' with decimal point or Column flag */ void LCD_GLASS_DisplayStrDeci(uint16_t* ptr) { uint8_t i = 0x01; uint8_t char_tmp; // LCD_GLASS_Clear();/* Send the string character by character on lCD */
while ((*ptr != 0) & (i < 8)) { char_tmp = (*ptr) & 0x00ff; switch ((*ptr) & 0xf000) { case DOT:/* Display one character on LCD with decimal point */
LCD_GLASS_WriteChar(&char_tmp, POINT_ON, COLUMN_OFF, i); break; case DOUBLE_DOT:/* Display one character on LCD with decimal point */
LCD_GLASS_WriteChar(&char_tmp, POINT_OFF, COLUMN_ON, i); break; default: LCD_GLASS_WriteChar(&char_tmp, POINT_OFF, COLUMN_OFF, i); break; }/* Point on the next character */
ptr++;/* Increment the character counter */
i++; } } ________________ Attachments : stm32l_discovery_lcd.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtDW&d=%2Fa%2F0X0000000aKO%2FFhSOtSxvdFAq6DUKhYrE6hnMtwnlFnyWftoSsjUTpB8&asPdf=falsestm32l_discovery_lcd.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtVt&d=%2Fa%2F0X0000000aR6%2FUs8_tSilfLoz7gyKUumW5SKx._7_RWoGFoSo66gJn3Q&asPdf=false- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-14 1:53 AM
Again, thank you
,
but I want
the instruction that
allows me to send
the logic state of
pin
PA3 for
example
to
LCD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-05-14 10:48 AM
Again, thank you
,
but I want
the instruction that
allows me to send
the logic state of
pin
PA3 for
example
to
LCD
if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_3)==0)
LCD_GLASS_DisplayString(''PA3 LOW'');
else
LCD_GLASS_DisplayString(''PA3 HIGH'');
Perhaps you need to review some of the example code for the STM32L Discovery board and get more familiar with programming
Up vote any posts that you find helpful, it shows what's working..
