Task 1:
A function key and a status LED should be connected to the controller.
The key should be connected to pin A0 and the LED to B0.
AI Solution 1 for STM32F042:
NEW FunctionKey BASED_ON PecPinInput BIND pinA0 TO FunctionKey BIND pinPullUp TO FunctionKey NEW StatusLED BASED_ON PecPinOutput BIND pinB0 TO StatusLED AGGREGATION FunctionKey IN Controller AGGREGATION StatusLED IN Controller
AI Solution 1 for MM32L072:
NEW FunctionKey BASED_ON PecPinInput BIND pinA0 TO FunctionKey BIND pinPullUp TO FunctionKey NEW StatusLED BASED_ON PecPinOutput BIND pinB0 TO StatusLED AGGREGATION FunctionKey IN Controller AGGREGATION StatusLED IN Controller
Task 2:
I still need a light sensor and a terminal. The light sensor is connected to ADC1 Channel 6 and the terminal is Uart on UART1 A9.
AI Solution 2 for STM32F042:
NEW LightSensor BASED_ON PecAdcChannel. BIND adc1ch06_stm32 TO LightSensor. NEW Terminal BASED_ON PecUart. BIND uart1portA9_stm32f0 TO Terminal. AGGREGATION LightSensor IN Controller. AGGREGATION Terminal IN Controller.
AI Solution 2 for MM32L073::
NEW LightSensor BASED_ON PecAdcChannel. BIND adc1ch06_mm32 TO LightSensor. NEW Terminal BASED_ON PecUart. BIND uart1portA9_MM32L0 TO Terminal. AGGREGATION LightSensor IN Controller. AGGREGATION Terminal IN Controller.
Task 3:
A hot water pump and a cold water pump should be connected. The hot water pump should be connected to pin B0 and the other to B1. And then a level sensor should be connected to ADC1 channel 7 and a control center to Uart1 A9. An 8-bit sensor value should be used.
AI Solution 3 for STM32F042:
NEW WarmWaterPump BASED_ON PecPinOutput BIND pinB0 TO WarmWaterPump NEW ColdWaterPump BASED_ON PecPinOutput BIND pinB1 TO ColdWaterPump NEW FillLevelSensor BASED_ON PecAdcChannel BIND adc1ch07_stm32 TO FillLevelSensor BIND adcResolution8bit TO FillLevelSensor NEW ControlCenter BASED_ON PecUart BIND uart1portA9_stm32f0 TO ControlCenter AGGREGATION WarmWaterPump IN Controller AGGREGATION ColdWaterPump IN Controller AGGREGATION FillLevelSensor IN Controller. AGGREGATION ControlCenter IN Controller.
AI Solution 3 for MM32L073:
NEW WarmWaterPump BASED_ON PecPinOutput BIND pinB0 TO WarmWaterPump NEW ColdWaterPump BASED_ON PecPinOutput BIND pinB1 TO ColdWaterPump NEW FillLevelSensor BASED_ON PecAdcChannel BIND adc1ch07_mm32 TO FillLevelSensor BIND adcResolution8bit TO FillLevelSensor NEW ControlCenter BASED_ON PecUart BIND uart1portA9_MM32L0 TO ControlCenter AGGREGATION WarmWaterPump IN Controller AGGREGATION ColdWaterPump IN Controller AGGREGATION FillLevelSensor IN Controller. AGGREGATION ControlCenter IN Controller.
Task 4:
I need a trigger, preferably with Timer16, that reads the fill level and transmits it to a PC terminal.
The requirements for the solution are:
The timer interrupt should be triggered every 50 milliseconds
The data transfer should take place at 19200 baud
The values transferred should be pure binary data
Please use Uart 1 on A9.
AI Solution 4 for STM32F042:
NEW FillLevelSensor BASED_ON PecAdcChannel. BIND adc1ch07_stm32 TO FillLevelSensor. BIND adcResolution8bit TO FillLevelSensor. NEW Pump BASED_ON PecPinOutput. BIND pinB1 TO Pump. NEW Terminal BASED_ON PecUart. BIND uart1portA9_stm32f0 TO Terminal. BIND baudrate19200 TO Terminal. NEW Trigger BASED_ON PecTimer. BIND timer16Stm32 TO Trigger. AGGREGATION FillLevelSensor IN Controller. AGGREGATION Pump IN Controller. AGGREGATION Terminal IN Controller. AGGREGATION Trigger IN Controller. ATTRIBUTE fillLevel TYPE uint8_t IN Controller.
AI Solution 4 for MM32L073:
NEW FillLevelSensor BASED_ON PecAdcChannel. BIND adc1ch07_mm32 TO FillLevelSensor. BIND adcResolution8bit TO FillLevelSensor. NEW Pump BASED_ON PecPinOutput. BIND pinB1 TO Pump. NEW Terminal BASED_ON PecUart. BIND uart1portA9_MM32L0 TO Terminal. BIND baudrate19200 TO Terminal. NEW Trigger BASED_ON PecTimer. BIND timer16MM32 TO Trigger. AGGREGATION FillLevelSensor IN Controller. AGGREGATION Pump IN Controller. AGGREGATION Terminal IN Controller. AGGREGATION Trigger IN Controller. ATTRIBUTE fillLevel TYPE uint8_t IN Controller.
Task 5:
I need a suggestion in the familiar style for my class model for a display LED and a function key based on PecLED and PecButtonClickAndHold. The LED should flash briefly when the key is clicked. Flash slowly when the key is held down and go out when it is released. The LED should be connected to pin B4 and the key to D2. For now, I just need the suggestion for the class model.
AI Solution 5:
NEW IndicatorLED BASED_ON PecLED BIND pinB4 TO IndicatorLED NEW FunctionKey BASED_ON PecButtonClickAndHold BIND pinD2 TO FunctionKey AGGREGATION IndicatorLED IN Controller AGGREGATION FunctionKey IN Controller OPERATION onClick IN FunctionKey OPERATION onHoldStart IN FunctionKey
Task 6:
I want to use the SysTick to make three LEDs (red, yellow, green) flash at different speeds (10 ms, 100 ms, 1s). The LEDs are connected to B0, B1 and B3. I also want a speaker on pin B4.
AI Solution 6:
NEW Klasse RedLED BASED_ON PecPinOutput NEW Klasse YellowLED BASED_ON PecPinOutput NEW Klasse GreenLED BASED_ON PecPinOutput NEW Klasse Speaker BASED_ON PecPinOutput AGGREGATION RedLED IN Controller AGGREGATION YellowLED IN Controller AGGREGATION GreenLED IN Controller AGGREGATION Speaker IN Controller BIND pinB0 TO RedLED BIND pinB1 TO YellowLED BIND pinB3 TO GreenLED BIND pinB4 TO Speaker ATTRIBUTE tickCounter TYPE uint32_t IN Controller
Task 7:
A microcontroller application is to be developed in which an LED gently fades in and out for the human eye. The dimming LED should be connected to pin B5. The duty value can be 0 to 1000. According to the data sheet, B0 is Timer 3 Channel 2.
AI Solution 7 for STM32F042:
NEW DimmingLED BASED_ON PecPwmChannel AGGREGATION DimmingLED IN Controller BIND pinB5 TO DimmingLED BIND pwmChannel2 TO DimmingLED BIND Timer3Stm32 TO DimmingLED ATTRIBUTE dutyValue TYPE uint16_t IN Controller
AI Solution 7 for MM32L073:
NEW DimmingLED BASED_ON PecPwmChannel AGGREGATION DimmingLED IN Controller BIND pinB5_Tim3_Ch2 TO DimmingLED ATTRIBUTE dutyValue TYPE uint16_t IN Controller
Task 8:
A microcontroller application is to be developed in which an external signal, falling edge, serves as a trigger for an activity of the controller. The controller's reaction to the external event is to be realized by switching an LED.
The solution should meet the following requirements: External signal, falling edge, through button on A0 LED display on pin B0 No constant polling of the button Handling of the event directly in the interrupt
AI Solution 8:
NEW ExternalButton BASED_ON PecPinInterrupt NEW LEDIndicator BASED_ON PecPinOutput AGGREGATION ExternalButton IN Controller AGGREGATION LEDIndicator IN Controller BIND pinA0 TO ExternalButton BIND pinB0 TO LEDIndicator ATTRIBUTE ledState TYPE bool IN Controller
Task 9:
Develop a microcontroller application in which an I²C temperature sensor is read and the current temperature is sent to the PC via UART.
Requirements for the solution: Temperature sensor LM75, address configuration 0x90 I2C bus to F0 / F1 Uart 1 to A9 / A10 Data transfer 8 bit, 19200 baud Temperature values in full degrees Celsius
AI Solution 9 for STM32F042:
NEW TemperatureSensor BASED_ON PecLM75 AGGREGATION TemperatureSensor IN Controller NEW I2CBus BASED_ON PecI2cBus AGGREGATION I2CBus IN Controller BIND i2c1_F0/F1_stm32F042 TO I2CBus NEW Uart BASED_ON: PecUart AGGREGATION Uart IN Controller BIND uart1portA9_stm32f0 TO Uart BIND baudrate19200 TO Uart ATTRIBUTE: temperatureValue TYPE int8_t IN Controller
AI Solution 9 for MM32L0144:
NEW TemperatureSensor BASED_ON PecLM75 AGGREGATION TemperatureSensor IN Controller NEW I2CBus BASED_ON PecI2cBus AGGREGATION I2CBus IN Controller BIND i2c1_D0_D1_MM32F0144 TO I2CBus NEW Uart BASED_ON: PecUart AGGREGATION Uart IN Controller BIND uart1portA9_MM32F0 TO Uart BIND baudrate19200 TO Uart ATTRIBUTE: temperatureValue TYPE int8_t IN Controller
Task 10:
A steam valve and a gate valve should be connected.
The valve should be connected to pin B4 and the gate to B6.
And then I need a pressure sensor on ADC1 channel 3 and a PC terminal via Uart1 A9.
A 10-bit sensor value is required. The terminal runs at 19200 BAUD. The data transfer should take place every 100 ms.
AI Solution 10:
NEW SteamValve BASED_ON PecPinOutput BIND pinB4 TO SteamValve NEW GateValve BASED_ON PecPinOutput BIND pinB6 TO GateValve NEW PressureSensor BASED_ON PecAdcChannel BIND adc1ch03_stm32 TO PressureSensor BIND adcResolution10bit TO PressureSensor NEW Terminal BASED_ON PecUart BIND uart1portA9_stm32f0 TO Terminal BIND baudrate19200 TO Terminal AGGREGATION SteamValve IN Controller AGGREGATION GateValve IN Controller AGGREGATION PressureSensor IN Controller AGGREGATION Terminal IN Controller ATTRIBUTE pressureValue TYPE int16_t IN Controller OVERWRITE onEvent100ms IN Controller FROM PecAppModul
Task 11:
I want to program a robot arm. The robot arm is connected to my controller. The arm consists of a carousel, a lower leg, an upper arm, a hand and also a barrier. The carousel, lower leg, upper arm, hand and barrier are implemented with servo motors. The servos are pwm driven. To monitor the robot arm, data should be sent to a PC app. The UART sends the data to the PC at 19200 baud. There is also a start button on the controller. When clicked, the pre-programmed movement sequence is started. If you hold the button for a long time, the process is aborted. The carousel is to B0, LowerLeg to B1, UpperArm to B3, Hand to B4, Barrier to B5 and StartButton to A0, the UART is also uart 2 on A14
AI Solution 11 for STM32F042:
NEW Robot BASED_ON PecAppModul NEW Carousel BASED_ON PecServoTypeB NEW LowerLeg BASED_ON PecServoTypeB NEW UpperArm BASED_ON PecServoTypeB NEW Hand BASED_ON PecServoTypeB NEW Barrier BASED_ON PecServoTypeB NEW StartButton BASED_ON PecButtonClickAndHold NEW Terminal BASED_ON PecUart BIND pwmB00Tim3Ch3_stm32f0 TO Carousel BIND pwmB01Tim3Ch4_stm32f0 TO LowerLeg BIND pwmB03Tim2Ch2_stm32f0 TO UpperArm BIND pwmB04Tim3Ch1_stm32f0 TO Hand BIND pwmB05Tim3Ch2_stm32f0 TO Barrier BIND pinA0 TO StartButton BIND uart2portA14_stm32f0 TO Terminal BIND baudrate19200 TO Terminal AGGREGATION Robot IN Controller AGGREGATION Carousel IN Robot AGGREGATION LowerLeg IN Robot AGGREGATION UpperArm IN Robot AGGREGATION Hand IN Robot AGGREGATION Barrier IN Robot AGGREGATION StartButton IN Controller AGGREGATION Terminal IN Controller ATTRIBUTE isProcessRunning TYPE bool IN Robot OVERWRITE onClick IN StartButton FROM PecButtonClickAndHold OVERWRITE onHoldStart IN StartButton FROM PecButtonClickAndHold
AI Solution 11 for MM32L073:
NEW Robot BASED_ON PecAppModul NEW Carousel BASED_ON PecServoTypeB NEW LowerLeg BASED_ON PecServoTypeB NEW UpperArm BASED_ON PecServoTypeB NEW Hand BASED_ON PecServoTypeB NEW Barrier BASED_ON PecServoTypeB NEW StartButton BASED_ON PecButtonClickAndHold NEW Terminal BASED_ON PecUart BIND pinB0_Tim3_Ch3 TO Carousel BIND pinB1_Tim3_Ch4 TO LowerLeg BIND pinB3_Tim2_Ch2 TO UpperArm BIND pinB4_Tim3_Ch1 TO Hand BIND pinB5_Tim3_Ch2 TO Barrier BIND pinA0 TO StartButton BIND uart2portA14_MM32L0 TO Terminal BIND baudrate19200 TO Terminal AGGREGATION Robot IN Controller AGGREGATION Carousel IN Robot AGGREGATION LowerLeg IN Robot AGGREGATION UpperArm IN Robot AGGREGATION Hand IN Robot AGGREGATION Barrier IN Robot AGGREGATION StartButton IN Controller AGGREGATION Terminal IN Controller ATTRIBUTE isProcessRunning TYPE bool IN Robot OVERWRITE onClick IN StartButton FROM PecButtonClickAndHold OVERWRITE onHoldStart IN StartButton FROM PecButtonClickAndHold
Task 12:
AI Solution 12:
Task 13:
AI Solution 13:
Task 1x:
AI Solution x: